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.
| Field | Type | Description |
|---|
id | ID! | Unique identifier of the invoice |
invoiceNumber | String! | Invoice number as the issuing system assigned it |
invoiceDate | Date! | Calendar date the invoice was issued |
dueDate | Date | Calendar date payment is due. Null where the issuer set no term. |
status | InvoiceStatusType! | Where the invoice stands, derived from what has been collected |
total | Money! | What the invoice bills in total |
amountPaid | Money! | What has been collected against it |
amountDue | Money! | What is still to be collected |
reference | String | The issuer's own reference, usually the buyer's, shown on the document |
invoiceUrl | URL | Link to the invoice document, where the issuer publishes one |
orderNumbers | [String!]! | Numbers of the orders this invoice bills |
payable | Boolean! | 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
| Field | Type | Description |
|---|
id | ID! | |
returnNumber | String | The customer-facing return reference, when the engine issues one |
orders | [Order!]! | The orders the return covers; usually one |
requestedAt | DateTime! | |
requestedBy | Customer | The associate who requested it, for a business unit's return |
status | ReturnStatusType! | The least-advanced status across the return's items |
resolution | ReturnResolutionType | How it was settled; null until COMPLETED |
reason | ReturnReason | Why the return was raised, where one reason covers every line |
note | String | A note from the buyer to the seller |
items | [ReturnItem!]! | |
shipping | ReturnShipping | |
fee | Money | Total withheld across the lines, such as restocking fees; null when none |
rejectionReason | String | Why the seller refused it, for a REJECTED return |
creditNote | ReturnCreditNote | Present when the resolution is CREDIT |
refund | ReturnRefund | How a consumer's return is paid back; null for a business unit's return |
cancellable | Boolean! | 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.
| Field | Type | Description |
|---|
lineItem | OrderLineItem! | |
returnableQuantity | Int! | Delivered minus already returned or requested |
requiresSerialNumber | Boolean! | The product is a device: each returned unit needs its serial number |
returnByDate | Date | The last day the line can be returned; null without a deadline |
exchangeable | Boolean! | 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
| Field | Type | Description |
|---|
id | ID! | |
filename | String! | |
contentType | String! | |
url | URL! | A signed URL that stops working at expiresAt; read the return again for a fresh one |
expiresAt | DateTime | When url expires; null when it does not |
ReturnAttachmentUpload
A signed URL to PUT one attachment to, before it is named in returnCreate
| Field | Type | Description |
|---|
attachmentId | ID! | An opaque handle to pass in ReturnItemInput.attachmentIds |
uploadUrl | URL! | |
expiresAt | DateTime! | |
ReturnAttachmentUploadResponse
ReturnCreditNote
The credit note that settles a credited return against its invoice
| Field | Type | Description |
|---|
creditNoteNumber | String! | |
issueDate | Date! | |
total | Money! | |
invoice | Invoice | The invoice the credit note is set against |
documentUrl | URL | Link 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.
| Field | Type | Description |
|---|
code | String! | |
expiresAt | DateTime | When 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
ReturnEstimate
What a return of these lines would withhold and pay back, to show before it is requested
| Field | Type | Description |
|---|
fee | Money | Total withheld across the lines; null when nothing is |
refund | Money | Total 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
| Field | Type | Description |
|---|
order | Order! | |
lineItem | OrderLineItem! | |
fee | Money | Withheld from this line's credit; null when nothing is |
refund | Money | What is paid back for this line; null for a business unit's return |
priceDifference | Money | For a line with exchangeFor: the difference paid back, null when there is none |
feeReason | String | Why, 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.
| Field | Type | Description |
|---|
variant | ProductVariant! | The replacement |
priceDifference | Money | Paid 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. |
order | Order | The 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
| Field | Type | Description |
|---|
lineItem | OrderLineItem! | The order line being returned |
quantity | Int! | Quantity returned |
status | ReturnStatusType! | Status of this line; engines without per-line state report the return's own |
reason | ReturnReason | Why this line was returned |
serialNumbers | [String!]! | Serial numbers of the returned units, for a device |
attachments | [ReturnAttachment!]! | |
fee | Money | Withheld from this line's credit, such as a restocking fee; null when none |
exchange | ReturnExchange | What the line is exchanged for; null for a line that is refunded |
ReturnReason
Why a return or one of its lines was raised
| Field | Type | Description |
|---|
code | String! | Machine-readable reason code, one of Query.returnReasons |
label | String | The code's label in the store's language, where the reason list has one |
details | String | Free-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.
| Field | Type | Description |
|---|
code | String! | |
label | String! | |
requiresPhotos | Boolean! | Each line returned for this reason needs at least one photo attached |
ReturnRefund
Where a consumer's refund goes, and what was paid back
| Field | Type | Description |
|---|
method | ReturnRefundMethodType! | |
amount | Money | What was paid back; null until the money is |
refundedAt | DateTime | When it was paid back; null until it is, and where the engine does not record it |
ReturnShipping
| Field | Type | Description |
|---|
method | ReturnShippingMethodType! | |
carrier | Carrier | Who carries the parcel back, for PICKUP and DROP_OFF |
pickupAddress | Address | Where the carrier collects, for PICKUP |
pickupDate | Date | The day the carrier collects, for PICKUP |
dropOff | ReturnDropOff | What to show at the service point, for DROP_OFF |
returnAddress | Address | Where to send the goods, for OWN_SHIPMENT; known once the return is accepted |
labelUrl | URL | A shipping label to print, where the carrier issues one |
| Field | Type | Description |
|---|
sku | String! | The replacement, such as another size from Query.returnExchangeOptions |
| Field | Type | Description |
|---|
orderId | ID! | Order the line belongs to |
lineItemId | ID! | Order line item to return |
quantity | Int! | At most the line's returnableQuantity |
reason | ReturnReasonInput | Why 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 |
exchangeFor | ReturnExchangeInput | Exchange the line for another variant or product instead of a refund, for
a consumer's return. A business unit's return takes none. |
| Field | Type | Description |
|---|
code | String | Machine-readable reason code, one of Query.returnReasons |
details | String | Free-text explanation |
| Field | Type | Description |
|---|
method | ReturnShippingMethodType! | |
pickupAddressId | ID | One of the customer's address ids; required for PICKUP |
Enums
ReturnErrorCodeType
NOT_RETURNABLE | The line cannot be returned at all, such as one that was never delivered |
QUANTITY_EXCEEDS_RETURNABLE | More than the line's returnable quantity |
RETURN_WINDOW_EXPIRED | The line is past the period in which returns are accepted |
ORDER_NOT_FOUND | An order or return is not one of the customer's |
NOT_CANCELLABLE | The return can no longer be withdrawn |
SINGLE_ORDER_ONLY | This engine takes the lines of one order per return |
EXCHANGE_UNAVAILABLE | The replacement is not sold in this store, or not in stock |
EXCHANGE_PRICE_HIGHER | The replacement costs more than was paid for the line. A return pays back
and never charges, so the difference cannot be collected. |
EXCHANGE_NOT_OFFERED | A business unit's return is settled by credit note and takes no exchange |
ReturnRefundMethodType
Where a consumer's refund goes
ORIGINAL_PAYMENT | Back to the payment method the order was paid with |
STORE_CREDIT | As credit to spend in the store |
ReturnResolutionType
How a completed return was settled
CREDIT | A credit note was issued against the invoice |
REPLACEMENT | The goods were replaced, by the same item or by what the buyer exchanged them for |
REFUND | The money was paid back, to the original payment method or as store credit |
ReturnShippingMethodType
How the goods go back to the seller
PICKUP | A carrier collects the goods at one of the buyer's addresses |
DROP_OFF | The buyer hands the parcel in at a carrier's service point, showing a code |
OWN_SHIPMENT | The buyer sends the goods themselves |
ReturnStatusType
Where a return is in the process, normalized across engines
REQUESTED | Requested; for a business unit's return, awaiting the seller's decision |
APPROVED | Approved by the seller; the goods are expected back |
IN_TRANSIT | On its way back: handed in at a service point or collected. An engine
that cannot see this goes from REQUESTED or APPROVED to RECEIVED. |
RECEIVED | The goods have been received back |
COMPLETED | Processed and settled; Return.resolution says how |
REJECTED | Refused by the seller, before shipping or after inspection |
CANCELLED | Withdrawn 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.