Skip to content

returnCreate

Mutationin Return

Request a return for delivered lines, for the session's active business unit or, without one, the customer; every order must belong to it. Every line needs a reason from Query.returnReasons. A missing serial number, missing photos, a wrong pickup address or a missing refund method is a ValidationError on its field. A unit's return needs REQUEST_RETURNS. A consumer's return needs a refundMethod from Order.returnRefundMethods, unless every line is exchanged for one costing the same; a unit's return takes none. A line with exchangeFor is replaced rather than refunded. Issues no money.

Arguments

ArgumentTypeDescription
items[ReturnItemInput!]!
reasonReturnReasonInput
noteString
shippingReturnShippingInput!
refundMethodReturnRefundMethodType

Returns

ReturnCreateResponse!

FieldTypeDescription
returnReturn
returnErrors[ReturnCreateError!]

Example

mutation {
returnCreate(
items: [{ orderId: "order-1", lineItemId: "line-1", quantity: 1, reason: { code: "too-small" } }]
shipping: { method: DROP_OFF }
refundMethod: ORIGINAL_PAYMENT
) {
return {
id
status
shipping {
dropOff {
code
}
}
}
returnErrors {
... on ReturnError {
code
}
}
}
}

The query is the example the schema documents. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved

Used by

The storefront packages that send it, in these GraphQL documents: