createWarrantyReturn
Requires the permissions sales:credit_note:approve and sales:credit_note:create.
Starts a warranty return against a sales invoice. The invoice and each product must exist on it, and the product's warranty must still be valid, otherwise the line is refused. The return is approved as it is created, so it needs the credit notes create and approve permissions, and the customer must be one you may see.
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 CreateWarrantyReturn($input: CreateWarrantyReturnInput!) {
createWarrantyReturn(input: $input) {
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 CreateWarrantyReturn($input: CreateWarrantyReturnInput!) {\n createWarrantyReturn(input: $input) {\n id\n returnNumber\n rmaNumber\n status\n }\n}",
"variables": {
"input": {
"customerId": "string",
"invoiceId": "string",
"items": [
{
"defects": [
"string"
],
"productId": "string",
"repairRequired": true,
"serialNumber": "string",
"variantId": "string"
}
],
"warehouseId": "string",
"warrantyClaimNo": "string"
}
}
}
EOF
Variables:
{
"input": {
"customerId": "string",
"invoiceId": "string",
"items": [
{
"defects": [
"string"
],
"productId": "string",
"repairRequired": true,
"serialNumber": "string",
"variantId": "string"
}
],
"warehouseId": "string",
"warrantyClaimNo": "string"
}
}
Response:
{
"data": {
"createWarrantyReturn": {
"id": "string",
"returnNumber": "string",
"rmaNumber": "string",
"status": "string"
}
}
}
createWarrantyReturn(
input: CreateWarrantyReturnInput!
): ReturnResponse!
Arguments
createWarrantyReturn.input ● CreateWarrantyReturnInput! non-null input
The details of the warranty return to create.
Type
ReturnResponse object
A return created through the RMA flow.