applyRestockingFee
Requires at least one of the permissions purchase:debit_note:update or sales:credit_note:update.
Sets the restocking fee on a return and saves the reason in the return's notes. The fee replaces any earlier one. 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 ApplyRestockingFee($feeAmount: Float!, $reason: String!, $returnId: String!) {
applyRestockingFee(feeAmount: $feeAmount, reason: $reason, 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 ApplyRestockingFee($feeAmount: Float!, $reason: String!, $returnId: String!) {\n applyRestockingFee(feeAmount: $feeAmount, reason: $reason, returnId: $returnId) {\n id\n returnNumber\n rmaNumber\n status\n }\n}",
"variables": {
"feeAmount": 0,
"reason": "string",
"returnId": "string"
}
}
EOF
Variables:
{
"feeAmount": 0,
"reason": "string",
"returnId": "string"
}
Response:
{
"data": {
"applyRestockingFee": {
"id": "string",
"returnNumber": "string",
"rmaNumber": "string",
"status": "string"
}
}
}
applyRestockingFee(
feeAmount: Float!
reason: String!
returnId: String!
): ReturnResponse!
Arguments
applyRestockingFee.feeAmount ● Float! non-null scalar
The restocking fee to charge.
applyRestockingFee.reason ● String! non-null scalar
Why the fee is applied. It is saved in the return's notes.
applyRestockingFee.returnId ● String! non-null scalar
The ID of the return.
Type
ReturnResponse object
A return created through the RMA flow.