Purchase Invoice
The purchase invoice resource.
Use the view for reads
The purchaseInvoice table has stored total and status columns that may be stale. For accurate computed values (totals, tax, balance, status), read from the purchaseInvoices view instead. Use this table for create, update, and delete operations.
/purchaseInvoiceList purchase invoices
Retrieve a paginated list of purchase 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/purchaseInvoice?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'[
{
"id": "abc123def456",
"invoiceId": "xyz789",
"currencyCode": "string",
"exchangeRate": 0,
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0,
"totalTax": 0
}
]/purchaseInvoiceRetrieve a purchase invoice
Fetch a single purchase invoice by filtering on `id`.
Query parameters
idstringMatch on the purchase invoice's `id`, e.g. `eq.{id}`.
curl --request GET \
--url 'https://rest.carbon.ms/purchaseInvoice?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'{
"id": "abc123def456",
"invoiceId": "xyz789",
"currencyCode": "string",
"exchangeRate": 0,
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0,
"totalTax": 0
}/purchaseInvoiceCreate a purchase invoice
Create a new purchase invoice.
Body parameters
invoiceIdstringrequiredsupplierIdstringsupplierReferencestringinvoiceSupplierIdstringinvoiceSupplierLocationIdstringReferences supplierLocation.id
invoiceSupplierContactIdstringReferences supplierContact.id
paymentTermIdstringReferences paymentTerm.id
currencyCodestringrequiredReferences currencyCode.code
exchangeRatenumberrequiredpostingDatedatedateIssueddatedateDuedatedatePaiddatesubtotalnumberrequiredtotalDiscountnumberrequiredtotalAmountnumberrequiredtotalTaxnumberrequiredassigneestringReferences user.id
companyIdstringrequiredReferences company.id
customFieldsobjecttagsarraysupplierInteractionIdstringrequiredReferences supplierInteraction.id
internalNotesobjectexchangeRateUpdatedAttimestamplocationIdstringReferences location.id
statuspurchaseInvoiceStatusrequiredcurl --request POST \
--url https://rest.carbon.ms/purchaseInvoice \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"invoiceId":"xyz789","currencyCode":"string","exchangeRate":0,"subtotal":0,"totalDiscount":10,"totalAmount":0,"totalTax":0,"companyId":"xyz789","supplierInteractionId":"xyz789","status":"string"}'{
"id": "abc123def456",
"invoiceId": "xyz789",
"currencyCode": "string",
"exchangeRate": 0,
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0,
"totalTax": 0
}/purchaseInvoiceUpdate a purchase invoice
Update an existing purchase invoice, matched on `id`.
Body parameters
invoiceIdstringrequiredsupplierIdstringsupplierReferencestringinvoiceSupplierIdstringinvoiceSupplierLocationIdstringReferences supplierLocation.id
invoiceSupplierContactIdstringReferences supplierContact.id
paymentTermIdstringReferences paymentTerm.id
currencyCodestringrequiredReferences currencyCode.code
exchangeRatenumberrequiredpostingDatedatedateIssueddatedateDuedatedatePaiddatesubtotalnumberrequiredtotalDiscountnumberrequiredtotalAmountnumberrequiredtotalTaxnumberrequiredassigneestringReferences user.id
companyIdstringrequiredReferences company.id
customFieldsobjecttagsarraysupplierInteractionIdstringrequiredReferences supplierInteraction.id
internalNotesobjectexchangeRateUpdatedAttimestamplocationIdstringReferences location.id
statuspurchaseInvoiceStatusrequiredcurl --request PATCH \
--url 'https://rest.carbon.ms/purchaseInvoice?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",
"currencyCode": "string",
"exchangeRate": 0,
"subtotal": 0,
"totalDiscount": 10,
"totalAmount": 0,
"totalTax": 0
}/purchaseInvoiceDelete a purchase invoice
Delete a purchase invoice, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the purchase invoice to delete, e.g. `eq.{id}`.
curl --request DELETE \
--url 'https://rest.carbon.ms/purchaseInvoice?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'