Purchase Invoice

The purchase invoice resource.

Basehttps://rest.carbon.ms/purchaseInvoice
GET/purchaseInvoice

List purchase invoices

Retrieve a paginated list of purchase invoices. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/purchaseInvoice
curl --request GET \
  --url 'https://rest.carbon.ms/purchaseInvoice?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "invoiceId": "xyz789",
    "currencyCode": "string",
    "exchangeRate": 0,
    "subtotal": 0,
    "totalDiscount": 10,
    "totalAmount": 0,
    "totalTax": 0
  }
]
GET/purchaseInvoice

Retrieve a purchase invoice

Fetch a single purchase invoice by filtering on `id`.

Query parameters

idstring

Match on the purchase invoice's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/purchaseInvoice
curl --request GET \
  --url 'https://rest.carbon.ms/purchaseInvoice?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "invoiceId": "xyz789",
  "currencyCode": "string",
  "exchangeRate": 0,
  "subtotal": 0,
  "totalDiscount": 10,
  "totalAmount": 0,
  "totalTax": 0
}
POST/purchaseInvoice

Create a purchase invoice

Create a new purchase invoice.

Body parameters

invoiceIdstringrequired
supplierIdstring

References supplier.id

supplierReferencestring
invoiceSupplierIdstring

References supplier.id

invoiceSupplierLocationIdstring

References supplierLocation.id

invoiceSupplierContactIdstring

References supplierContact.id

paymentTermIdstring

References paymentTerm.id

currencyCodestringrequired

References currencyCode.code

exchangeRatenumberrequired
postingDatedate
dateIssueddate
dateDuedate
datePaiddate
subtotalnumberrequired
totalDiscountnumberrequired
totalAmountnumberrequired
totalTaxnumberrequired
balancenumberrequired
assigneestring

References user.id

companyIdstringrequired

References company.id

customFieldsobject
tagsarray
supplierInteractionIdstringrequired

References supplierInteraction.id

internalNotesobject
exchangeRateUpdatedAttimestamp
locationIdstring

References location.id

statuspurchaseInvoiceStatusrequired
POSThttps://rest.carbon.ms/purchaseInvoice
curl --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,"balance":0,"companyId":"xyz789","supplierInteractionId":"xyz789","status":"string"}'
Response
{
  "id": "abc123def456",
  "invoiceId": "xyz789",
  "currencyCode": "string",
  "exchangeRate": 0,
  "subtotal": 0,
  "totalDiscount": 10,
  "totalAmount": 0,
  "totalTax": 0
}
PATCH/purchaseInvoice

Update a purchase invoice

Update an existing purchase invoice, matched on `id`.

Body parameters

invoiceIdstringrequired
supplierIdstring

References supplier.id

supplierReferencestring
invoiceSupplierIdstring

References supplier.id

invoiceSupplierLocationIdstring

References supplierLocation.id

invoiceSupplierContactIdstring

References supplierContact.id

paymentTermIdstring

References paymentTerm.id

currencyCodestringrequired

References currencyCode.code

exchangeRatenumberrequired
postingDatedate
dateIssueddate
dateDuedate
datePaiddate
subtotalnumberrequired
totalDiscountnumberrequired
totalAmountnumberrequired
totalTaxnumberrequired
balancenumberrequired
assigneestring

References user.id

companyIdstringrequired

References company.id

customFieldsobject
tagsarray
supplierInteractionIdstringrequired

References supplierInteraction.id

internalNotesobject
exchangeRateUpdatedAttimestamp
locationIdstring

References location.id

statuspurchaseInvoiceStatusrequired
PATCHhttps://rest.carbon.ms/purchaseInvoice
curl --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"}'
Response
{
  "id": "abc123def456",
  "invoiceId": "xyz789",
  "currencyCode": "string",
  "exchangeRate": 0,
  "subtotal": 0,
  "totalDiscount": 10,
  "totalAmount": 0,
  "totalTax": 0
}
DELETE/purchaseInvoice

Delete a purchase invoice

Delete a purchase invoice, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the purchase invoice to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/purchaseInvoice
curl --request DELETE \
  --url 'https://rest.carbon.ms/purchaseInvoice?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content