List purchase orders
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/purchase-orders?limit=20&offset=0&sort_by=po_number&sort_order=asc';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://apibase.ecomweb.app/api/v1/stores/example/purchase-orders?limit=20&offset=0&sort_by=po_number&sort_order=asc' \ --header 'x-api-key: <x-api-key>'Returns the store’s purchase orders, newest first by default, one page at a time. Rows carry totals and line counts but no lines or receipts; fetch one order for those. Use search to match the order code, reference number or supplier name, sort_by and sort_order to order the page, and filters to narrow by status, supplier, location or date.
Required scopes: read:purchase_orders
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Maximum number of purchase orders to return, from 1 to 100.
Number of purchase orders to skip.
Matches PO code, reference number or supplier name
JSON array of {field, operator, values}, e.g. [{“field”:“status”,“operator”:“is”,“values”:[“ordered”]}]
Responses
Section titled “Responses”object
object
Status: draft, ordered, partially_received, received, closed or cancelled.
The supplier, or null while none is chosen.
object
Supplier ID.
Supplier name.
Supplier email address, or null.
True when the supplier has been archived.
The inventory location the order delivers to, or null while none is chosen.
object
Location ID.
Location name.
Payment terms agreed with the supplier.
Number of lines on the order.
Units received and accepted into stock so far.
Purchase order ID.
Sequence number of the purchase order within the store, starting at 1.
Purchase order code, such as PO1042.
Your own reference number, or null.
Note shown to the supplier, or null.
When payment is due, as an ISO 8601 timestamp. Null for terms without a due date and for an order not yet placed.
Currency code of every amount on the order.
When the delivery is expected, as an ISO 8601 timestamp, or null.
Carrier delivering the order, or null.
Carrier tracking number, or null.
Tags on the order.
Sum of the line costs before tax.
Sum of the line taxes.
Shipping cost charged by the supplier.
Other costs, such as customs or handling.
Grand total: subtotal, tax, shipping and other costs.
Total units ordered across all lines.
When the order was placed, as an ISO 8601 timestamp, or null for a draft.
When the order reached a final status (received, closed or cancelled), as an ISO 8601 timestamp, or null.
When the order was last emailed to the supplier, as an ISO 8601 timestamp, or null if it never was.
When the order was created, as an ISO 8601 timestamp.
When the order was last updated, as an ISO 8601 timestamp.
object
Total number of items matching the request.
Maximum number of items in this page.
Number of items skipped before this page.
Current page number, starting at 1.
Total number of pages.
Whether a next page exists.
Whether a previous page exists.
Example
{ "data": [ { "status": "draft", "payment_terms": "none" } ]}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}