processReturnRefund
Requires at least one of the permissions purchase:debit_note:update or sales:credit_note:update.
Records the refund amount and method on a return and moves it to PROCESSING. It records the decision; it does not move money by itself. Needs the update permission of the return's direction.
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
mutation ProcessReturnRefund($input: ProcessRefundInput!, $returnId: String!) {
processReturnRefund(input: $input, returnId: $returnId) {
id
returnNumber
rmaNumber
status
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ProcessReturnRefund($input: ProcessRefundInput!, $returnId: String!) {\n processReturnRefund(input: $input, returnId: $returnId) {\n id\n returnNumber\n rmaNumber\n status\n }\n}",
"variables": {
"input": {
"amount": 0,
"method": "BANK_TRANSFER"
},
"returnId": "string"
}
}
EOF
Variables:
{
"input": {
"amount": 0,
"method": "BANK_TRANSFER"
},
"returnId": "string"
}
Response:
{
"data": {
"processReturnRefund": {
"id": "string",
"returnNumber": "string",
"rmaNumber": "string",
"status": "string"
}
}
}
processReturnRefund(
input: ProcessRefundInput!
returnId: String!
): ReturnResponse!
Arguments
processReturnRefund.input ● ProcessRefundInput! non-null input
The details of the process refund request.
processReturnRefund.returnId ● String! non-null scalar
The ID of the return.
Type
ReturnResponse object
A return created through the RMA flow.