Export purchase orders by issue date
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/purchase-orders/v1-purchase-order-export.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
POST/
Exports the team's purchase orders whose issue date falls between start_date and end_date.
- By default the answer is a CSV file (
purchase_order_export_<time>.csv) with these columns:purchase_order_id,issue_date,due_date,vendor,billing_address_label,warehouse_label,creator,status,received_subtotal,received_tax,received_total,ordered_subtotal,ordered_tax,ordered_total,related_orders,related_customers,internal_note,vendor_note. - With
list_only: truethe same purchase orders come back as JSON rows instead.
For the CSV, no purchase order in the range is a 422; with list_only: true it is an empty data list. The Download Center export (data_export/export_purchase_order_list) builds the same kind of file in the background.
Business rules
- Covers every purchase order of the team in the range, whoever it is assigned to.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, required.
ISO 8601 date and time. Issue dates on or before it, compared the same way.
ISO 8601 date and time. Issue dates on or after it. The offset is not applied: the date and time are compared as written with issue dates kept in UTC, so send UTC times.
list_onlybooleanTrue for JSON rows instead of a CSV file.
- Default
false
- Default
Response
200A CSV file by default; JSON rows with list_only: true.
Fields of each item (19)
The purchase order number people see, not its id.
The vendor's name.
billing_address_labelstring | nullcreatorstringWho created it, or an empty string.
due_datestringYYYY-MM-DDin the team's time zone, or an empty string.internal_notestring | nullissue_datestringYYYY-MM-DDin the team's time zone, or an empty string.namestring | nullordered_subtotalstringA decimal string with two decimals, such as
"120.00"; parse it as a decimal.ordered_taxstringreceived_subtotalstringA decimal string with two decimals, such as
"125.00"; parse it as a decimal.received_taxstringreceived_totalstringvendor_notestring | nullwarehouse_labelstring | null
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.- When
- Your role cannot view reports. This 403 has a short body,
{"message": "Insufficient Permission"}, with nosuccessorerror. - Fix
- Ask a team owner for View Reports.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
- CSV only: no purchase order has an issue date in the range (
error.codepurchase_order_export_error, "Purchase Order not found"). Withlist_only: truethe answer is an empty list instead. - Fix
- Widen the range.
- When
- A date is missing or not ISO 8601.
error.codeisvalidation_failed. - Fix
- Send both dates.
Related
- POSTExport purchase orders in a date range to CSV
/v1/ api/ store/ {team_slug}/ data_export/ export_purchase_order_list - GETList a purchase order's history
/v1/ api/ store/ {team_slug}/ purchase_order/ {hash_id}/ history
