For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
      • GETSearch invoices
      • POSTCreate
      • GETGet
      • POSTUpdate
      • DELDelete
      • GETEvents
        • POSTCreate Bulk Invoices (Sync)
        • PUTUpdate Bulk Invoices (Sync)
        • POSTApprove Bulk Invoices (Sync)
        • GETDownload Bulk Invoices (Sync)
Logo
Sign inBook a demo
API ReferenceInvoiceBulk

Create Bulk Invoices (Sync)

POST
https://api.mercoa.com/invoices
POST
/invoices
$curl -X POST https://api.mercoa.com/invoices \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "invoices": [
> {
> "status": "NEW",
> "amount": 100,
> "currency": "USD",
> "invoiceDate": "2021-01-01T00:00:00Z",
> "dueDate": "2021-01-31T00:00:00Z",
> "invoiceNumber": "INV-123",
> "noteToSelf": "For the month of January",
> "payerId": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
> "paymentSourceId": "pm_4794d597-70dc-4fec-b6ec-c5988e759769",
> "vendorId": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
> "paymentDestinationId": "pm_5fde2f4a-facc-48ef-8f0d-6b7d087c7b18",
> "paymentDestinationOptions": {
> "type": "check",
> "delivery": "MAIL",
> "printDescription": true
> },
> "lineItems": [
> {
> "amount": 100,
> "currency": "USD",
> "description": "Product A",
> "name": "Product A",
> "quantity": 1,
> "unitPrice": 100,
> "category": "EXPENSE",
> "serviceStartDate": "2021-01-01T00:00:00Z",
> "serviceEndDate": "2021-01-31T00:00:00Z",
> "metadata": {
> "key1": "value1",
> "key2": "value2"
> },
> "glAccountId": "600394"
> }
> ],
> "creatorEntityId": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
> "creatorUserId": "user_e24fc81c-c5ee-47e8-af42-4fe29d895506"
> }
> ]
>}'
1{
2 "data": [
3 {
4 "id": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
5 "foreignId": "YOUR-INVOICE-ID"
6 },
7 {
8 "foreignId": "YOUR-SECOND-INVOICE-ID",
9 "error": "Invoice creation failed"
10 }
11 ]
12}
Create multiple invoices in bulk. This endpoint will process synchronously and return a list of invoices that were created or failed to create.
Was this page helpful?
Previous

Update Bulk Invoices (Sync)

Next
Built with

Authentication

AuthorizationBearer

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

Query parameters

emitWebhooksbooleanOptionalDefaults to false
If true, webhooks will be emitted for each invoice that is created. By default, webhooks are not emitted.

Request

This endpoint expects an object.
invoiceslist of objectsRequired

Response

This endpoint returns an object.
datalist of objects

Errors

400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
409
Conflict
500
Internal Server Error
501
Unimplemented