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
        • GETGet Attachments
        • POSTUpload Attachment
        • DELDelete Attachment
        • GETGet Invoice PDF
        • GETGet Check PDF
        • GETGet Payment Confirmation PDF
        • GETGet Source Email
Logo
Sign inBook a demo
API ReferenceInvoiceDocument

Upload Attachment

POST
https://api.mercoa.com/invoice/:invoiceId/document
POST
/invoice/:invoiceId/document
$curl -X POST https://api.mercoa.com/invoice/in_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9/document \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "document": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII"
>}'

Upload documents (scanned/uploaded PDFs and images) associated with this Invoice

Was this page helpful?
Previous

Delete Attachment

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

invoiceIdstringRequired
Invoice ID or Invoice ForeignID

Request

This endpoint expects an object.
documentstringRequired

Base64-encoded string. Supported file types include PNG, JPG, WEBP, PDF, and all Microsoft Office formats (automatically converted to PDF). Max file size 10MB.

typeenumOptional
Specify Document Type, defaults to INVOICE

Errors

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