salesOrder
Requires at least one of the permissions payments:collection:create, sales:credit_note:create, sales:sales_order:deliver, sales:sales_order:read or sales:sales_order:ship.
Fetch one sales order by id with its lines. Linked purchase orders are included only for callers who may read purchase orders. Returns an error if the order is missing or outside the caller's customer scope. Needs the sales order read permission, or a permission to act on the order (ship, deliver, raise a credit note or record a collection against it).
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query SalesOrder($id: ID!) {
salesOrder(id: $id) {
id
customerPoNumber
orderNumber
sourceQuoteNumber
trackingNumber
creatorName
billingAddress {
postalCode
city
country
state
street1
street2
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query SalesOrder($id: ID!) {\n salesOrder(id: $id) {\n id\n customerPoNumber\n orderNumber\n sourceQuoteNumber\n trackingNumber\n creatorName\n billingAddress {\n postalCode\n city\n country\n state\n street1\n street2\n }\n }\n}",
"variables": {
"id": "id"
}
}
EOF
Variables:
{
"id": "id"
}
Response:
{
"data": {
"salesOrder": {
"id": "id",
"customerPoNumber": "string",
"orderNumber": "string",
"sourceQuoteNumber": "string",
"trackingNumber": "string",
"creatorName": "string",
"billingAddress": {
"postalCode": "string",
"city": "string",
"country": "string",
"state": "string",
"street1": "string",
"street2": "string"
}
}
}
}
salesOrder(
id: ID!
): SalesOrder!
Arguments
salesOrder.id ● ID! non-null scalar
The ID of the sales order.
Type
SalesOrder object
A confirmed demand from a customer to ship goods, usually converted from a quote. Moves through confirmation, shipment, invoicing and payment.