getReturns
Requires at least one of the permissions purchase:debit_note:list or sales:credit_note:list.
Lists returns with optional filters and page-number paging (pagination page and limit, 50 per page by default). Customer returns need the credit notes list permission and supplier returns the debit notes list permission; a rep sees only their own customers' returns.
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 GetReturns {
getReturns {
total
returns {
id
returnNumber
status
type
createdAt
baseTotalAmount
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query GetReturns {\n getReturns {\n total\n returns {\n id\n returnNumber\n status\n type\n createdAt\n baseTotalAmount\n }\n }\n}"
}
EOF
Response:
{
"data": {
"getReturns": {
"total": 0,
"returns": [
{
"id": "id",
"returnNumber": "string",
"status": "APPROVED",
"type": "DEFECTIVE_RETURN",
"createdAt": "2025-01-15T00:00:00Z",
"baseTotalAmount": 0
}
]
}
}
}
getReturns(
filters: ReturnFilterInput
pagination: PaginationInput
): ReturnListResponse!
Arguments
getReturns.filters ● ReturnFilterInput input
Filter criteria for return records. Omit to match all.
getReturns.pagination ● PaginationInput input
Which page to return.
Type
ReturnListResponse object
A page of returns and the total number that match.