List purchase orders
https://api.light.inc/v1/purchase-orders
Returns a paginated list of purchase orders
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Query parameters
-
sortstringSort string in the format
field:direction. To provide multiple sort fields, separate them with commas.Available directions:
asc,desc.Available fields:
purchaseOrderId,erpNumber,vendorName,ownerName,ownerId,companyEntityId,state,closedAt,cancelledAt,createdAt,totalAmount. -
filterstringFilter string in the format
field:operator:value. To provide multiple filters, separate them with commas.Available operators:
eq,ne,in,not_in,gt,gte,lt,lte.- For
inandnot_inoperators, provide multiple values separated by the pipe character (|).
Available fields:
purchaseOrderId,vendorId,ownerId,state,erpNumber,updatedAt. - For
-
limitinteger · int32Maximum number of items to return. Default is 50, maximum is 200.
-
offsetinteger · int64deprecatedNumber of items to skip before starting to collect the result set. Deprecated, use 'cursor' instead.
-
cursorstringThe cursor position to start returning results from. To opt-in into cursor-based pagination, provide
0for the initial request. For subsequent requests, usenextCursorandprevCursorfrom the previous response to navigate. Cursor values are opaque and should not be constructed manually.
Response
-
recordsarray of objectList of records for the current page
-
idstring · uuidNote
The purchase order id.
-
companyIdstring · uuidNote
Your company id.
-
createdBystring · uuidNote
The principal that created the order.
-
companyEntityIdstring · uuidNote
The entity the order belongs to.
-
purchaseRequestIdstring · uuidNote
The purchase request the order was raised from, if any.
-
statestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
IN_DRAFTRESET_PENDINGAPPROVED_ACCOUNTING_ENTRY_PENDINGOPENCLOSE_PENDINGCLOSEDCANCEL_PENDINGCANCELLED -
erpNumberstringNote
The purchase order number shown to the vendor and printed on the order; assigned when the order is opened.
-
descriptionstringNote
The order description.
-
currencystringNote
The order currency.
-
totalAmountinteger · int64Note
Gross total of the lines, minor units.
-
totalNetAmountinteger · int64Note
Total excluding tax, minor units.
-
totalTaxAmountinteger · int64Note
Total tax, minor units.
-
totalMatchedAmountinteger · int64Note
Amount of bills matched to this order so far, minor units.
-
ownerIdstring · uuidNote
The person responsible for the order.
-
ownerNamestringNote
Their name.
-
vendorIdstring · uuidNote
The vendor the order is placed with.
-
vendorEmailstringNote
The vendor's email address.
-
vendorNamestringNote
The vendor's name.
-
vendorAvatarUrlstringNote
Logo URL.
-
documentKeystringNote
Storage key of the order PDF. Download it through the order's document endpoint, not with this key.
-
failureContextobjectFailure context when vendor onboarding fails.
Note
The error of the last failed step, if any.
-
namestringThe error name
-
typestringThe error type
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
BAD_REQUESTUNAUTHORIZEDFORBIDDENNOT_FOUNDCONFLICTUNPROCESSABLE_CONTENT -
errorsarray of objectList of errors providing details about what went wrong
-
typestringA string code identifying the error type
-
messagestringA human-readable message providing more details about the error
-
patharray of stringOptional path of the error when the error is for a specific field. Used mostly on BAD_REQUEST errors, that path will match the field name on the request object
-
contextobjectOptional context providing additional information about the error. This can include any relevant data that might help in understanding or resolving the error
-
-
-
purchaseOrderDatestring · dateNote
The order date.
-
deliveryAddressstringNote
Where the goods or services are to be delivered.
-
deliveryDatestring · dateNote
Expected delivery date.
-
erpSyncedAtstring · date-time -
lockedAtstring · date-timeNote
When the order was locked against edits with the lock action;
nullwhile editable. -
closedAtstring · date-timeNote
When the order was closed;
nullwhile open. -
cancelledAtstring · date-timeNote
When the order was cancelled;
nullotherwise. -
createdAtstring · date-timeNote
When the order was created.
-
updatedAtstring · date-timeNote
When it was last changed.
-
linesarray of objectNote
The order lines.
-
idstring · uuidNote
The line id.
-
companyIdstring · uuidNote
Your company id.
-
purchaseOrderIdstring · uuidNote
The order the line belongs to.
-
descriptionstringNote
The line description.
-
quantityinteger · int64Note
Quantity ordered.
-
unitPriceinteger · int64Note
Price per unit, minor units.
-
accountIdstring · uuidNote
The expense account for the line.
-
accountLabelstringNote
Its name.
-
taxCodeIdstring · uuidNote
The tax code on the line.
-
amountinteger · int64Note
Gross line amount, minor units.
-
taxAmountinteger · int64Note
Tax on the line, minor units.
-
netAmountinteger · int64Note
Line amount excluding tax, minor units.
-
taxCodeLabelstringNote
The tax code's name.
-
costCenterIdstring · uuidNote
Cost center on the line.
-
costCenterNamestringNote
Its name.
-
createdAtstring · date-timeNote
When the line was created.
-
updatedAtstring · date-timeNote
When it was last changed.
-
-
-
hasMorebooleanBoolean flag indicating if there are more records available
-
totalinteger · int64deprecatedTotal number of records (only for offset pagination). This field is not guaranteed to be returned and only available for offset pagination, please do not rely on it and migrate to cursor pagination.
-
nextCursorstringCursor for fetching the next page (only for cursor pagination)
-
prevCursorstringCursor for fetching the previous page (only for cursor pagination)