Skip to main content

Record Payment

Records a payment received outside the store, such as ACH, wire, check or cash, and applies it to one or more invoices. Each invoice's paid amount and status are updated.

HTTP Request​

  • URL: /invoices/payments
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
  • Required scope: READ_WRITE_INVOICE

Request Body​

The request body is a JSON object with the payment and how it is split across invoices.

FieldTypeRequiredDescription
allocationsArrayYesHow the payment is split across invoices. See Allocation Object.
paymentMethodStringYesach, wire, check, cash or other.
referenceNumberStringNoPayment reference. Required for ach, wire and check. Each reference can be used once.
notesStringNoNotes about the payment.

Allocation Object​

FieldTypeRequiredDescription
invoiceIdStringYesID of the invoice. Each invoice can appear once.
amountNumberYesAmount for this invoice, with up to 2 decimals. Cannot be more than the invoice's unpaid balance.

cURL Example​

curl --location '<BASE_URL>/invoices/payments' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"allocations": [
{ "invoiceId": "665f2310d5775459152d6dd8", "amount": 352 },
{ "invoiceId": "665f2310d5775459152d6de5", "amount": 660 }
],
"paymentMethod": "wire",
"referenceNumber": "WIRE-20260723-001",
"notes": "Combined payment for July invoices."
}'

Response​

  • 200 OK: The payment was recorded.
  • 400 Bad Request: A field is missing or invalid, an amount is more than the unpaid balance, an invoice cannot be paid, or the invoices belong to different customers or currencies.
  • 401 Unauthorized: The access token is missing or invalid.
  • 403 Forbidden: The access token does not have the required scope.
  • 404 Not Found: One or more invoices were not found.
  • 409 Conflict: The reference number was already used, or the payment was recorded but an invoice could not be updated. Do not retry in the second case; check the invoices named in the message.

Sample JSON Response​

{
"success": true,
"message": "Payment PMT-1009 recorded successfully",
"data": {
"payment": {
"id": "666f2310d5775459152d6ff1",
"entityId": "PMT-1009",
"source": "invoice",
"company": "664dec6cd5775459152d4922",
"customer": "664dec6cd5775459152d4926",
"amount": 1012,
"amountReceived": 1012,
"currency": { "currency": "USD", "symbol": "$" },
"status": "captured",
"methodName": "wire",
"methodLabel": "Wire Transfer",
"type": "manual",
"gatewayRef": "WIRE-20260723-001",
"notes": "Combined payment for July invoices.",
"createdBy": { "id": "6489b2479467bbcf8c3d33aa", "name": "ERP Connector", "type": "api" },
"allocations": [
{ "invoice": "665f2310d5775459152d6dd8", "amount": 352 },
{ "invoice": "665f2310d5775459152d6de5", "amount": 660 }
],
"createdAt": "2026-07-23T10:20:00.000Z",
"updatedAt": "2026-07-23T10:20:00.000Z"
},
"invoices": [
{
"id": "665f2310d5775459152d6dd8",
"entityId": "INV-1001",
"total": 552,
"paidAmount": 552,
"status": "paid"
},
{
"id": "665f2310d5775459152d6de5",
"entityId": "INV-1004",
"total": 900,
"paidAmount": 660,
"status": "partially_paid"
}
]
}
}

Response Details​

Payment Data​

FieldTypeDescription
idStringPayment ID.
entityIdStringPayment number.
amountNumberTotal amount of the payment.
currencyObjectCurrency of the payment.
statusStringPayment status, captured.
methodNameStringPayment method, for example wire.
methodLabelStringPayment method name, for example Wire Transfer.
gatewayRefStringYour reference number.
notesStringPayment notes.
allocationsArrayAmount applied to each invoice (invoice, amount).
createdByObjectWho recorded the payment.
createdAtStringDate and time the payment was recorded (ISO 8601).

Invoices Data​

data.invoices lists the updated invoices. See Get Invoice for all fields.

Notes​

  • Only open and partially_paid invoices can be paid.
  • All invoices in one payment must belong to the same customer or company and use the same currency.
  • An invoice becomes paid when its paid amount reaches the total, or partially_paid otherwise.