Get an invoice
const url = 'https://app.commitly.com/api/invoices/3102/';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.commitly.com/api/invoices/3102/ \ --header 'Authorization: Bearer <token>'Returns a single invoice by its internal ID (id). To look up an invoice by
its number, use GET /invoices/?reference= (substring match) and check
reference in the results.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Internal invoice ID (id in invoice responses), not the invoice number.
Example
3102Responses
Section titled “Responses”The invoice.
object
Internal invoice ID. Used in /invoices/{id}/ and as id selector.
Bank transactions matched to the invoice.
A bank transaction matched to the invoice.
object
Bank account of the transaction.
Decimal with at most 10 digits and 2 decimal places.
RE receivable, PA payable. Optional on create: if omitted, a positive
amount sets RE, any other amount PA.
Invoice number.
Invoice date.
Expected payment date.
Origin of the invoice, e.g. direct_api or Manually Added.
ID of the invoice in its source.
| Code | Label |
|---|---|
OD | Overdue |
PL | Expected |
OR | Lead/Order |
PD | Paid |
PP | Partially Paid |
IN | Installments |
HD | On Hold |
PR | Promised |
DP | In Dispute |
CA | Cancelled |
IP | In Progress |
Label of status, e.g. Expected.
Category ID.
Present in list responses.
Examples
Invoice
{ "id": 3102, "transactions": [], "paid_amount": 0, "amount_due": 7450, "date_created": "2022-04-16T09:53:03.919398Z", "date_updated": "2022-04-16T09:53:03.919422Z", "name": "Equipment", "notes": "Special equipment", "amount": 7450, "type": "RE", "reference": "AR-007", "date": "2022-04-16", "due_date": "2022-04-28", "source": "direct_api", "source_id": "00000000-0000-4000-8000-000000000002", "status": "PL", "status_label": "Expected", "is_archived": false, "category": 1002}The access token is invalid or has expired. Request a new token. The message is
localized (see Accept-Language).
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "Invalid token."}Headers
Section titled “Headers”Authentication scheme, Bearer.
Example
BearerNo access token was sent, or the credentials are not allowed to call this
endpoint. If the company’s COMMITLY edition does not include the requested
function, the body additionally contains
"code": "billing_plan_permission_denied".
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "User must be authenticated to access this resource."}The resource does not exist or is not accessible with these credentials.
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Examplegenerated
{ "detail": "example", "code": "example"}
