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.
| Field | Type | Required | Description |
|---|---|---|---|
allocations | Array | Yes | How the payment is split across invoices. See Allocation Object. |
paymentMethod | String | Yes | ach, wire, check, cash or other. |
referenceNumber | String | No | Payment reference. Required for ach, wire and check. Each reference can be used once. |
notes | String | No | Notes about the payment. |
Allocation Object
| Field | Type | Required | Description |
|---|---|---|---|
invoiceId | String | Yes | ID of the invoice. Each invoice can appear once. |
amount | Number | Yes | Amount 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
| Field | Type | Description |
|---|---|---|
id | String | Payment ID. |
entityId | String | Payment number. |
amount | Number | Total amount of the payment. |
currency | Object | Currency of the payment. |
status | String | Payment status, captured. |
methodName | String | Payment method, for example wire. |
methodLabel | String | Payment method name, for example Wire Transfer. |
gatewayRef | String | Your reference number. |
notes | String | Payment notes. |
allocations | Array | Amount applied to each invoice (invoice, amount). |
createdBy | Object | Who recorded the payment. |
createdAt | String | Date and time the payment was recorded (ISO 8601). |
Invoices Data
data.invoices lists the updated invoices. See Get Invoice for all fields.
Notes
- Only
openandpartially_paidinvoices can be paid. - All invoices in one payment must belong to the same customer or company and use the same currency.
- An invoice becomes
paidwhen its paid amount reaches the total, orpartially_paidotherwise.