Refunds and order edits
OrderEdit
Section titled “OrderEdit”An order being edited, before the changes are applied.
ID!
No description.
Order!
No description.
status
Section titled “status”OrderEditStatus!
No description.
stagedLines
Section titled “stagedLines”[OrderEditLine!]!
The lines as they will be once committed.
currentTotal
Section titled “currentTotal”Money!
What the order costs now.
stagedTotal
Section titled “stagedTotal”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.
deltaAction
Section titled “deltaAction”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.
fulfillable
Section titled “fulfillable”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.
createdBy
Section titled “createdBy”StaffMember
No description.
createdAt
Section titled “createdAt”DateTime!
No description.
committedAt
Section titled “committedAt”DateTime
No description.
OrderEditCommitPayload
Section titled “OrderEditCommitPayload”What orderEditCommit returns.
Order
No description.
refund
Section titled “refund”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
Section titled “paymentLink”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.
userErrors
Section titled “userErrors”[UserError!]!
No description.
OrderEditDeltaAction
Section titled “OrderEditDeltaAction”What committing an edit will do about the difference.
| Value | Meaning |
|---|---|
NONE | Nothing to settle. |
COLLECT | The 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. |
REFUND | The 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_BALANCE | The 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. |
OrderEditLine
Section titled “OrderEditLine”One line, as it will stand after an edit.
orderLine
Section titled “orderLine”OrderLine
The existing line, or null for one being added.
variant
Section titled “variant”ProductVariant
The variant, for a line being added.
String!
No description.
originalQuantity
Section titled “originalQuantity”Int!
What it was before the edit. Zero for a line being added.
stagedQuantity
Section titled “stagedQuantity”Int!
What it will be. Zero removes it.
unitPrice
Section titled “unitPrice”Money!
No description.
editable
Section titled “editable”Boolean!
Whether this line can be reduced at all.
False once it has shipped: goods already sent are a return, not an edit.
OrderEditLineInput
Section titled “OrderEditLineInput”A change to a staged order edit.
orderLineId
Section titled “orderLineId”ID
The existing line to change. Supply this or variantId, not both.
variantId
Section titled “variantId”ID
A variant to add as a new line.
quantity
Section titled “quantity”Int!
The quantity it should end at. Zero removes the line.
unitPrice
Section titled “unitPrice”MoneyInput
Overrides the catalogue price, for a line being added.
OrderEditPayload
Section titled “OrderEditPayload”What the order-edit mutations return.
orderEdit
Section titled “orderEdit”OrderEdit
No description.
userErrors
Section titled “userErrors”[UserError!]!
No description.
OrderEditStatus
Section titled “OrderEditStatus”Where an edit has got to.
| Value | Meaning |
|---|---|
STAGED | Open, accumulating changes. |
COMMITTED | No description. |
DISCARDED | Abandoned. The order is untouched. |
OrderPaymentLinkPayload
Section titled “OrderPaymentLinkPayload”What orderPaymentLinkSend returns.
paymentLink
Section titled “paymentLink”PaymentLink
No description.
Order
No description.
textStatus
Section titled “textStatus”PaymentLinkTextStatus
Whether Kaladan’s text with the link went, for SMS; null for MANUAL and
when no link was minted.
userErrors
Section titled “userErrors”[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.
Refund
Section titled “Refund”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
Section titled “discrepancy”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.
amount
Section titled “amount”Money!
What is being given back, and why.
reason
Section titled “reason”RefundReason!
No description.
String
The merchant’s own explanation. Shown in the audit log and to support.
method
Section titled “method”RefundMethod!
How the money is going back.
status
Section titled “status”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.
refundsShipping
Section titled “refundsShipping”Boolean!
Whether the delivery charge is being returned too.
commissionAdjustment
Section titled “commissionAdjustment”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
Section titled “transaction”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.
manualReference
Section titled “manualReference”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.
restocked
Section titled “restocked”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.
createdBy
Section titled “createdBy”StaffMember
No description.
createdAt
Section titled “createdAt”DateTime!
No description.
completedAt
Section titled “completedAt”DateTime
No description.
RefundConnection
Section titled “RefundConnection”A page of refunds.
[RefundEdge!]!
No description.
[Refund!]!
No description.
pageInfo
Section titled “pageInfo”PageInfo!
No description.
totalCount
Section titled “totalCount”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.
totalAmount
Section titled “totalAmount”Money!
What these refunds add up to, across every page.
RefundCreateInput
Section titled “RefundCreateInput”A refund to record.
orderId
Section titled “orderId”ID!
No description.
amount
Section titled “amount”MoneyInput
Omit to refund the whole outstanding paid amount.
reason
Section titled “reason”RefundReason!
No description.
method
Section titled “method”RefundMethod!
No description.
String
No description.
[RefundLineInput!]
Which lines, and how many of each. Omit for a refund not tied to lines.
refundsShipping
Section titled “refundsShipping”Boolean
No description.
restock
Section titled “restock”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.
manualReference
Section titled “manualReference”String
The transfer reference, when the merchant has already made it by hand.
notifyCustomer
Section titled “notifyCustomer”Boolean
No description.
RefundEdge
Section titled “RefundEdge”One refund, with its cursor.
cursor
Section titled “cursor”String!
No description.
Refund!
No description.
RefundFilter
Section titled “RefundFilter”A filter on the refund list.
status
Section titled “status”[RefundStatus!]
No description.
method
Section titled “method”[RefundMethod!]
No description.
reason
Section titled “reason”[RefundReason!]
No description.
orderId
Section titled “orderId”ID
No description.
createdAfter
Section titled “createdAfter”DateTime
No description.
outstanding
Section titled “outstanding”Boolean
Refunds recorded but not discharged.
The queue a merchant works: money they have promised back and not yet sent.
RefundLine
Section titled “RefundLine”How much of one line is being refunded.
orderLine
Section titled “orderLine”OrderLine!
No description.
quantity
Section titled “quantity”Int!
No description.
amount
Section titled “amount”Money!
No description.
RefundLineInput
Section titled “RefundLineInput”How much of one line is being refunded.
orderLineId
Section titled “orderLineId”ID!
No description.
quantity
Section titled “quantity”Int!
No description.
amount
Section titled “amount”MoneyInput
Overrides the line’s own price, for a partial refund on a kept item.
RefundMethod
Section titled “RefundMethod”How money goes back.
| Value | Meaning |
|---|---|
GATEWAY | Given 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_TRANSFER | The 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. |
CASH | Cash handed back over a counter. |
STORE_CREDIT | Credit on the shop instead of money: a REFUND entry on the customer’s StoreCreditAccount. |
RefundPayload
Section titled “RefundPayload”What the refund mutations return.
refund
Section titled “refund”Refund
No description.
Order
No description.
adjustments
Section titled “adjustments”[InventoryAdjustment!]!
The stock movements a restock produced.
userErrors
Section titled “userErrors”[UserError!]!
No description.
RefundReason
Section titled “RefundReason”Why money is going back.
| Value | Meaning |
|---|---|
RETURN | The buyer sent the goods back. |
CANCELLATION | The order was cancelled after payment. |
OUT_OF_STOCK | The merchant could not supply it. |
DAMAGED | It arrived broken. |
DUPLICATE_CHARGE | The buyer was charged twice — a reconciliation outcome. |
PRICING_ERROR | Overcharged: a price or delivery error the merchant made. |
GOODWILL | A gesture, with nothing coming back. |
OTHER | No description. |
RefundStatus
Section titled “RefundStatus”Where a refund has got to.
| Value | Meaning |
|---|---|
PENDING | Recorded; the money has not moved. |
PROCESSING | A gateway refund is in flight. |
COMPLETED | No description. |
FAILED | The provider refused it. Transaction.lastVerificationError says why. |
CANCELLED | No description. |