getReturnsBySupplier
Requires permission purchase:debit_note:list.
Lists the returns to one supplier. Needs the debit notes list permission.
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 GetReturnsBySupplier($supplierId: String!) {
getReturnsBySupplier(supplierId: $supplierId) {
id
returnNumber
status
type
createdAt
baseTotalAmount
creditNotes {
id
creditNoteNumber
status
type
amount
issueDate
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query GetReturnsBySupplier($supplierId: String!) {\n getReturnsBySupplier(supplierId: $supplierId) {\n id\n returnNumber\n status\n type\n createdAt\n baseTotalAmount\n creditNotes {\n id\n creditNoteNumber\n status\n type\n amount\n issueDate\n }\n }\n}",
"variables": {
"supplierId": "string"
}
}
EOF
Variables:
{
"supplierId": "string"
}
Response:
{
"data": {
"getReturnsBySupplier": [
{
"id": "id",
"returnNumber": "string",
"status": "APPROVED",
"type": "DEFECTIVE_RETURN",
"createdAt": "2025-01-15T00:00:00Z",
"baseTotalAmount": 0,
"creditNotes": [
{
"id": "id",
"creditNoteNumber": "string",
"status": "string",
"type": "string",
"amount": 0,
"issueDate": "2025-01-15T00:00:00Z"
}
]
}
]
}
}
getReturnsBySupplier(
supplierId: String!
): [ProductReturn!]!
Arguments
getReturnsBySupplier.supplierId ● String! non-null scalar
The ID of the supplier.
Type
ProductReturn object
A return of goods, sales or purchase side, with its lines and the notes raised from it.