Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
Logo
Sign inBook a demo
API ReferenceInvoiceLine Item

Update invoice line item

PUT
https://api.mercoa.com/invoice/:invoiceId/line-item/:lineItemId
PUT
/invoice/:invoiceId/line-item/:lineItemId
1curl -X PUT https://api.mercoa.com/invoice/in_d8f68285-1c6d-4d5a-a9e3-252c3180fac4/line-item/inli_8aa84cb8-2ae7-4579-8fa3-87586e7c14a7 \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "name": "Product A",
6 "description": "Product A",
7 "serviceStartDate": "2021-01-01T00:00:00Z",
8 "serviceEndDate": "2021-01-31T00:00:00Z",
9 "metadata": {
10 "key1": "value1",
11 "key2": "value2"
12 },
13 "glAccountId": "600394"
14}'
Try it
200Updated
1{
2 "approvalPolicy": [
3 {
4 "id": "apvl_8545a84e-a45f-41bf-bdf1-33b42a55812c",
5 "trigger": [
6 {
7 "type": "amount",
8 "amount": 100,
9 "currency": "USD"
10 }
11 ],
12 "rule": {
13 "type": "approver",
14 "identifierList": {
15 "type": "rolesList",
16 "value": [
17 "Admin",
18 "Controller"
19 ]
20 },
21 "numApprovers": 2
22 },
23 "upstreamPolicyId": "root",
24 "createdAt": "2024-01-01T00:00:00Z",
25 "updatedAt": "2024-01-02T00:00:00Z"
26 }
27 ],
28 "approvers": [
29 {
30 "approvalPolicyId": "apvl_5ce50275-1789-42ea-bc60-bb7e6d03635c",
31 "approvalSlotId": "inap_9bb311c9-7c15-4c9e-8148-63814e0abec6",
32 "action": "APPROVE",
33 "eligibleRoles": [
34 "admin"
35 ],
36 "eligibleUserIds": [
37 "user_e24fc81c-c5ee-47e8-af42-4fe29d895506"
38 ],
39 "date": "2021-01-01T00:00:00Z",
40 "assignedUserId": "user_e24fc81c-c5ee-47e8-af42-4fe29d895506"
41 }
42 ],
43 "createdAt": "2021-01-01T00:00:00Z",
44 "hasDocuments": true,
45 "hasSourceEmail": true,
46 "id": "in_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
47 "metadata": {
48 "key1": "value1",
49 "key2": "value2"
50 },
51 "paymentDestinationConfirmed": true,
52 "status": "PAID",
53 "updatedAt": "2021-01-01T00:00:00Z",
54 "amount": 100,
55 "comments": [
56 {
57 "id": "ic_b3525b66-da94-4525-9f31-426bcf657128",
58 "text": "This is an approval comment",
59 "createdAt": "2021-01-01T00:00:00Z",
60 "updatedAt": "2021-01-01T00:00:00Z",
61 "user": {
62 "id": "user_ec3aafc8-ea86-408a-a6c1-545497badbbb",
63 "roles": [
64 "admin",
65 "approver"
66 ],
67 "createdAt": "2024-01-01T00:00:00Z",
68 "updatedAt": "2024-01-01T00:00:00Z",
69 "foreignId": "MY-DB-ID-12345",
70 "email": "john.doe@acme.com",
71 "name": "John Doe"
72 },
73 "associatedApprovalAction": {
74 "userId": "user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
75 "action": "APPROVE"
76 }
77 }
78 ],
79 "creatorUser": {
80 "id": "user_ec3aafc8-ea86-408a-a6c1-545497badbbb",
81 "roles": [
82 "admin",
83 "approver"
84 ],
85 "createdAt": "2024-01-01T00:00:00Z",
86 "updatedAt": "2024-01-01T00:00:00Z",
87 "foreignId": "MY-DB-ID-12345",
88 "email": "john.doe@acme.com",
89 "name": "John Doe"
90 },
91 "currency": "USD",
92 "deductionDate": "2021-01-01T00:00:00Z",
93 "dueDate": "2021-01-31T00:00:00Z",
94 "foreignId": "YOUR-DATABASE-ID",
95 "invoiceDate": "2021-01-01T00:00:00Z",
96 "invoiceNumber": "INV-123",
97 "lineItems": [
98 {
99 "id": "inli_26672f38-eb9a-48f1-a7a0-f1b855e38cd7",
100 "currency": "USD",
101 "category": "EXPENSE",
102 "createdAt": "2021-01-01T00:00:00Z",
103 "updatedAt": "2021-01-01T00:00:00Z",
104 "amount": 100,
105 "description": "Product A",
106 "name": "Product A",
107 "quantity": 1,
108 "unitPrice": 100,
109 "serviceStartDate": "2021-01-01T00:00:00Z",
110 "serviceEndDate": "2021-01-31T00:00:00Z",
111 "metadata": {
112 "key1": "value1",
113 "key2": "value2"
114 },
115 "glAccountId": "600394"
116 }
117 ],
118 "noteToSelf": "For the month of January",
119 "payer": {
120 "acceptedTos": true,
121 "accountType": "business",
122 "createdAt": "2024-01-01T00:00:00Z",
123 "email": "customer@acme.com",
124 "id": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
125 "isCustomer": true,
126 "isNetworkPayee": false,
127 "isNetworkPayor": false,
128 "isPayee": false,
129 "isPayor": true,
130 "name": "Acme Inc.",
131 "profile": {
132 "business": {
133 "legalBusinessName": "Acme Inc.",
134 "taxIDProvided": true,
135 "email": "customer@acme.com",
136 "businessType": "llc",
137 "phone": {
138 "countryCode": "1",
139 "number": "4155551234"
140 },
141 "address": {
142 "addressLine1": "123 Main St",
143 "city": "San Francisco",
144 "stateOrProvince": "CA",
145 "postalCode": "94105",
146 "addressLine2": "Unit 1",
147 "country": "US"
148 },
149 "ownersProvided": true,
150 "taxId": {
151 "ein": {
152 "number": "12-3456789"
153 }
154 }
155 }
156 },
157 "status": "verified",
158 "updatedAt": "2024-01-02T00:00:00Z",
159 "accounts": [
160 {
161 "accountId": "85866843",
162 "postalCode": "94105",
163 "nameOnAccount": "John Doe"
164 }
165 ],
166 "counterpartyType": [
167 "ENTITY"
168 ],
169 "foreignId": "MY-DB-ID-12345",
170 "paymentMethods": [
171 {
172 "type": "bankAccount",
173 "accountName": "My Checking Account",
174 "accountNumber": "99988767623",
175 "accountType": "CHECKING",
176 "bankName": "Chase",
177 "createdAt": "2021-01-01T00:00:00Z",
178 "frozen": false,
179 "id": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
180 "isDefaultDestination": true,
181 "isDefaultSource": true,
182 "metadata": {},
183 "routingNumber": "12345678",
184 "status": "VERIFIED",
185 "supportedCurrencies": [
186 "USD"
187 ],
188 "updatedAt": "2021-01-01T00:00:00Z",
189 "confirmedByEntity": true
190 }
191 ]
192 },
193 "payerId": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
194 "paymentDestination": {
195 "type": "check",
196 "addressLine1": "123 Main St",
197 "city": "New York",
198 "country": "US",
199 "createdAt": "2021-01-01T00:00:00Z",
200 "frozen": false,
201 "id": "pm_5fde2f4a-facc-48ef-8f0d-6b7d087c7b18",
202 "isDefaultDestination": true,
203 "isDefaultSource": false,
204 "metadata": {},
205 "payToTheOrderOf": "John Doe",
206 "postalCode": "10001",
207 "stateOrProvince": "NY",
208 "supportedCurrencies": [
209 "USD"
210 ],
211 "updatedAt": "2021-01-01T00:00:00Z",
212 "addressLine2": "Apt 1",
213 "confirmedByEntity": true
214 },
215 "paymentDestinationId": "pm_5fde2f4a-facc-48ef-8f0d-6b7d087c7b18",
216 "paymentDestinationOptions": {
217 "type": "check",
218 "delivery": "MAIL",
219 "printDescription": true
220 },
221 "paymentSource": {
222 "type": "bankAccount",
223 "accountName": "My Checking Account",
224 "accountNumber": "99988767623",
225 "accountType": "CHECKING",
226 "bankName": "Chase",
227 "createdAt": "2021-01-01T00:00:00Z",
228 "frozen": false,
229 "id": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
230 "isDefaultDestination": true,
231 "isDefaultSource": true,
232 "metadata": {},
233 "routingNumber": "12345678",
234 "status": "VERIFIED",
235 "supportedCurrencies": [
236 "USD"
237 ],
238 "updatedAt": "2021-01-01T00:00:00Z",
239 "confirmedByEntity": true
240 },
241 "paymentSourceId": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
242 "paymentSourceOptions": {
243 "type": "bnpl",
244 "acceptedTerms": true,
245 "defermentWeeks": 8,
246 "installmentsStartDate": "2025-06-18"
247 },
248 "processedAt": "2021-01-01T00:00:00Z",
249 "serviceEndDate": "2021-01-31T00:00:00Z",
250 "serviceStartDate": "2021-01-01T00:00:00Z",
251 "settlementDate": "2021-01-03T00:00:00Z",
252 "transactions": [
253 {
254 "type": "bankAccountToBankAccount",
255 "amount": 10000,
256 "createdAt": "2024-01-01T00:00:00Z",
257 "currency": "USD",
258 "id": "trx_bb08e72f-19f8-45f3-bcf9-46fdc46cb2f4",
259 "payer": {
260 "acceptedTos": true,
261 "accountType": "business",
262 "createdAt": "2024-01-01T00:00:00Z",
263 "email": "customer@acme.com",
264 "id": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
265 "isCustomer": true,
266 "isNetworkPayee": false,
267 "isNetworkPayor": false,
268 "isPayee": false,
269 "isPayor": true,
270 "name": "Acme Inc.",
271 "profile": {
272 "business": {
273 "legalBusinessName": "Acme Inc.",
274 "taxIDProvided": true,
275 "email": "customer@acme.com",
276 "businessType": "llc",
277 "phone": {
278 "countryCode": "1",
279 "number": "4155551234"
280 },
281 "address": {
282 "addressLine1": "123 Main St",
283 "city": "San Francisco",
284 "stateOrProvince": "CA",
285 "postalCode": "94105",
286 "addressLine2": "Unit 1",
287 "country": "US"
288 },
289 "ownersProvided": true,
290 "taxId": {
291 "ein": {
292 "number": "12-3456789"
293 }
294 }
295 }
296 },
297 "status": "verified",
298 "updatedAt": "2024-01-02T00:00:00Z",
299 "accounts": [
300 {
301 "accountId": "85866843",
302 "postalCode": "94105",
303 "nameOnAccount": "John Doe"
304 }
305 ],
306 "counterpartyType": [
307 "ENTITY"
308 ],
309 "foreignId": "MY-DB-ID-12345",
310 "paymentMethods": [
311 {
312 "type": "bankAccount",
313 "accountName": "My Checking Account",
314 "accountNumber": "99988767623",
315 "accountType": "CHECKING",
316 "bankName": "Chase",
317 "createdAt": "2021-01-01T00:00:00Z",
318 "frozen": false,
319 "id": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
320 "isDefaultDestination": true,
321 "isDefaultSource": true,
322 "metadata": {},
323 "routingNumber": "12345678",
324 "status": "VERIFIED",
325 "supportedCurrencies": [
326 "USD"
327 ],
328 "updatedAt": "2021-01-01T00:00:00Z",
329 "confirmedByEntity": true
330 }
331 ]
332 },
333 "payerId": "ent_bb08e72f-19f8-45f3-bcf9-46fdc46cb2f4",
334 "paymentDestination": {
335 "type": "bankAccount",
336 "accountName": "My Checking Account",
337 "accountNumber": "99988767623",
338 "accountType": "CHECKING",
339 "bankName": "Chase",
340 "createdAt": "2021-01-01T00:00:00Z",
341 "frozen": false,
342 "id": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
343 "isDefaultDestination": true,
344 "isDefaultSource": true,
345 "metadata": {},
346 "routingNumber": "12345678",
347 "status": "VERIFIED",
348 "supportedCurrencies": [
349 "USD"
350 ],
351 "updatedAt": "2021-01-01T00:00:00Z",
352 "confirmedByEntity": true
353 },
354 "paymentDestinationId": "pm_65523ab0-043d-4706-b2b2-0b73fed92269",
355 "paymentSource": {
356 "type": "bankAccount",
357 "accountName": "My Checking Account",
358 "accountNumber": "99988767623",
359 "accountType": "CHECKING",
360 "bankName": "Chase",
361 "createdAt": "2021-01-01T00:00:00Z",
362 "frozen": false,
363 "id": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
364 "isDefaultDestination": true,
365 "isDefaultSource": true,
366 "metadata": {},
367 "routingNumber": "12345678",
368 "status": "VERIFIED",
369 "supportedCurrencies": [
370 "USD"
371 ],
372 "updatedAt": "2021-01-01T00:00:00Z",
373 "confirmedByEntity": true
374 },
375 "paymentSourceId": "pm_65523ab0-043d-4706-b2b2-0b73fed92269",
376 "status": "COMPLETED",
377 "updatedAt": "2024-01-01T00:00:00Z",
378 "vendor": {
379 "acceptedTos": false,
380 "accountType": "business",
381 "createdAt": "2024-01-01T00:00:00Z",
382 "email": "vendor@bigboxstore.com",
383 "id": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
384 "isCustomer": false,
385 "isNetworkPayee": false,
386 "isNetworkPayor": false,
387 "isPayee": true,
388 "isPayor": false,
389 "name": "Big Box Store",
390 "profile": {
391 "business": {
392 "legalBusinessName": "Big Box Store",
393 "taxIDProvided": false,
394 "email": "vendor@bigboxstore.com",
395 "businessType": "publicCorporation",
396 "ownersProvided": false
397 }
398 },
399 "status": "unverified",
400 "updatedAt": "2024-01-02T00:00:00Z",
401 "counterpartyType": [
402 "ENTITY"
403 ],
404 "foreignId": "MY-DB-ID-90909",
405 "paymentMethods": [
406 {
407 "type": "bankAccount",
408 "accountName": "Vendor Checking Account",
409 "accountNumber": "55934059697648",
410 "accountType": "CHECKING",
411 "bankName": "Chase",
412 "createdAt": "2021-01-01T00:00:00Z",
413 "frozen": false,
414 "id": "pm_7610541f-4619-4033-8620-cfccfb811293",
415 "isDefaultDestination": true,
416 "isDefaultSource": true,
417 "metadata": {},
418 "routingNumber": "66554433",
419 "status": "NEW",
420 "supportedCurrencies": [
421 "USD"
422 ],
423 "updatedAt": "2021-01-01T00:00:00Z",
424 "confirmedByEntity": false
425 }
426 ]
427 },
428 "vendorId": "ent_bb08e72f-19f8-45f3-bcf9-46fdc46cb2f4"
429 }
430 ],
431 "vendor": {
432 "acceptedTos": false,
433 "accountType": "business",
434 "createdAt": "2024-01-01T00:00:00Z",
435 "email": "vendor@bigboxstore.com",
436 "id": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
437 "isCustomer": false,
438 "isNetworkPayee": false,
439 "isNetworkPayor": false,
440 "isPayee": true,
441 "isPayor": false,
442 "name": "Big Box Store",
443 "profile": {
444 "business": {
445 "legalBusinessName": "Big Box Store",
446 "taxIDProvided": false,
447 "email": "vendor@bigboxstore.com",
448 "businessType": "publicCorporation",
449 "ownersProvided": false
450 }
451 },
452 "status": "unverified",
453 "updatedAt": "2024-01-02T00:00:00Z",
454 "counterpartyType": [
455 "ENTITY"
456 ],
457 "foreignId": "MY-DB-ID-90909",
458 "paymentMethods": [
459 {
460 "type": "bankAccount",
461 "accountName": "Vendor Checking Account",
462 "accountNumber": "55934059697648",
463 "accountType": "CHECKING",
464 "bankName": "Chase",
465 "createdAt": "2021-01-01T00:00:00Z",
466 "frozen": false,
467 "id": "pm_7610541f-4619-4033-8620-cfccfb811293",
468 "isDefaultDestination": true,
469 "isDefaultSource": true,
470 "metadata": {},
471 "routingNumber": "66554433",
472 "status": "NEW",
473 "supportedCurrencies": [
474 "USD"
475 ],
476 "updatedAt": "2021-01-01T00:00:00Z",
477 "confirmedByEntity": false
478 }
479 ]
480 },
481 "vendorId": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"
482}
Update invoice line item
Was this page helpful?
Previous

Add Approver

Next
Built with
Add Approver
Update invoice line item

Authentication

AuthorizationBearer
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Path parameters

invoiceIdstringRequired
Invoice ID
lineItemIdstringRequired
Invoice Line Item ID

Request

This endpoint expects an object.
namestringOptional
descriptionstringOptional
categorystringOptional
Category of the line item.
serviceStartDatedatetimeOptional
serviceEndDatedatetimeOptional
metadatamap from strings to stringsOptional
glAccountIdstringOptional
ID of general ledger account associated with this line item.

Response

This endpoint returns an object.
approvalPolicylist of objects
approverslist of objects
createdAtdatetime
hasDocumentsboolean
True if the invoice has documents attached.
hasSourceEmailboolean
True if the invoice was created by an incoming email.
idstring
metadatamap from strings to strings
Metadata associated with this invoice.
paymentDestinationConfirmedboolean
True if the payment destination has been confirmed by the vendor. False if the payment destination has been set (for example, a check to an address) but has not been confirmed by the vendor.
statusenum
updatedAtdatetime
amountdouble or null
Total amount of invoice in major units
batchPaymentboolean or null
If true, this invoice will be paid as a batch payment. Batches are automatically determined by Mercoa based on the payment source, destination, and scheduled payment date.
commentslist of objects or null
creatorEntityIdstring or null
The ID of the entity who created this invoice.
creatorUserobject or null
Entity user who created this invoice.
currencyenum or null
Currency code for the amount. Defaults to USD.
deductionDatedatetime or null
Initial date when funds are scheduled to be deducted from payer's account. The actual deduction date may differ from this date, and will be reflected in the processedAt field.
dueDatedatetime or null
Due date of invoice.
failureTypeenum or null
If the invoice failed to be paid, this field will be populated with the type of failure.
Allowed values:
feesobject or null
Fees associated with this invoice.
foreignIdstring or null
The ID used to identify this invoice in your system. This ID must be unique within each creatorEntity in your system, e.g. two invoices with the same creatorEntity may not have the same foreign ID.
invoiceDatedatetime or null
Date the invoice was issued.
invoiceNumberstring or null
lineItemslist of objects or null
netTermsinteger or null
Net terms in days. Must be a positive number.
nextDeductionDatedatetime or null
For invoice templates, this is the date when the next recurring payment will be scheduled.
noteToSelfstring or null
ocrJobIdstring or null
ID of the OCR job that processed this invoice.
payerobject or null
payerIdstring or null
paymentDestinationobject or null
paymentDestinationIdstring or null
paymentDestinationOptionsobject or null
paymentScheduleobject or null
If this is a recurring invoice, this will be the payment schedule for the invoice. If not provided, this will be a one-time invoice.
paymentSourceobject or null
paymentSourceIdstring or null
paymentSourceOptionsobject or null
paymentTimingobject or null
processedAtdatetime or null
Date when the invoice payment was processed.
recurringTemplateIdstring or null
ID of the invoice template that created this recurring invoice. Only present if the invoice was created from a recurring template.
serviceEndDatedatetime or null
serviceStartDatedatetime or null
settlementDatedatetime or null
Date of funds settlement.
shippingAmountdouble or null
Shipping amount for this invoice.
taxAmountdouble or null
Tax amount for this invoice.
transactionslist of objects or null
Transactions associated with this invoice.
vendorobject or null
vendorCreditIdslist of strings or null
The IDs of the vendor credits that are currently applied to this invoice.
vendorIdstring or null

Errors

True if the payment destination has been confirmed by the vendor. False if the payment destination has been set (for example, a check to an address) but has not been confirmed by the vendor.

If this is a recurring invoice, this will be the payment schedule for the invoice. If not provided, this will be a one-time invoice.

Bearer authentication of the form Bearer <token>, where token is your auth token.