Skip to content

Purchase Invoice

The purchase invoice resource.

Base/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.

GET/purchaseInvoice
curl --request GET \
  --url '<your-host>/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}`.

GET/purchaseInvoice
curl --request GET \
  --url '<your-host>/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
supplierReferencestring
invoiceSupplierIdstring
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
assigneestring

References user.id

companyIdstringrequired

References company.id

customFieldsobject
tagsarray
supplierInteractionIdstringrequired

References supplierInteraction.id

internalNotesobject
exchangeRateUpdatedAttimestamp
locationIdstring

References location.id

statuspurchaseInvoiceStatusrequired
POST/purchaseInvoice
curl --request POST \
  --url <your-host>/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"}'
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
supplierReferencestring
invoiceSupplierIdstring
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
assigneestring

References user.id

companyIdstringrequired

References company.id

customFieldsobject
tagsarray
supplierInteractionIdstringrequired

References supplierInteraction.id

internalNotesobject
exchangeRateUpdatedAttimestamp
locationIdstring

References location.id

statuspurchaseInvoiceStatusrequired
PATCH/purchaseInvoice
curl --request PATCH \
  --url '<your-host>/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}`.

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