Sales Invoice
The sales invoice resource.
Use the view for reads
The salesInvoice table has stored total and status columns that may be stale. For accurate computed values (totals, tax, balance, status), read from the salesInvoices view instead. Use this table for create, update, and delete operations.
/salesInvoiceList sales invoices
Retrieve a paginated list of sales invoices. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
curl --request GET \
--url 'https://rest.carbon.ms/salesInvoice?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'[
{
"id": "abc123def456",
"invoiceId": "xyz789",
"status": "string",
"customerId": "xyz789",
"currencyCode": "string",
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0
}
]/salesInvoiceRetrieve a sales invoice
Fetch a single sales invoice by filtering on `id`.
Query parameters
idstringMatch on the sales invoice's `id`, e.g. `eq.{id}`.
curl --request GET \
--url 'https://rest.carbon.ms/salesInvoice?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'{
"id": "abc123def456",
"invoiceId": "xyz789",
"status": "string",
"customerId": "xyz789",
"currencyCode": "string",
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0
}/salesInvoiceCreate a sales invoice
Create a new sales invoice.
Body parameters
invoiceIdstringrequiredstatussalesInvoiceStatusrequiredcustomerIdstringrequiredcustomerReferencestringinvoiceCustomerIdstringinvoiceCustomerLocationIdstringReferences customerLocation.id
invoiceCustomerContactIdstringReferences customerContact.id
paymentTermIdstringReferences paymentTerm.id
postingDatedatedateIssueddatedateDuedatedatePaiddatelocationIdstringReferences location.id
currencyCodestringrequiredReferences currencyCode.code
subtotalnumberrequiredtotalDiscountnumberrequiredtotalAmountnumberrequiredtotalTaxnumberrequiredexchangeRatenumberrequiredexchangeRateUpdatedAttimestampopportunityIdstringReferences opportunity.id
shipmentIdstringReferences shipment.id
assigneestringcompanyIdstringrequiredReferences company.id
customFieldsobjectrequiredinternalNotesobjectrequiredexternalNotesobjectrequiredtagsarraycurl --request POST \
--url https://rest.carbon.ms/salesInvoice \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"invoiceId":"xyz789","status":"string","customerId":"xyz789","currencyCode":"string","subtotal":0,"totalDiscount":10,"totalAmount":0,"totalTax":0,"exchangeRate":0,"companyId":"xyz789","customFields":"string","internalNotes":"string","externalNotes":"string"}'{
"id": "abc123def456",
"invoiceId": "xyz789",
"status": "string",
"customerId": "xyz789",
"currencyCode": "string",
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0
}/salesInvoiceUpdate a sales invoice
Update an existing sales invoice, matched on `id`.
Body parameters
invoiceIdstringrequiredstatussalesInvoiceStatusrequiredcustomerIdstringrequiredcustomerReferencestringinvoiceCustomerIdstringinvoiceCustomerLocationIdstringReferences customerLocation.id
invoiceCustomerContactIdstringReferences customerContact.id
paymentTermIdstringReferences paymentTerm.id
postingDatedatedateIssueddatedateDuedatedatePaiddatelocationIdstringReferences location.id
currencyCodestringrequiredReferences currencyCode.code
subtotalnumberrequiredtotalDiscountnumberrequiredtotalAmountnumberrequiredtotalTaxnumberrequiredexchangeRatenumberrequiredexchangeRateUpdatedAttimestampopportunityIdstringReferences opportunity.id
shipmentIdstringReferences shipment.id
assigneestringcompanyIdstringrequiredReferences company.id
customFieldsobjectrequiredinternalNotesobjectrequiredexternalNotesobjectrequiredtagsarraycurl --request PATCH \
--url 'https://rest.carbon.ms/salesInvoice?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"invoiceId":"xyz789"}'{
"id": "abc123def456",
"invoiceId": "xyz789",
"status": "string",
"customerId": "xyz789",
"currencyCode": "string",
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0
}/salesInvoiceDelete a sales invoice
Delete a sales invoice, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the sales invoice to delete, e.g. `eq.{id}`.
curl --request DELETE \
--url 'https://rest.carbon.ms/salesInvoice?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'