Skip to content

Return types

The types the return domain defines, with the fields other domains add to them.

Objects

Invoice

An amount a company owes, issued as a document and settled separately from the orders it bills. One invoice may cover several orders, and an order paid on account is billed by one later.

FieldTypeDescription
idID!Unique identifier of the invoice
invoiceNumberString!Invoice number as the issuing system assigned it
invoiceDateDate!Calendar date the invoice was issued
dueDateDateCalendar date payment is due. Null where the issuer set no term.
statusInvoiceStatusType!Where the invoice stands, derived from what has been collected
totalMoney!What the invoice bills in total
amountPaidMoney!What has been collected against it
amountDueMoney!What is still to be collected
referenceStringThe issuer's own reference, usually the buyer's, shown on the document
invoiceUrlURLLink to the invoice document, where the issuer publishes one
orderNumbers[String!]!Numbers of the orders this invoice bills
payableBoolean!Whether a payment may be started against this invoice right now. False once nothing is outstanding, and false while a payment is already underway. A client cannot derive the second: an invoice with a pending charge still shows a balance, and offering to pay it again is how the same amount gets collected twice.
availablePaymentMethods[PaymentMethod!]!How this invoice may be paid. Not the same list a cart gets: paying on account is left out, because the invoice exists in the first place because credit was granted, and settling it on account would grant the same credit again.Arguments: device

Return

A return raised against one or more orders

FieldTypeDescription
idID!
returnNumberStringThe customer-facing return reference, when the engine issues one
orders[Order!]!The orders the return covers; usually one
requestedAtDateTime!
requestedByCustomerThe associate who requested it, for a business unit's return
statusReturnStatusType!The least-advanced status across the return's items
resolutionReturnResolutionTypeHow it was settled; null until COMPLETED
reasonReturnReasonWhy the return was raised, where one reason covers every line
noteStringA note from the buyer to the seller
items[ReturnItem!]!
shippingReturnShipping
feeMoneyTotal withheld across the lines, such as restocking fees; null when none
rejectionReasonStringWhy the seller refused it, for a REJECTED return
creditNoteReturnCreditNotePresent when the resolution is CREDIT
refundReturnRefundHow a consumer's return is paid back; null for a business unit's return
cancellableBoolean!Whether the buyer may still withdraw it: REQUESTED or APPROVED, and nothing received

ReturnableLine

An order line that can still be returned, and how many. Only delivered lines within the return period appear.

FieldTypeDescription
lineItemOrderLineItem!
returnableQuantityInt!Delivered minus already returned or requested
requiresSerialNumberBoolean!The product is a device: each returned unit needs its serial number
returnByDateDateThe last day the line can be returned; null without a deadline
exchangeableBoolean!Whether the line may be exchanged instead of refunded: a consumer's order, on an engine that takes exchanges. One choice per line: a line is either exchanged or refunded within one return.

ReturnAttachment

A photo or document attached to a returned line

FieldTypeDescription
idID!
filenameString!
contentTypeString!
urlURL!A signed URL that stops working at expiresAt; read the return again for a fresh one
expiresAtDateTimeWhen url expires; null when it does not

ReturnAttachmentUpload

A signed URL to PUT one attachment to, before it is named in returnCreate

FieldTypeDescription
attachmentIdID!An opaque handle to pass in ReturnItemInput.attachmentIds
uploadUrlURL!
expiresAtDateTime!

ReturnAttachmentUploadResponse

FieldTypeDescription
uploadReturnAttachmentUpload
returnErrors[ReturnAttachmentUploadError!]Such as a content type or size the server refuses

ReturnCancelResponse

FieldTypeDescription
returnReturn
returnErrors[ReturnCancelError!]

ReturnCreateResponse

FieldTypeDescription
returnReturn
returnErrors[ReturnCreateError!]

ReturnCreditNote

The credit note that settles a credited return against its invoice

FieldTypeDescription
creditNoteNumberString!
issueDateDate!
totalMoney!
invoiceInvoiceThe invoice the credit note is set against
documentUrlURLLink to the credit note document, where the issuer publishes one

ReturnDropOff

What the buyer shows at a service point to hand the parcel in. A storefront renders the code as a QR code; the server serves no image.

FieldTypeDescription
codeString!
expiresAtDateTimeWhen the code stops being accepted; null when it does not expire

ReturnError

Implements Error

A return the server refuses for a reason of the domain rather than of one field

FieldTypeDescription
messageString!
codeReturnErrorCodeType!

ReturnEstimate

What a return of these lines would withhold and pay back, to show before it is requested

FieldTypeDescription
feeMoneyTotal withheld across the lines; null when nothing is
refundMoneyTotal paid back across the lines: what was paid for each refunded line less its fee, plus the price difference of each exchanged one. Null for a business unit's return, which is settled by credit note.
lines[ReturnEstimateLine!]!

ReturnEstimateLine

FieldTypeDescription
orderOrder!
lineItemOrderLineItem!
feeMoneyWithheld from this line's credit; null when nothing is
refundMoneyWhat is paid back for this line; null for a business unit's return
priceDifferenceMoneyFor a line with exchangeFor: the difference paid back, null when there is none
feeReasonStringWhy, in the store's language, such as a restocking fee for an order returned after 14 days

ReturnExchange

What a returned line is exchanged for, in the same quantity, instead of being refunded. An exchanged line takes no restocking fee.

FieldTypeDescription
variantProductVariant!The replacement
priceDifferenceMoneyPaid back because the replacement costs less: what was paid per unit of the line after its discounts, less the replacement's price when the return was requested, times the quantity. Never negative; null when the two are the same.
orderOrderThe order the replacement ships on, which the seller creates, usually once the goods are received. Null until then. Where the replacement can no longer be sent, the seller refunds the line instead and this stays null.

ReturnItem

A single returned line within a return

FieldTypeDescription
lineItemOrderLineItem!The order line being returned
quantityInt!Quantity returned
statusReturnStatusType!Status of this line; engines without per-line state report the return's own
reasonReturnReasonWhy this line was returned
serialNumbers[String!]!Serial numbers of the returned units, for a device
attachments[ReturnAttachment!]!
feeMoneyWithheld from this line's credit, such as a restocking fee; null when none
exchangeReturnExchangeWhat the line is exchanged for; null for a line that is refunded

ReturnReason

Why a return or one of its lines was raised

FieldTypeDescription
codeString!Machine-readable reason code, one of Query.returnReasons
labelStringThe code's label in the store's language, where the reason list has one
detailsStringFree-text explanation supplied with the return

ReturnReasonOption

A reason a buyer may give for returning a line, with what it requires. Labels are in the store's language.

FieldTypeDescription
codeString!
labelString!
requiresPhotosBoolean!Each line returned for this reason needs at least one photo attached

ReturnRefund

Where a consumer's refund goes, and what was paid back

FieldTypeDescription
methodReturnRefundMethodType!
amountMoneyWhat was paid back; null until the money is
refundedAtDateTimeWhen it was paid back; null until it is, and where the engine does not record it

ReturnResult

FieldTypeDescription
items[Return!]!
paginationPagination!

ReturnShipping

FieldTypeDescription
methodReturnShippingMethodType!
carrierCarrierWho carries the parcel back, for PICKUP and DROP_OFF
pickupAddressAddressWhere the carrier collects, for PICKUP
pickupDateDateThe day the carrier collects, for PICKUP
dropOffReturnDropOffWhat to show at the service point, for DROP_OFF
returnAddressAddressWhere to send the goods, for OWN_SHIPMENT; known once the return is accepted
labelUrlURLA shipping label to print, where the carrier issues one

Input objects

ReturnExchangeInput

FieldTypeDescription
skuString!The replacement, such as another size from Query.returnExchangeOptions

ReturnItemInput

FieldTypeDescription
orderIdID!Order the line belongs to
lineItemIdID!Order line item to return
quantityInt!At most the line's returnableQuantity
reasonReturnReasonInputWhy this line is returned; the return's own reason when left out
serialNumbers[String!]One per returned unit when the line requiresSerialNumber
attachmentIds[ID!]Handles from returnAttachmentUpload; required when the reason requiresPhotos
exchangeForReturnExchangeInputExchange the line for another variant or product instead of a refund, for a consumer's return. A business unit's return takes none.

ReturnReasonInput

FieldTypeDescription
codeStringMachine-readable reason code, one of Query.returnReasons
detailsStringFree-text explanation

ReturnShippingInput

FieldTypeDescription
methodReturnShippingMethodType!
pickupAddressIdIDOne of the customer's address ids; required for PICKUP

Enums

ReturnErrorCodeType

NOT_RETURNABLEThe line cannot be returned at all, such as one that was never delivered
QUANTITY_EXCEEDS_RETURNABLEMore than the line's returnable quantity
RETURN_WINDOW_EXPIREDThe line is past the period in which returns are accepted
ORDER_NOT_FOUNDAn order or return is not one of the customer's
NOT_CANCELLABLEThe return can no longer be withdrawn
SINGLE_ORDER_ONLYThis engine takes the lines of one order per return
EXCHANGE_UNAVAILABLEThe replacement is not sold in this store, or not in stock
EXCHANGE_PRICE_HIGHERThe replacement costs more than was paid for the line. A return pays back and never charges, so the difference cannot be collected.
EXCHANGE_NOT_OFFEREDA business unit's return is settled by credit note and takes no exchange

ReturnRefundMethodType

Where a consumer's refund goes

ORIGINAL_PAYMENTBack to the payment method the order was paid with
STORE_CREDITAs credit to spend in the store

ReturnResolutionType

How a completed return was settled

CREDITA credit note was issued against the invoice
REPLACEMENTThe goods were replaced, by the same item or by what the buyer exchanged them for
REFUNDThe money was paid back, to the original payment method or as store credit

ReturnShippingMethodType

How the goods go back to the seller

PICKUPA carrier collects the goods at one of the buyer's addresses
DROP_OFFThe buyer hands the parcel in at a carrier's service point, showing a code
OWN_SHIPMENTThe buyer sends the goods themselves

ReturnStatusType

Where a return is in the process, normalized across engines

REQUESTEDRequested; for a business unit's return, awaiting the seller's decision
APPROVEDApproved by the seller; the goods are expected back
IN_TRANSITOn its way back: handed in at a service point or collected. An engine that cannot see this goes from REQUESTED or APPROVED to RECEIVED.
RECEIVEDThe goods have been received back
COMPLETEDProcessed and settled; Return.resolution says how
REJECTEDRefused by the seller, before shipping or after inspection
CANCELLEDWithdrawn by the buyer before the goods left

Unions

ReturnAttachmentUploadError

One of ValidationError or ReturnError.

ReturnCancelError

One of ValidationError or ReturnError.

ReturnCreateError

One of ValidationError or ReturnError.