Get Credit


The following endpoint can be used to retrieve the details of a credit within the CoCard Pay Center application, including how much of it has been applied and how much can still be applied.


Punto Final

The following endpoint can be used to retrieve a credit. You must replace the {base_url} , {site_id} and {_id} variables with the appropriate values. The credit's external id can be used in place of its _id .

GET
{base_url}/api/v4/site/{site_id}/credit/{_id}

A credit sent through Add/Update Invoice is stored as a credit, not an invoice. Reading it with Get Invoice returns the error record_is_credit with the credit's _id in credit ; read it with this endpoint instead.

Solicitud
Ningún cuerpo es necesario para esta llamada de API
Respuesta
Campo
Tipo
Descripción
_id
String
The id of the credit. This field is auto generated by the system and is not required when creating a new credit. Either _id or externalId is required when updating an existing credit.
externalId
String
The unique credit id from the source system/database. Required when creating a credit without an _id. If we detect a credit with the same externalId, it will be updated, otherwise it will be added. It may not match an invoice's externalId on the same site.
code
String
The system generated code of the credit.
creditNumber
String
The credit number shown to the customer (the "Credit #"). Defaults to the code.
kind
String
The kind of credit. Only creditNote can be created through the API.
Default = creditNote | One of creditNote
status
String
The status of the credit. A credit created through the API is issued immediately and can be applied to the customer's invoices. A voided credit can no longer be applied.
One of issued, voided
site
String
El _id del sitio
customer
String
El _id del cliente
billToCustomer
String
El _id del cliente a facturar.
creditDate
Date
The date of the credit. Format = YYYY-MM-DD
poNumber
String
The purchase order number for the credit.
description
String
A short description of the credit, such as the reason or return authorization.
customerMemo
String
A note to the customer.
lines
The line items of the credit. At least one line is required, and each line's total must equal its subtotal plus its tax.
amount
Number
The face value of the credit: subtotal + taxes - discounts. Derived from the lines when left out. Este es un número entero de centavos, por lo que 1035 significa $10.35.
subtotal
Number
The sum of the line subtotals. Este es un número entero de centavos, por lo que 1035 significa $10.35.
taxes
Number
The tax on the credit. Este es un número entero de centavos, por lo que 1035 significa $10.35.
discounts
Number
Any discount on the credit, as a positive amount. Este es un número entero de centavos, por lo que 1035 significa $10.35.
applied
Number
The amount of the credit applied to invoices so far. Este es un número entero de centavos, por lo que 1035 significa $10.35.
reserved
Number
The amount held by checkouts still in progress. Este es un número entero de centavos, por lo que 1035 significa $10.35.
remaining
Number
The amount not yet applied: amount - applied. Este es un número entero de centavos, por lo que 1035 significa $10.35.
spendable
Number
The amount that can be applied right now: what remains, less any held by checkouts in progress. Zero for a voided credit. Este es un número entero de centavos, por lo que 1035 significa $10.35.
isExhausted
Boolean
Whether the credit is fully applied.
lastAppliedAt
Date
When the credit was last applied to an invoice. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
linesSynthesized
Boolean
Whether the system created the credit's single line because the credit was sent through invoice/addUpdate without lines.
isReady
Boolean
Whether the credit can be applied.
voidedAt
Date
When the credit was voided. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
deleted
Boolean
Pass true to void the credit. A credit that has been applied to an invoice cannot be voided. A voided credit cannot be updated or re-created under the same id. The flag stays false on the record; status reads voided.
createdAt
Date
When the credit was created. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
updatedAt
Date
When the credit was last updated. Format = YYYY-MM-DDTHH:mm:ss.SSSZ
Sample Response
			
{
  "_id": "6717a2c4e1f0a93b2c5d8e11",
  "externalId": "CM-88123",
  "code": "P5XU4MK7QZ2X",
  "creditNumber": "CM-88123",
  "kind": "creditNote",
  "status": "issued",
  "site": "6201825a0cf5e23261a08646",
  "customer": "649dc5bb468bd5b5d863c7d1",
  "billToCustomer": null,
  "creditDate": "2026-10-01T00:00:00.000Z",
  "poNumber": "PO-552",
  "description": "Return RMA 7781",
  "customerMemo": null,
  "amount": 15000,
  "subtotal": 15000,
  "taxes": 0,
  "discounts": 0,
  "applied": 5000,
  "reserved": 0,
  "remaining": 10000,
  "spendable": 10000,
  "isExhausted": false,
  "lastAppliedAt": "2026-10-08T15:20:11.000Z",
  "linesSynthesized": false,
  "isReady": true,
  "voidedAt": null,
  "deleted": false,
  "createdAt": "2026-10-01T14:02:37.000Z",
  "updatedAt": "2026-10-08T15:20:11.000Z",
  "lines": [
    {
      "name": "Returned: Cabinet Knob K-12",
      "qty": 10,
      "unitPrice": 1250,
      "subtotal": 12500,
      "total": 12500,
      "description": null,
      "item": null,
      "glAccount": null,
      "isTaxable": false,
      "taxRates": []
    },
    {
      "name": "Returned: Drawer Pull P-40",
      "qty": 2,
      "unitPrice": 1250,
      "subtotal": 2500,
      "total": 2500,
      "description": null,
      "item": null,
      "glAccount": null,
      "isTaxable": false,
      "taxRates": []
    }
  ]
}