API / Reference / Purchase Orders
List purchase orders
GET
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 · uuid -
companyIdstring · uuid -
createdBystring · uuid -
companyEntityIdstring · uuid -
purchaseRequestIdstring · uuid -
statestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
IN_DRAFTRESET_PENDINGAPPROVED_ACCOUNTING_ENTRY_PENDINGOPENCLOSE_PENDINGCLOSEDCANCEL_PENDINGCANCELLED -
erpNumberstring -
descriptionstring -
currencystring -
totalAmountinteger · int64 -
totalNetAmountinteger · int64 -
totalTaxAmountinteger · int64 -
totalMatchedAmountinteger · int64 -
ownerIdstring · uuid -
ownerNamestring -
vendorIdstring · uuid -
vendorEmailstring -
vendorNamestring -
vendorAvatarUrlstring -
documentKeystring -
failureContextobjectFailure context when vendor onboarding fails.
-
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 · date -
deliveryAddressstring -
deliveryDatestring · date -
erpSyncedAtstring · date-time -
lockedAtstring · date-time -
closedAtstring · date-time -
cancelledAtstring · date-time -
createdAtstring · date-time -
updatedAtstring · date-time -
linesarray of object-
idstring · uuid -
companyIdstring · uuid -
purchaseOrderIdstring · uuid -
descriptionstring -
quantityinteger · int64 -
unitPriceinteger · int64 -
accountIdstring · uuid -
accountLabelstring -
taxCodeIdstring · uuid -
amountinteger · int64 -
taxAmountinteger · int64 -
netAmountinteger · int64 -
taxCodeLabelstring -
costCenterIdstring · uuid -
costCenterNamestring -
createdAtstring · date-time -
updatedAtstring · date-time
-
-
-
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)