API reference

Document sync

Keep your own system in step: what changed, and each document as JSON, cXML or UBL.

More about this resource

For an ERP, billing or cash-application system that follows Pleaxy without a person retyping anything. ListSyncEvents says what changed since your last call (or a webhook pushes it); you then read the document: a purchase order as a cXML OrderRequest or UBL Order, where an invoice stands, an invoice as a UBL Invoice, and each payment with its remittance. Every document is the supplier's copy, whoever asks: never the buyer's internal notes, approvals or who recorded a payment. A buyer's ERP or bank feed records payments with RecordPayments.

List sync events

Lists what changed since your last call, oldest first.

GET/v1/workspaces/{regionId}/sync/events

Parameters

  • afterstring

    The nextCursor of your last call (an event id). Leave it out to start from the oldest event.

  • limitinteger

    1-500 events per call. Defaults to 100.

Returns

200 OK with the object shown in the response.

More details

What changed in this workspace side, oldest first. An event names a document, never its content: read the document with the operation for it, so you always get its current version. Pass nextCursor back as after on your next call; while hasMore is true, call again at once. Events are kept 30 days and delivered at least once, so the same change can come twice; the newest 5 seconds wait for the next call. A Supplier caller gets purchase_order.issued, changed, canceled and rejected, invoice.received, approved, rejected, paid, payment_withdrawn, remittance_sent and credit_applied, invoice.updated (a buyer put the invoice on hold for review, or released it: read GetInvoiceStatus), and credit_note.accepted and rejected. A Buyer caller gets invoice.received and credit_note.received (a supplier sent one); invoice.updated (an invoice was approved, by a person or automatically, or rejected, or its supplier confirmed bank details or reported it); invoice.payment (a payment was recorded or withdrawn, credit settled the invoice, or a payment through Pleaxy went through or failed: read GetInvoiceRemittance); purchase_order.updated (an order was approved, rejected or canceled); and purchase_order.confirmed and purchase_order.shipped (read GetPurchaseOrderFulfillment). It gets only the document types its procurement role can view.

Response fields

  • events[].typestring

    What happened, as <document>.<change>, e.g. invoice.paid.

  • events[].buyerWorkspaceIdstring

    Supplier callers: the buyer's Workspace ID, to pass as ?buyer= when reading the document.

  • nextCursorstring

    Where your next call starts. Absent only before the first event.

  • hasMoreboolean

    More events are waiting: call again at once.

Errors

  • 400 Bad Request - after isn't an event id, or limit is out of range.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/sync/events
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/reg_01k5x8p9j3q7vn2mhb4tzc6rde.supplier/sync/events?after=EV-mgx2k9a1-0c4f81d2" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
  "events": [
    { "id": "EV-mgx2kb7e-91a2c3d4", "at": "2026-10-23T10:02:11.402Z", "type": "invoice.paid", "documentType": "invoice", "documentId": "INV-3C9E71B2", "buyerWorkspaceId": "reg_01k5x8n2a7c4bq9wze0tkv3fjm.buyer" }
  ],
  "nextCursor": "EV-mgx2kb7e-91a2c3d4",
  "hasMore": false
}

Get purchase order document

Returns an issued purchase order as cXML or UBL.

GET/v1/workspaces/{regionId}/purchase-orders/{poId}/document

Parameters

  • poIdstringRequired

    The purchase order identifier.

  • format"cxml" | "ubl"

    The document format. Defaults to cxml.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

An issued purchase order as a document your system takes in. format=cxml (the default) is a cXML OrderRequest: type new, update from version 2, delete once canceled. format=ubl is a UBL 2.1 Order, or an OrderCancellation once canceled. Both parties are named by their Workspace IDs. It is the supplier's copy whoever asks. A supplier whose buyers share a PO id adds ?buyer=<buyer Workspace ID>.

Errors

  • 400 Bad Request - format isn't cxml or ubl.
  • 404 Not Found - No purchase order with this id is yours.
  • 409 Conflict - Code ORDER_NOT_ISSUED: a draft, an order waiting for approval, or a rejected one was never sent to its supplier.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/purchase-orders/{poId}/document
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/purchase-orders/{poId}/document" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
application/xml

Get invoice document

Returns an invoice as a UBL 2.1 Invoice.

GET/v1/workspaces/{regionId}/invoices/{invoiceId}/document

Parameters

  • invoiceIdstringRequired

    The invoice identifier.

  • format"ubl"

    The only format, and the default.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

An invoice as a UBL 2.1 Invoice (type 380, or 383 for a debit note), for the buyer's ERP to book or the supplier's archive: its lines, document-level discounts and charges, tax and withholdings, prepayments, the supplier's payment instructions, and the PO and contract it bills. The totals reconcile to the invoice's amount. It is the supplier's view whoever asks: no matching, findings or approvals.

Errors

  • 404 Not Found - No invoice with this id is yours.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/invoices/{invoiceId}/document
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/{invoiceId}/document" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
application/xml

Get invoice status

Returns where an invoice stands, with the standard status codes.

GET/v1/workspaces/{regionId}/invoices/{invoiceId}/status

Parameters

  • invoiceIdstringRequired

    The invoice identifier.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

Where an invoice stands, for the system that sent it or the one that pays it, as one status with the codes e-invoicing systems use for it. The same as cXML or UBL is GetInvoiceStatusDocument. It is the supplier's view whoever asks.

Response fields

  • statusstring

    received: matching hasn't run. in_process: waiting on approval. under_query: see queryReason. approved: approved and unpaid. payment_in_progress: a payment through Pleaxy is under way. paid. rejected. duplicate: rejected as a duplicate.

  • responseCodestring

    The status as UNCL4343, the code list of the Peppol Invoice Response.

  • queryReasonstring

    Why the invoice is under query: it doesn't match its purchase order, or its bank details wait to be confirmed or were reported.

  • rejectionobject

    When rejected: the reason code (amount_incorrect, not_ordered_or_not_received, duplicate, missing_or_wrong_po, wrong_billing_entity, other) and the buyer's note.

Errors

  • 404 Not Found - No invoice with this id is yours.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/invoices/{invoiceId}/status
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/{invoiceId}/status" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "invoiceId": "string",
   "invoiceNumber": "string",
   "documentType": "invoice" | "debit_note",
   "buyerWorkspaceId": "string",
   "purchaseOrderId": "string",
   "status": "received" | "in_process" | "under_query" | "approved" | "payment_in_progress" | "paid" | "rejected" | "duplicate",
   "responseCode": "AB" | "IP" | "UQ" | "AP" | "RE" | "PD",
   "cxmlStatus": "processing" | "reconciled" | "rejected" | "paying" | "paid",
   "queryReason": "discrepancy" | "bank_details_unconfirmed" | "bank_details_disputed",
   "rejection": { "reasonCode": "string", "reason": "string", "at": "string" },
   "issueDate": "string",
   "receivedAt": "string",
   "dueDate": "string",
   "total": { "amount": number, "currency": "string" },
   "amountDue": { "amount": number, "currency": "string" },
   "paid": boolean,
   "paidAt": "string"
}

Get invoice status document

Returns an invoice's status as cXML or UBL.

GET/v1/workspaces/{regionId}/invoices/{invoiceId}/status/document

Parameters

  • invoiceIdstringRequired

    The invoice identifier.

  • format"cxml" | "ubl"

    The document format. Defaults to cxml.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

GetInvoiceStatus as a document. format=cxml (the default) is a cXML StatusUpdateRequest with an InvoiceStatus; format=ubl is a UBL 2.1 ApplicationResponse with the Peppol Invoice Response codes and, for a rejection, its reason.

Errors

  • 400 Bad Request - format isn't cxml or ubl.
  • 404 Not Found - No invoice with this id is yours.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/invoices/{invoiceId}/status/document
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/{invoiceId}/status/document" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
application/xml

Get invoice remittance

Returns how and when an invoice was paid, with its remittances.

GET/v1/workspaces/{regionId}/invoices/{invoiceId}/remittance

Parameters

  • invoiceIdstringRequired

    The invoice identifier.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

The payment signal for an invoice, for the supplier's cash application: how and when the buyer paid, the reference, what was withheld and what reached the supplier, and the remittances the buyer sent (notes and proofs of payment; GetRemittanceFile downloads one). Pleaxy records what the buyer states and moves no money. Never who at the buyer recorded it. The same as cXML or UBL is GetInvoiceRemittanceDocument.

Response fields

  • statusstring

    unpaid, recorded (the buyer recorded a payment made outside Pleaxy), processing or paid_through_pleaxy (a payment through Pleaxy), withdrawn (the buyer withdrew its record), or failed (Buyer callers only: its latest payment through Pleaxy failed, at failedAt).

  • payment.methodstring

    How it was paid. credit: settled by credit notes; nothing_due: approved for 0.

  • payment.adviceVersionnumber

    1 for the first record; a higher number replaces the earlier remittance advice.

  • payment.netPaidobject

    What reached the supplier, in the amount due's currency: the amount due less anything withheld.

Errors

  • 404 Not Found - No invoice with this id is yours.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/invoices/{invoiceId}/remittance
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/{invoiceId}/remittance" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
{
   "invoiceId": "string",
   "invoiceNumber": "string",
   "status": "unpaid" | "recorded" | "processing" | "paid_through_pleaxy" | "withdrawn" | "failed",
   "failedAt": "string",
   "paid": boolean,
   "paidAt": "string",
   "amountDue": { "amount": number, "currency": "string" },
   "payment": {
      "method": "ach" | "wire" | "check" | "card" | "other" | "credit" | "nothing_due" | "stripe",
      "paymentDate": "string",
      "reference": "string",
      "adviceVersion": number,
      "withheld": [ { "description": "string", "amount": number, "rate": number } ],
      "netPaid": { "amount": number, "currency": "string" },
      "paidInOtherCurrency": { "amount": number, "currency": "string", "rate": number, "rateDate": "string" }
   },
   "remittances": [ { "id": "string", "sentAt": "string", "note": "string", "file": { "fileName": "string", "contentType": "string", "sizeBytes": number } } ]
}

Get invoice remittance document

Returns an invoice's payment as cXML or UBL.

GET/v1/workspaces/{regionId}/invoices/{invoiceId}/remittance/document

Parameters

  • invoiceIdstringRequired

    The invoice identifier.

  • format"cxml" | "ubl"

    The document format. Defaults to cxml.

  • buyerstring

    Supplier callers: the buyer's Workspace ID, when two buyers issued the same id.

Returns

200 OK with the object shown in the response.

More details

GetInvoiceRemittance as a document. format=cxml (the default) is a cXML PaymentRemittanceRequest; format=ubl is a UBL 2.1 RemittanceAdvice.

Errors

  • 400 Bad Request - format isn't cxml or ubl.
  • 404 Not Found - No invoice with this id is yours.
  • 409 Conflict - Code NO_PAYMENT: nothing has been paid or recorded yet. GetInvoiceRemittance gives the status.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
  • 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (regionId), or lacks the required role.
GET /v1/workspaces/{regionId}/invoices/{invoiceId}/remittance/document
Request
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/{invoiceId}/remittance/document" \
  -H "X-Api-Key: $PLEAXY_API_KEY"
Response · 200 OK
application/xml

Record payments

Records payments your ERP or bank already made, up to 50 at a time.

POST/v1/workspaces/{regionId}/invoices/payment-records

Body

  • paymentsArrayRequired

    1-50 payments: { invoiceId, method, paymentDate, reference, note?, amount?, currency?, rate?, rateDate?, withholdings?, confirmReplaced? }, each field as in RecordPayment.

Returns

200 OK with the object shown in the response.

More details

Records payments your ERP or bank feed already made outside Pleaxy - wires, checks, ACH, card - so each supplier gets its payment notice, remittance advice and sync event without anyone retyping it. This moves no money. Each payment follows RecordPayment's rules and is answered on its own; repeating one is safe (already_recorded). An invoice approved by an API key is still refused. note becomes a remittance note for the supplier; a proof of payment can only be attached by a person.

Buyer API key with the payments:record scope only, minted with a procurementRole that can edit invoices (administrator or finance). A signed-in person uses RecordPayment.

Response fields

  • results[].outcomestring

    recorded, already_recorded (the same payment was recorded before), or refused with the status, code and message RecordPayment would have given.

Errors

  • 400 Bad Request - The body isn't valid: no payments, more than 50, or a field RecordPayment doesn't take. Nothing is recorded.
  • 403 Forbidden - Code API_KEY_REQUIRED (a signed-in person), API_KEY_SCOPE_MISSING (a key without payments:record), or a procurement role that can't edit invoices.
  • 429 Too Many Requests - Per payment, code RATE_LIMITED once the key has recorded 500 payments today (UTC). Every call that records a payment also raises a payments_recorded_by_key notification in the workspace, naming the key and the invoices.
  • 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
POST /v1/workspaces/{regionId}/invoices/payment-records
Request
curl -X POST "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/invoices/payment-records" \
  -H "X-Api-Key: $PLEAXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
   "payments": [
      { "invoiceId": "string", "method": "ach" | "wire" | "check" | "card" | "other", "paymentDate": "YYYY-MM-DD", "reference": "string", "note": "string" }
   ]
}
Response · 200 OK
{
   "results": [
      { "invoiceId": "string", "outcome": "recorded" | "already_recorded" | "refused", "status": number, "code": "string", "message": "string" }
   ],
   "recorded": number,
   "alreadyRecorded": number,
   "refused": number
}
Talk to us