Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

Refunds and order edits

Object

An order being edited, before the changes are applied.

ID!

No description.

Order!

No description.

OrderEditStatus!

No description.

[OrderEditLine!]!

The lines as they will be once committed.

Money!

What the order costs now.

Money!

What it will cost once committed.

Money!

The difference, signed.

Positive means the buyer owes more; negative means they are owed a refund. This is the number the whole staged model exists to produce.

OrderEditDeltaAction!

What committing will do about the delta.

Computed rather than chosen, because the answer follows from the sign and from what the order has already paid.

Boolean!

Whether the staged lines can actually be supplied.

False when an added line has no stock. Surfaced before commit so a merchant does not promise something they cannot send.

StaffMember

No description.

DateTime!

No description.

DateTime

No description.

Object

What orderEditCommit returns.

Order

No description.

Refund

Always null. A commit creates no refund: money going back is raised separately, by a person, with refundCreate — so the merchant sees it leave before it does. When the edit left the order holding more than it costs, the excess is order.cost.totalPaidAmount less totalRefundedAmount less totalAmount.

PaymentLink

Where to send the buyer to pay the difference: a link minted by the commit when it left an order something was paid on owing more — deltaAction COLLECT — for exactly what the order then owes. Null otherwise.

It opens /pay/{token} on the shop’s primary domain, where the buyer sees the order, what changed and what is owed, and pays online; the payment is bound to the order, so its outstanding falls to zero once the bank confirms. It expires like a draft’s link, and any earlier link of the order stops asking for money. orderPaymentLinkSend mints another later, and Order.paymentLink reads the newest. A replay of the commit answers the order’s newest link.

[UserError!]!

No description.

Enum

What committing an edit will do about the difference.

ValueMeaning
NONENothing to settle.
COLLECTThe buyer owes more, on an order something was paid on. Committing mints a payment link for what the order then owes — OrderEditCommitPayload.paymentLink — and the balance may also be taken by hand, as cash or a transfer recorded against the order.
REFUNDThe buyer is owed: the order now holds more than it costs. No refund is created — a person records it with refundCreate, for the excess.
ADJUST_BALANCEThe order was never paid, so the total simply changes. The commonest case here: a cash-on-delivery order edited before dispatch owes nothing extra, because nothing was collected yet.
Object

One line, as it will stand after an edit.

OrderLine

The existing line, or null for one being added.

ProductVariant

The variant, for a line being added.

String!

No description.

Int!

What it was before the edit. Zero for a line being added.

Int!

What it will be. Zero removes it.

Money!

No description.

Boolean!

Whether this line can be reduced at all.

False once it has shipped: goods already sent are a return, not an edit.

Input

A change to a staged order edit.

ID

The existing line to change. Supply this or variantId, not both.

ID

A variant to add as a new line.

Int!

The quantity it should end at. Zero removes the line.

MoneyInput

Overrides the catalogue price, for a line being added.

Object

What the order-edit mutations return.

OrderEdit

No description.

[UserError!]!

No description.

Enum

Where an edit has got to.

ValueMeaning
STAGEDOpen, accumulating changes.
COMMITTEDNo description.
DISCARDEDAbandoned. The order is untouched.
Object

What orderPaymentLinkSend returns.

PaymentLink

No description.

Order

No description.

PaymentLinkTextStatus

Whether Kaladan’s text with the link went, for SMS; null for MANUAL and when no link was minted.

[UserError!]!

Why it could not be sent. Empty with a link: minted, and texted as textStatus says. Non-empty beside a link when the link was minted and its text did not go (textStatus NOT_SENT): the link exists for the merchant to copy, and the refusal says why the text did not go. Non-empty with no link: nothing was minted.

Object

Money going back to a buyer.

ID!

No description.

Order

The order the money is going back against.

Null for a refund no order is behind: one discrepancyRefund raised for an UNCLAIMED_PAYMENT, which gives back a payment the buyer made for a sale that was never written down. discrepancy names what raised it, and its transaction the payment. Should the sale arrive afterwards, the refund is given its order.

Discrepancy

The discrepancy discrepancyRefund raised it for.

Null for a refund a person recorded against an order. Every refund has one or the other behind it: a person asked for it against an order, or against the discrepancy an unclaimed payment raised.

Money!

What is being given back, and why.

RefundReason!

No description.

String

The merchant’s own explanation. Shown in the audit log and to support.

RefundMethod!

How the money is going back.

RefundStatus!

No description.

[RefundLine!]!

Which lines this refund covers, and how many of each.

Empty for a refund that is not tied to lines — a goodwill gesture, a delivery charge returned because the parcel was late.

Boolean!

Whether the delivery charge is being returned too.

Money!

What happened to Kaladan’s commission on the sale being refunded.

Zero outside PLATFORM mode, where Kaladan took nothing to begin with. Inside it, the amount is decided by CommissionTerms.commissionOnRefund:

  • RETURNED — a positive amount coming back to the merchant.
  • NETTED — a positive amount credited against future commission rather than transferred. It still appears here, because a credit a merchant cannot see is a credit they will not believe in.
  • KEPT — zero, recorded rather than omitted, so a merchant asking “did I get the commission back” is answered instead of left to infer.

Recorded per refund rather than derived, because the terms can change between the sale and the refund and the sale’s terms are the ones that govern. It is also what keeps the payout breakdown identity balancing: gross less fees, commission, refunds and adjustments equals net, and a refund that moved commission without saying so would break it by exactly this number.

Transaction

The transaction that discharged it, when there was one.

Null for a manual transfer the merchant has not yet confirmed, and for store credit, which moves no money.

String

The transfer reference, for a refund the merchant made by hand.

The only evidence that a manual refund happened, so an admin should require it before marking one complete.

Boolean!

Whether the goods came back into stock as part of this.

Recorded here as well as on the return because a refund without a return is common — a partial refund for a damaged item the buyer keeps — and a merchant reading the refund needs to know whether they got anything back.

StaffMember

No description.

DateTime!

No description.

DateTime

No description.

Object

A page of refunds.

[RefundEdge!]!

No description.

[Refund!]!

No description.

PageInfo!

No description.

Int!

How many match the filter, across every page — the same number on page one and on page five. Counted up to 10000: a larger result reads 10000, and a client showing it says “10000 or more”. Test rows are counted only where the list includes them.

Money!

What these refunds add up to, across every page.

Input

A refund to record.

ID!

No description.

MoneyInput

Omit to refund the whole outstanding paid amount.

RefundReason!

No description.

RefundMethod!

No description.

String

No description.

[RefundLineInput!]

Which lines, and how many of each. Omit for a refund not tied to lines.

Boolean

No description.

Boolean

Whether to return the goods to stock.

Independent of the lines: a merchant refunding a damaged item the buyer keeps refunds lines and restocks nothing.

String

The transfer reference, when the merchant has already made it by hand.

Boolean

No description.

Object

One refund, with its cursor.

String!

No description.

Refund!

No description.

Input

A filter on the refund list.

[RefundStatus!]

No description.

[RefundMethod!]

No description.

[RefundReason!]

No description.

ID

No description.

DateTime

No description.

Boolean

Refunds recorded but not discharged.

The queue a merchant works: money they have promised back and not yet sent.

Object

How much of one line is being refunded.

OrderLine!

No description.

Int!

No description.

Money!

No description.

Input

How much of one line is being refunded.

ID!

No description.

Int!

No description.

MoneyInput

Overrides the line’s own price, for a partial refund on a kept item.

Enum

How money goes back.

ValueMeaning
GATEWAYGiven back through the provider that took the money, which is asked at once. Asked of one payment of the order — the one with the most left to give back — at a provider that gives refunds through its API, which not every one does. The refund is PROCESSING until the provider answers, COMPLETED once it gave the money back and FAILED if it refused. The provider then takes it out of the merchant’s next settlement transfer, which that payout’s breakdown.refunds and refunds show.
MANUAL_TRANSFERThe merchant transfers it back themselves — کارت به کارت. The common case here, and the reason this enum exists. The platform records the intent; the merchant records the reference when they have made the transfer.
CASHCash handed back over a counter.
STORE_CREDITCredit on the shop instead of money: a REFUND entry on the customer’s StoreCreditAccount.
Object

What the refund mutations return.

Refund

No description.

Order

No description.

[InventoryAdjustment!]!

The stock movements a restock produced.

[UserError!]!

No description.

Enum

Why money is going back.

ValueMeaning
RETURNThe buyer sent the goods back.
CANCELLATIONThe order was cancelled after payment.
OUT_OF_STOCKThe merchant could not supply it.
DAMAGEDIt arrived broken.
DUPLICATE_CHARGEThe buyer was charged twice — a reconciliation outcome.
PRICING_ERROROvercharged: a price or delivery error the merchant made.
GOODWILLA gesture, with nothing coming back.
OTHERNo description.
Enum

Where a refund has got to.

ValueMeaning
PENDINGRecorded; the money has not moved.
PROCESSINGA gateway refund is in flight.
COMPLETEDNo description.
FAILEDThe provider refused it. Transaction.lastVerificationError says why.
CANCELLEDNo description.