Giao diện
API · order
Trang sinh tự động
Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.
13 query · 5 mutation.
Query
adminOrder
U19-P2-11. One order for the Admin detail. Requires order.read (OPS-02 ALL; M-02 TEAM: attributed orders of a managed team). Full phone, street line and note only for customer readers; otherwise masked. Missing or out of scope = not_found.
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về AdminOrderDetail!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
code | String! | |
campaignType | OrderCampaignType! | |
createdAt | DateTime! | |
approvedAt | DateTime | Ngay duyet (order confirmed); null until then. |
cancelLockedAt | DateTime | Ngay khoa huy = the confirmation instant; null until then. |
source | AdminOrderSource! | |
campaign | AdminOrderCampaignBlock! | |
statusCards | AdminOrderStatusCards! | |
lines | [AdminOrderDetailLine!]! | |
pii | AdminOrderPii! | |
customer | AdminOrderCustomerBlock! | |
delivery | AdminOrderDelivery! | |
payment | AdminOrderPaymentBlock! | U19-P2-12. Khoi Thanh toan (order.read, no Finance permission needed). |
shipment | AdminOrderShipmentBlock | U19-P2-12. Khoi Giao hang of a Group Buy order; null while it has no shipment (and for Recurring). |
cycleShipments | [AdminOrderShipmentBlock!]! | U19-P2-12. Recurring: the shipment of each cycle that has one, by cycle; empty for Group Buy. |
rewards | AdminOrderRewards! | U19-P2-12. Diem thuong cua don: the reward entries (moc nhan hang, vong quay, Affiliate, online bonus). |
version | Int! | U19-R19. Same as AdminOrder.version of the list (orders.version): the expectedVersion of the order commands. |
pointAdjustmentLink | AdminOrderPointAdjustmentLink | U19-R19. Same as AdminOrder.pointAdjustmentLink of the list: set only for an order (or a cycle) in Hoàn hàng. |
actions | AdminOrderActions! | U19-R19. Buttons for this caller (grants + order state), decided by the server. |
recurring | AdminOrderRecurring | U19-P2-13. Mua định kỳ: progress, values and the cycles table; null for Group Buy. |
depositDueAt | DateTime | PAF (S1): Hạn thanh toán cọc = payment.deposit_due_at of the order's creation instant (the same window as Order.depositDueAt). |
excessDeposits | [OrderExcessDeposit!]! | PAF (S2b): Cọc dư of this order, one entry per case (oldest first), same as AdminOrder.excessDeposits. |
excessDepositTotalVnd | Int | PAF (S2b): the sum of excessDeposits; null when the order has no case. |
returnOutcomes | [OrderReturnOutcome!]! | #479 B. The same as AdminOrder.returnOutcomes, on the order detail (adminOrder). Requires order.read. |
excessRefundRequests | [OrderExcessRefundRequest!]! | #479 C. The same as AdminOrder.excessRefundRequests, on the order detail (adminOrder). Requires order.read. |
adminOrderHistory
Order history of every change (order status, payment, delivery, Pi-Point, notifications) from the append-only activity log (U19-P1-09), newest first. Requires order.read at TEAM/ALL (same guard as orderEvents; a buyer is refused here). Filters combine with AND; cycleNo null = all. A missing or out-of-scope order is not_found.
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
orderId | ID! | ||
category | OrderHistoryCategory | ||
actorKind | OrderHistoryActorKind | ||
cycleNo | Int | ||
page | Int | ||
pageSize | Int |
Trả về OrderHistoryPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [OrderHistoryEntry!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | Record count of the same filters. |
sourceStatus | SourceStatus! | |
missingSources | [OrderHistoryMissingSource!]! |
adminOrders
Staff order list/search, newest first. Requires order.read (OPS-02 ALL; M-02 TEAM: orders attributed to a Sale currently in the caller's team). U19-P2-10 (Word B024.R02): keyword = order code / customer name (partial, any case, diacritics ignored) / phone (customer readers only); filters AND; dates are Vietnam days YYYY-MM-DD (inclusive), from > to = validation_failed reason date_range; pageSize 1..500, default 50 (50/100/500). PAF (S3): hasExcessDeposit / hasFailedDeliveryCycle filter as adminOrderTabCounts does, so the tab counts match.
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
keyword | String | ||
campaignType | OrderCampaignType | ||
campaignStatus | CampaignAxisFilter | ||
orderStatus | OrderAxis | ||
paymentAxis | PaymentAxis | ||
shippingStatus | ShippingStatus | ||
paymentMethod | PaymentMethodFilter | ||
createdOnFrom | String | ||
createdOnTo | String | ||
approvedOnFrom | String | ||
approvedOnTo | String | ||
campaignId | ID | ||
status | OrderState | ||
customerId | ID | ||
asOf | DateTime | Leave out orders created after this instant (stable pages). | |
search | String | ||
searchBy | OrderSearchBy | ||
paymentStatus | OrderPaymentStatus | ||
deliveryStatus | OrderDeliveryStatus | ||
campaignState | CampaignState | ||
method | AdminOrderMethod | ||
hasExcessDeposit | Boolean | PAF (S3): true = only orders with at least one excess deposit case (Cọc dư), Mua chung and Mua định kỳ. | |
hasFailedDeliveryCycle | Boolean | PAF (S3): true = only Mua định kỳ orders with a cycle whose delivery failed for good (DELIVERY_FAILED, no attempt left) and is not paid in full. | |
page | Int | ||
pageSize | Int |
Trả về AdminOrderPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [AdminOrder!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! |
adminOrderTabCounts
U19-P2-10. Tab counts (Tat ca / Mua chung / Mua dinh ky) of adminOrders under the same search and filters, the type tab excluded. Requires order.read (OPS-02 ALL; M-02 TEAM). Phone search: customer readers only.
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
keyword | String | ||
campaignId | ID | ||
campaignStatus | CampaignAxisFilter | ||
orderStatus | OrderAxis | ||
paymentAxis | PaymentAxis | ||
shippingStatus | ShippingStatus | ||
paymentMethod | PaymentMethodFilter | ||
createdOnFrom | String | ||
createdOnTo | String | ||
approvedOnFrom | String | ||
approvedOnTo | String | ||
asOf | DateTime | ||
hasExcessDeposit | Boolean | PAF (S3): the same filter as adminOrders.hasExcessDeposit. | |
hasFailedDeliveryCycle | Boolean | PAF (S3): the same filter as adminOrders.hasFailedDeliveryCycle. |
Trả về AdminOrderTabCounts!
| Field | Kiểu | Mô tả |
|---|---|---|
all | Int! | |
groupBuy | Int! | |
recurring | Int! |
groupQuote
Server quote for one Group Buy product. Requires order.create (U-02, own).
query · quyền: order.create
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | GroupQuoteInput! |
Trả về OrderQuote!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
version | Int! | Send it back as quoteVersion when submitting. |
status | OrderQuoteStatus! | |
campaignId | ID! | |
campaignType | OrderCampaignType! | |
campaignVersion | Int! | |
policyVersionId | ID! | |
cycleCount | Int! | |
lines | [OrderLine!]! | |
priceKind | OrderPriceKind! | |
v0Vnd | VndAmount! | |
depositRateBp | Int! | |
depositVnd | VndAmount! | Mua chung: cash deposit = (v0Vnd - pointsValueVnd) x depositRateBp / 10000 on Khách phải trả (U19-P2-36), rounded UP to 1 VND (G1S BR-APP-06; orders created before it keep half-up). Mua định kỳ: v0Vnd x depositRateBp until U19-P2-37. |
pointCapBp | Int! | The campaign's Pi-Point payment cap in basis points (0 = Pi-Point cannot be used). |
maxPoints | PointAmount! | floor(cap x V0 / rate); 0 when pointsUnavailableReason is set. Available points are checked by PiPoint at redemption. |
pointsUnavailableReason | PointsUnavailableReason | #377 PiPoint port: why points cannot be used in this environment (the quote then uses 0 points: hide the option); null when they can. |
usablePoints | PointAmount! | G1S (BR-DC-03, P5): min(maxPoints, the buyer's available Pi-Point balance); 0 when points cannot be used. The buyer uses all of it by default, no input. |
pointsUsed | PointAmount! | |
pointsValueVnd | VndAmount! | PI_POINT tender value (points x rate snapshot), taken off Khách phải trả = v0Vnd - pointsValueVnd. |
pointRate | RateSnapshot! | |
milestones | [OrderMilestone!]! | Delivery milestones to choose from (Group Buy). |
remainingCapVnd | Int | PAF (S6, DEC-PAF-12): Còn lại tối đa khi chốt = the order value at the current tier - pointsValueVnd - depositVnd, from the server (the App shows it as is, never computes it); null when unknown. |
createdAt | DateTime! | |
expiresAt | DateTime! | After this instant the quote cannot be submitted; request a new one. |
referrer | OrderReferrer | Xem trước. Đơn được ghi nhận lúc tạo; có thể khác nếu có lượt mở link mới giữa quote và đặt. Null when nobody would be credited. |
myOrderCounts
Chip counts of the caller's own orders, same filters as myOrders. Requires order.read (U-01, own).
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
campaignType | OrderCampaignType | ||
placedFrom | DateTime | ||
asOf | DateTime |
Trả về MyOrderCounts!
| Field | Kiểu | Mô tả |
|---|---|---|
all | Int! | |
awaitingDeposit | Int! | |
deposited | Int! | |
awaitingPayment | Int! | |
shipping | Int! | |
completed | Int! | |
cancelled | Int! |
myOrders
The caller's own orders, newest first. Requires order.read (U-01, own).
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
status | OrderState | ||
campaignType | OrderCampaignType | P2-14: Group Buy / Recurring filter (UA-17 AC02). | |
asOf | DateTime | P2-14: leave out orders created after this instant (stable pages). | |
placedFrom | DateTime | G2I-P3-02 (O15): only orders created at or after this instant (the 6-month footer); after asOf is validation_failed. | |
bucket | MyOrderBucket | G2I-P3-02 (O1, E6): only the orders of this chip, the same rule as myOrderCounts. | |
campaignProductId | ID | PAF (S4, DEC-PAF-04, BR-DC-03): only the caller's orders with a line of this Deal (Campaign Product), for the Bạn đã có đơn cho Deal này popup. Without status and bucket the Đã hủy states (CANCELLED, DEPOSIT_FAILED, FORFEITED) are left out (PAF-P1-11). | |
page | Int | ||
pageSize | Int |
Trả về OrderPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [Order!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! |
order
One own order; another account's order is not_found. Requires order.read.
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
id | ID! |
Trả về Order!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
code | String! | Business order code, unique and immutable (#298; temporary format PO + 8 A-Z0-9). |
state | OrderState! | |
version | Int! | |
quoteId | ID! | |
campaignId | ID! | |
campaignType | OrderCampaignType! | |
campaignVersion | Int! | |
policyVersionId | ID! | |
committedCycleCount | Int! | |
lines | [OrderLine!]! | |
v0Vnd | VndAmount! | |
depositRateBp | Int! | |
depositVnd | VndAmount! | |
pointCapBp | Int! | |
pointsUsed | PointAmount! | |
pointsValueVnd | VndAmount! | |
pointRate | RateSnapshot! | |
finalPriceVnd | VndAmount | Null until the campaign close outcome exists (never a false 0). |
remainingVnd | VndAmount | Null until the final price exists (never a false 0). |
milestone | OrderMilestone | |
deliveryAddress | OrderDeliveryAddress! | Snapshot at order time; profile edits never change it. |
quotedAt | DateTime! | |
stateChangedAt | DateTime! | |
createdAt | DateTime! | |
updatedAt | DateTime! | |
depositDueAt | DateTime | #377 D2: the deposit is due before this instant (createdAt + the governing payment window, Word B056.R02: 24 h); after it the order is Da huy. Null when the order no longer waits for its deposit. |
remainingCapVnd | Int | PAF (S6, DEC-PAF-12): Mua chung with the deposit paid and the campaign not closed yet: Còn lại tối đa khi chốt (the order value at the current tier - pointsValueVnd - depositVnd), from the server; null otherwise. |
serverTime | DateTime! | PAF-P3-12 (R-22): the server's clock when the order was read (DB now() of that read), so the App's countdowns (Hạn thanh toán cọc) run on server time. |
participantOrdinal | Int | Người thứ n (BR-MC-02 per owner 30/10, DEC-OWN30-S1-ORDINAL): the participant count of the Deal (RECURRING: of the basket) at the instant the deposit is confirmed, this buyer included (real people with a committed order + virtual units, the participantCount rule), fixed then; null before that. |
spin | OrderSpin! | Lucky Wheel facts of the order (never null; NOT_APPLIED when there is nothing to show). |
shipments | [OrderShipment!]! | Own shipments of this order; empty means no shipment yet (UA-19 AC04). |
paymentMethod | OrderPaymentMethod! | U19-P2-21. Remaining payment method (U-04 payment.read, own order). |
paymentMethodVersion | Int! | Version of the choice, the expectedVersion of selectRemainingPaymentMethod (0 = never chosen). |
remainingSwitch | OrderRemainingSwitch | U28-P2-03. After the close: the COD -> ONLINE switch as computed now; null before the close. PAF (S9, DEC-PAF-09): Mua chung too (lockedCycleNos always empty; blockedReason all_cycles_locked = the order is at Đang đóng gói or later), Mua định kỳ per cycle. |
shortageCancellation | OrderShortageCancellation | The latest supply-shortage cancellation of this order, whole or partial (A-OD-07 AC08). |
shortageCancellations | [OrderShortageCancellation!]! | Every supply-shortage cancellation of this order, newest first (a partial shortage keeps the order alive). |
codReturn | OrderCodReturn | The RETURN case of this Order when its COD was refused (FU-OIFF01), else null. |
status | OrderStatus! | |
overpaymentVnd | VndAmount | Deposit + points value above the final price (offline case); null until close. |
payment | OrderPayment! | Own payment section. Requires payment.read (U-04, own). |
orderStatus | OrderAxis! | Stored order status (Word), the same values staff see. |
paymentStatus | PaymentAxis! | Stored payment status (Word, 8 values), the same values staff see. |
cancelReason | OrderAxisCancelReason | Why the order is Da huy (#377 D2, Word closed list, the values staff see); null unless orderStatus is CANCELLED. An unpaid order cancelled at the campaign close reads DEPOSIT_UNPAID_AT_CLOSE (G1S; DEPOSIT_TIMEOUT on older orders). |
addressVersion | Int! | U19-P2-11. Revision of the delivery address. PAF (DEC-PAF-03): the address no longer changes once the order exists. |
customerNote | String | U19-P2-11. Ghi chu cua khach entered at order time. |
rewards | [OrderReward!]! | The buyer's own reward entries; empty when the order has none yet. |
referrer | OrderReferrer | The credited referrer; null when nobody is credited (no link, window expired, own link, locked owner, not assigned yet). |
currentCycle | OrderCurrentCycle | The current cycle of a Mua định kỳ order; null for Mua chung and when no cycle is open (all delivered, stopped, cancelled). |
campaignClosedAt | DateTime | #412 O-37F: when the campaign closed (the close instant of its outcome); null before the close and for Mua định kỳ. |
invitedFriendCount | Int! | #412 G1-09: Người bạn mời of the buyer who joined this Deal. Always 0 for now (owner 28/10: the rule comes later). |
overpaymentCase | OrderOverpaymentCase | #412 U-64b: the offline overpayment case of this order; null when there is none. Requires payment.read (U-04, own). |
refunds | [OrderRefund!]! | Own refunds of this order, newest first; empty when nothing is refunded (#302). Requires payment.read (U-04, own). |
refundAccount | OrderRefundAccount | #412 G1-10: where the refund goes, from the latest refund request the buyer sent; null before one. Requires payment.read (U-04, own). |
orderCancellationEligibility
Server-computed cancellation eligibility of an own order. Requires order.read (U-01, OWN).
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
orderId | ID! |
Trả về OrderCancellationEligibility!
| Field | Kiểu | Mô tả |
|---|---|---|
orderId | ID! | |
version | Int! | |
status | OrderState! | |
campaignType | CampaignType! | |
cutoffAt | DateTime! | Group/basket cutoff (campaign closes_at); the check at submit time is authoritative. |
eligible | Boolean! | |
reason | OrderCancelReason | |
selfServiceLocked | Boolean! | True after the cutoff/close: the order is read-only for the buyer. |
afterCloseConsequence | OrderAfterCloseConsequence | Only when selfServiceLocked. |
afterClosePolicyRef | String | Open decision behind afterCloseConsequence, e.g. DEC-CP-SKIP. |
estimatedRefund | OrderCancelRefundEstimate | Only when eligible. |
orderEvents
Order history, oldest first. Requires order.read (U-01 own, M-02 TEAM).
query · quyền: order.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
orderId | ID! | ||
page | Int | ||
pageSize | Int |
Trả về OrderEventPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [OrderEvent!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! |
paymentStatus
Canonical status of one payment attempt. Requires payment.read (U-04 own, F-01 Finance).
query · quyền: payment.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
intentId | ID! |
Trả về PaymentIntent!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
obligationId | ID! | |
obligationKind | String! | DEPOSIT or REMAINING. |
obligationStatus | String! | OPEN | SETTLED | CANCELLED | REVERSED (PI_POINT: returned, tendered again by the next deposit attempt, #377). |
orderId | ID | |
orderCode | String | #298 business order code of orderId (temporary format, NEW-SL-12); null with orderId and in a command result. |
orderState | OrderState | |
provider | String! | |
providerMode | PaymentProviderMode! | |
live | Boolean! | Always false: no real money is collected while G-FIN is open. |
amountVnd | VndAmount! | |
currency | String! | |
status | PaymentIntentStatus! | |
version | Int! | |
statusChangedAt | DateTime | |
createdAt | DateTime | |
expiresAt | DateTime | When the provider session ends (the provider's own expiry when reported, #479 T5; else createdAt + the session TTL); null when unknown or the intent is no longer open. |
payUrl | String | #479 T5: the provider's web checkout page (https) of the open session; null when not open or not reported. |
deeplink | String | #479 T5: the provider app deeplink of the open session; null when not open or not reported. |
qrData | String | #479 T5: the text the session's QR code encodes; null when not open or not reported. |
publicRecurringQuote
G2S S12: quote of a guest's device basket for a published OPEN Recurring campaign (closed: conflict campaign_closed; unknown, unpublished or Group Buy: not_found; an empty cycle: validation_failed cycle_empty). No sign-in needed (deal.read_public, PUB-01; a Sale reads not_found); x-pi-app is still required.
query · SDL không ghi quyền
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | PublicRecurringQuoteInput! |
Trả về PublicRecurringQuote!
| Field | Kiểu | Mô tả |
|---|---|---|
campaignId | ID! | |
packageNo | Int! | |
deliveryWindowNo | Int! | |
cycleCount | Int! | Số kỳ cam kết of the package. |
lines | [OrderLine!]! | Order-time lines (quantity = the default per cycle, units = Σ over the cycles). |
v0Vnd | VndAmount! | Tạm tính {n} kỳ. |
depositRateBp | Int! | |
depositVnd | VndAmount! | Cọc hôm nay without Pi-Point: depositRate x v0Vnd rounded up to 1 VND (equals depositBeforePointsVnd). |
depositBeforePointsVnd | VndAmount! | |
pointCapBp | Int! | The campaign's Pi-Point payment cap in basis points. |
minOrderValueVnd | VndAmount | Giá trị đơn tối thiểu per period; null when none is set. |
minOrderShortfallVnd | VndAmount! | The largest periods[].minOrderShortfallVnd (0 when every period reaches the minimum). |
defaultTotalVnd | VndAmount! | So với mặc định: every period at the default quantities. |
totalUnits | Int! | |
skipMax | Int! | Được bỏ qua tối đa of the package. |
periods | [OrderPeriod!]! | |
packages | [RecurringPackagePreview!]! | |
remainingCapVnd | Int | PAF (S6, DEC-PAF-12): Còn lại khi rổ chốt at most (no Pi-Point for a guest) = the order value at the current tier - deposit, from the server; null when unknown. |
recurringQuote
Server quote of the caller's own Recurring basket. G2S (DEC-FS27-MD-EMPTY-CYCLE; the same rule as U28-P2-04 DEC-U28-03): a cycle where every product is 0 is validation_failed reason cycle_empty with details.cycleNo (the first one); every cycle must reach the minimum. Requires order.create (U-02, own).
query · quyền: order.create
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | RecurringQuoteInput! |
Trả về RecurringOrderQuote!
| Field | Kiểu | Mô tả |
|---|---|---|
quote | OrderQuote! | The persisted quote (lines: quantity = the default per period); submit it by id/version. |
basketId | ID! | |
basketVersion | Int! | Basket version the quote was priced at; a later basket edit makes it stale. |
packageNo | Int! | The package (Gói kỳ cam kết) the quote is priced for. |
deliveryWindowNo | Int! | The delivery window (Khung ngày giao) of the periods. |
oneCycleVnd | VndAmount! | Order-time value of one period at the default quantities (Σ quantity x giá tạm tính). |
minOrderValueVnd | VndAmount | Giá trị đơn tối thiểu per period of the campaign; null when none is set. |
minOrderShortfallVnd | VndAmount! | The largest periods[].minOrderShortfallVnd (0 when every period with goods reaches the minimum); submit refuses a quote with a shortfall. |
defaultTotalVnd | VndAmount! | So với mặc định: every period at the basket default quantities, at this quote's unit prices. |
totalUnits | Int! | Σ quantity of every product over every period. |
emptyCycleCount | Int! | Periods where every product is 0. G2S (BR-MD-05, DEC-FS27-MD-EMPTY-CYCLE): an empty period is refused (validation_failed cycle_empty), never a skip; always 0. |
skipMax | Int! | Được bỏ qua tối đa of the package (Bỏ qua kỳ in Order management, BR-MD-10); no longer an allowance for empty cycles. |
allocationBasis | PeriodAllocationBasis! | |
periods | [OrderPeriod!]! | The scheduled periods the term commits to, first to last. |
availablePoints | PointAmount | G2S S1: số dư khả dụng of the buyer's Ví của tôi; null when there is no wallet or the balance cannot be read (quote.pointsUnavailableReason says why), never a false 0. The points used by default are quote.usablePoints. |
depositBeforePointsVnd | VndAmount! | G2S S1 (G2-06 Cọc giữ chỗ (x%, chưa trừ Pi-Point)): depositRate x quote.v0Vnd rounded up to 1 VND, before Pi-Point. The deposit to pay is quote.depositVnd (after Pi-Point, BR-MD-07). |
packages | [RecurringPackagePreview!]! | G2S S1 (G2-05): every package of the campaign in Admin order, priced at this quote's quantities. |
remainingCapVnd | Int | PAF (S6, DEC-PAF-12): Còn lại khi rổ chốt at most = the order value at the current tier - Pi-Point value - deposit, from the server (the App shows it as is); null when unknown. |
referrer | OrderReferrer | Xem trước. Đơn được ghi nhận lúc tạo; có thể khác nếu có lượt mở link mới giữa quote và đặt. Null when nobody would be credited. |
Mutation
dropOrderPoints
U-30b "Tiếp tục không dùng điểm" (BR-DC-06): the caller's own Group Buy or (G2S, BR-DCD-05) Mua định kỳ order, still waiting for its deposit and with no accepted or pending point hold, goes to 0 points; the value after Pi-Point and the deposit are recomputed (Mua định kỳ: rate x Tạm tính {n} kỳ; rounded up to 1 VND), code and depositDueAt unchanged. Any other state is conflict. An order already at 0 points is returned as it is. Then pay it with startDepositCheckout. Requires payment.start (U-05, own order).
mutation · quyền: payment.start
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DropOrderPointsInput! |
Trả về Order!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
code | String! | Business order code, unique and immutable (#298; temporary format PO + 8 A-Z0-9). |
state | OrderState! | |
version | Int! | |
quoteId | ID! | |
campaignId | ID! | |
campaignType | OrderCampaignType! | |
campaignVersion | Int! | |
policyVersionId | ID! | |
committedCycleCount | Int! | |
lines | [OrderLine!]! | |
v0Vnd | VndAmount! | |
depositRateBp | Int! | |
depositVnd | VndAmount! | |
pointCapBp | Int! | |
pointsUsed | PointAmount! | |
pointsValueVnd | VndAmount! | |
pointRate | RateSnapshot! | |
finalPriceVnd | VndAmount | Null until the campaign close outcome exists (never a false 0). |
remainingVnd | VndAmount | Null until the final price exists (never a false 0). |
milestone | OrderMilestone | |
deliveryAddress | OrderDeliveryAddress! | Snapshot at order time; profile edits never change it. |
quotedAt | DateTime! | |
stateChangedAt | DateTime! | |
createdAt | DateTime! | |
updatedAt | DateTime! | |
depositDueAt | DateTime | #377 D2: the deposit is due before this instant (createdAt + the governing payment window, Word B056.R02: 24 h); after it the order is Da huy. Null when the order no longer waits for its deposit. |
remainingCapVnd | Int | PAF (S6, DEC-PAF-12): Mua chung with the deposit paid and the campaign not closed yet: Còn lại tối đa khi chốt (the order value at the current tier - pointsValueVnd - depositVnd), from the server; null otherwise. |
serverTime | DateTime! | PAF-P3-12 (R-22): the server's clock when the order was read (DB now() of that read), so the App's countdowns (Hạn thanh toán cọc) run on server time. |
participantOrdinal | Int | Người thứ n (BR-MC-02 per owner 30/10, DEC-OWN30-S1-ORDINAL): the participant count of the Deal (RECURRING: of the basket) at the instant the deposit is confirmed, this buyer included (real people with a committed order + virtual units, the participantCount rule), fixed then; null before that. |
spin | OrderSpin! | Lucky Wheel facts of the order (never null; NOT_APPLIED when there is nothing to show). |
shipments | [OrderShipment!]! | Own shipments of this order; empty means no shipment yet (UA-19 AC04). |
paymentMethod | OrderPaymentMethod! | U19-P2-21. Remaining payment method (U-04 payment.read, own order). |
paymentMethodVersion | Int! | Version of the choice, the expectedVersion of selectRemainingPaymentMethod (0 = never chosen). |
remainingSwitch | OrderRemainingSwitch | U28-P2-03. After the close: the COD -> ONLINE switch as computed now; null before the close. PAF (S9, DEC-PAF-09): Mua chung too (lockedCycleNos always empty; blockedReason all_cycles_locked = the order is at Đang đóng gói or later), Mua định kỳ per cycle. |
shortageCancellation | OrderShortageCancellation | The latest supply-shortage cancellation of this order, whole or partial (A-OD-07 AC08). |
shortageCancellations | [OrderShortageCancellation!]! | Every supply-shortage cancellation of this order, newest first (a partial shortage keeps the order alive). |
codReturn | OrderCodReturn | The RETURN case of this Order when its COD was refused (FU-OIFF01), else null. |
status | OrderStatus! | |
overpaymentVnd | VndAmount | Deposit + points value above the final price (offline case); null until close. |
payment | OrderPayment! | Own payment section. Requires payment.read (U-04, own). |
orderStatus | OrderAxis! | Stored order status (Word), the same values staff see. |
paymentStatus | PaymentAxis! | Stored payment status (Word, 8 values), the same values staff see. |
cancelReason | OrderAxisCancelReason | Why the order is Da huy (#377 D2, Word closed list, the values staff see); null unless orderStatus is CANCELLED. An unpaid order cancelled at the campaign close reads DEPOSIT_UNPAID_AT_CLOSE (G1S; DEPOSIT_TIMEOUT on older orders). |
addressVersion | Int! | U19-P2-11. Revision of the delivery address. PAF (DEC-PAF-03): the address no longer changes once the order exists. |
customerNote | String | U19-P2-11. Ghi chu cua khach entered at order time. |
rewards | [OrderReward!]! | The buyer's own reward entries; empty when the order has none yet. |
referrer | OrderReferrer | The credited referrer; null when nobody is credited (no link, window expired, own link, locked owner, not assigned yet). |
currentCycle | OrderCurrentCycle | The current cycle of a Mua định kỳ order; null for Mua chung and when no cycle is open (all delivered, stopped, cancelled). |
campaignClosedAt | DateTime | #412 O-37F: when the campaign closed (the close instant of its outcome); null before the close and for Mua định kỳ. |
invitedFriendCount | Int! | #412 G1-09: Người bạn mời of the buyer who joined this Deal. Always 0 for now (owner 28/10: the rule comes later). |
overpaymentCase | OrderOverpaymentCase | #412 U-64b: the offline overpayment case of this order; null when there is none. Requires payment.read (U-04, own). |
refunds | [OrderRefund!]! | Own refunds of this order, newest first; empty when nothing is refunded (#302). Requires payment.read (U-04, own). |
refundAccount | OrderRefundAccount | #412 G1-10: where the refund goes, from the latest refund request the buyer sent; null before one. Requires payment.read (U-04, own). |
requestOrderCancellation
Cancels an own order before the cutoff: a PLACED order requests its refund; an unpaid one is cancelled free (O3; conflict reason payment_pending while a deposit attempt is in flight). Requires order.request_cancel (U-03, OWN).
mutation · quyền: order.request_cancel
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | RequestOrderCancellationInput! |
Trả về RequestOrderCancellationResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The order id. |
version | Int! | The order version after the cancellation. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
orderId | ID! | |
orderStatus | OrderState! | |
settlement | String! | REFUND: a paid order's cancellation is refunded (forfeiture is another path). NONE: an unpaid order (O3), nothing was collected. |
refundRequestKey | String! | Tracking id of the refund request (an unpaid order answers NOTHING_TO_REFUND under the same key). |
refundHandoff | String! | REQUESTED (refund case opened or found, P3-10), DEFERRED (an original is unresolved; the consumer opens it later), NOTHING_TO_REFUND, or NOT_WIRED for an unwired port (GAP-84). Not a completed refund. |
estimatedRefund | OrderCancelRefundEstimate! |
settleFailedDeliveryCycle
#479 A. Operations settle a Mua định kỳ cycle whose delivery failed for good (DELIVERY_FAILED) and is not paid in full: the cycle is Đã hủy (giao hàng thất bại), earns no reward and its Pi-Point is not given back; past Được bỏ qua tối đa (skips + failed cycles) the whole order is Đã hủy with the deposit forfeited. Idempotent by requestId. Requires order.cancel; the buyer of the order is refused.
mutation · quyền: order.cancel
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SettleFailedDeliveryCycleInput! |
Trả về SettleFailedDeliveryCycleResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The order id. |
version | Int! | The order version after the settlement. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
orderId | ID! | |
cycleNo | Int! | |
outcome | FailedDeliveryOutcome! | |
skipsUsed | Int! | |
failedDeliveryCount | Int! | |
allowedSkips | Int! | |
orderStatus | OrderAxis! | The order axes after the settlement (CANCELLED + DEPOSIT_FORFEITED + DELIVERY_FAILED for ORDER_CANCELLED; PARTIAL_SUCCESS when the order just ended). |
paymentStatus | PaymentAxis! | |
cancelReason | OrderAxisCancelReason | |
excessDepositVnd | VndAmount! | Cọc dư opened by this settlement (kind FAILED_DELIVERY); 0 when the cycles still to deliver absorbed the deposit share. |
settledAt | DateTime! |
submitGroupOrder
Creates a DEPOSIT_PENDING order from an open own quote. Requires order.create.
mutation · quyền: order.create
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SubmitGroupOrderInput! |
Trả về SubmitOrderResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The order id. |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | start_deposit_payment: P3 redeems points (if any) then collects the deposit. |
paymentObligationId | ID | The DEPOSIT payment obligation recorded with the order (P3-01). |
order | Order! | |
priceChange | OrderPriceChange | Null when the order was written at the quoted price. Set: the order already holds the new price and deposit (same code, same depositDueAt); the App shows U-62, then pays this order with startDepositCheckout, never a second submitGroupOrder. |
submitRecurringOrder
Commits the quoted basket (its package and window) into one DEPOSIT_PENDING Mua định kỳ order; refused below Giá trị đơn tối thiểu or without the terms tick. G2S S4 (BR-DCD-02/05, DEC-FS27-MD-G1S-FLOW): the order is created first at the prices in force (priceChange when they moved); the basket becomes COMMITTED. Campaign no longer OPEN: conflict campaign_closed, no order (an order already waiting for its deposit is cancelled at the close, DEPOSIT_UNPAID_AT_CLOSE, TB-18). Requires order.create.
mutation · quyền: order.create
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SubmitRecurringOrderInput! |
Trả về SubmitRecurringOrderResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | The order id. |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | start_deposit_payment: P3 redeems points (if any) then collects the deposit. |
paymentObligationId | ID | The DEPOSIT payment obligation recorded with the order (P3-01). |
order | Order! | |
basketId | ID! | The basket this order committed (now COMMITTED). |
periods | [OrderPeriod!]! | |
priceChange | RecurringPriceChange | G2S S4: null when the order was written at the quoted prices. Set: the order already holds the new prices and deposit (same code, same depositDueAt); the App shows U-62, then pays this order with startDepositCheckout, never a second submitRecurringOrder. |