The following endpoint can be used to add or update a credit (a credit memo or credit note) within the CoCard Pay Center application. A credit is money owed to a customer. Once issued, the customer can apply it to their open invoices at checkout in the customer portal. Every amount is stored as a positive number.
The following endpoint can be used to add or update a credit. You must replace the {base_url} and {site_id} variables with the appropriate values. Credits are available on API version 4.0 only, and must be enabled for the site; a site without credits answers credits_not_enabled .
{
"externalId": "CM-88123",
"creditNumber": "CM-88123",
"creditDate": "2026-10-01",
"poNumber": "PO-552",
"description": "Return RMA 7781",
"customer": {
"externalId": "100234"
},
"lines": [
{
"name": "Returned: Cabinet Knob K-12",
"qty": 10,
"unitPrice": 1250,
"subtotal": 12500,
"total": 12500
},
{
"name": "Returned: Drawer Pull P-40",
"qty": 2,
"unitPrice": 1250,
"subtotal": 2500,
"total": 2500
}
]
}
{
"externalId": "CM-88124",
"creditNumber": "CM-88124",
"customer": {
"externalId": "100234"
},
"autoReverseAmount": true,
"amount": -4500,
"subtotal": -4500,
"lines": [
{
"name": "Returned: Hinge H-3",
"qty": -3,
"unitPrice": 1500,
"subtotal": -4500,
"total": -4500
}
]
}
{
"success": true,
"action": "added",
"_id": "60f720d248f143332af022e0",
"updatedAt": "2025-05-30T19:19:44.143Z"
}
{
"success": false,
"errors": [
"invalid field2",
"missing field_name"
]
}
If your system stores credits as negative invoices, you can keep sending them to site/{site_id}/invoice/addUpdate (single or batch) and add isCredit: true . The record is stored as a credit instead of an invoice, and the response's recordType is credit . On a site with credits enabled, a negative invoice without isCredit is refused with negative_invoice_requires_is_credit .
{
"isCredit": true,
"autoReverseAmount": true,
"externalId": "CM-88123",
"invoiceNumber": "CM-88123",
"invoiceDate": "2026-10-01",
"poNumber": "PO-552",
"customer": {
"externalId": "100234"
},
"description": "Return RMA 7781",
"totals": {
"subtotal": -15000,
"taxes": 0,
"discounts": 0,
"total": -15000
}
}
{
"success": true,
"action": "added",
"_id": "6717a2c4e1f0a93b2c5d8e11",
"updatedAt": "2026-10-01T14:02:37.000Z",
"recordType": "credit",
"code": "P5XU4MK7QZ2X",
"warnings": [
"line_synthesized"
]
}
Each application of a credit to an invoice is recorded as a payment with type: 'credit' and credit set to the credit's _id , so it reduces the invoice balance like any payment. Read it with the Payments endpoints and the payment webhook; a voided application reports status: 'voided' . These payments are read-only through the API.
A refused credit answers HTTP 422 with one of the following codes. A 422 is permanent: correct the payload rather than retrying it.