Skip to main content

createPartialReturn

Requires at least one of the permissions purchase:debit_note:create or sales:credit_note:create.

Creates a follow-on return for part of an existing return, naming the parent return and the lines and quantities to return. The parent return must exist. Needs the create permission of the parent return's direction (credit notes for a customer return, debit notes for a supplier return).

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:

mutation CreatePartialReturn($items: [PartialReturnItemInput!]!, $parentReturnId: String!) {
createPartialReturn(items: $items, parentReturnId: $parentReturnId) {
id
returnNumber
rmaNumber
status
}
}

Variables:

{
"items": [
{
"productId": "string",
"quantity": 0,
"reason": "string",
"variantId": "string"
}
],
"parentReturnId": "string"
}

Response:

{
"data": {
"createPartialReturn": {
"id": "string",
"returnNumber": "string",
"rmaNumber": "string",
"status": "string"
}
}
}
createPartialReturn(
items: [PartialReturnItemInput!]!
parentReturnId: String!
): ReturnResponse!

Arguments​

createPartialReturn.items ● [PartialReturnItemInput!]! non-null input​

The items and quantities to move into the new return.

createPartialReturn.parentReturnId ● String! non-null scalar​

The ID of the return to split.

Type​

ReturnResponse object​

A return created through the RMA flow.