Skip to content

API · shortage ​

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.

4 query · 2 mutation.

Query ​

opsOrderCancelPreview ​

Read-only preview of the Ops cancel for shortage of one order (button state and the Hệ quả list). Requires order.cancel.

query · quyền: order.cancel

Tham sốKiểuMặc địnhMô tả
orderIdID!

Trả về OpsOrderCancelPreview!

FieldKiểuMô tả
orderIdID!
versionIntThe version the apply must send as expectedVersion.
statusVersionIntU28-P2-07: the stamp of the order and cycle status axes; send it back as expectedStatusVersion (AC09).
stateOrderState
campaignTypeCampaignType
orderStatusOrderAxis
paymentStatusPaymentAxis
shippingStatusShippingStatusMua chung shipping status (a Mua định kỳ order keeps its shipping on each cycle).
eligibleBoolean!
blockerOpsCancelBlocker
policyRefString
reasons[OpsCancelReason!]!
committedCyclesInt
deliveredCyclesIntDelivered cycles are kept with the customer.
createdShipmentsInt!Shipments of the order that are still CREATED.
cyclesInShipment[Int!]!Mua định kỳ: the cycles in a shipment (they lock the cancel).
undeliveredUnitsInt
cancelledCycles[ShortageCycleUnits!]Mua định kỳ: the cycles that become Đã hủy, last cycle first, with their units.
cyclesCancelled[Int!]!Mua định kỳ: the cycle numbers that become Đã hủy (Chưa xử lý / Chờ đóng gói), ascending.
cyclesKept[OpsCancelKeptCycle!]!Mua định kỳ: the cycles kept as they are (AC04).
depositVndVndAmount
cashRefundVndVndAmountSame as refundAmountVnd (kept for older clients).
refundAmountVndVndAmountASSUME-01: the cash Operations refunds to the source (deposit + paid, undelivered cycles); null when not cancellable.
paymentStatusAfterPaymentAxisASSUME-01: the payment status after the cancel (WAITING_REFUND when something was paid).
cashScopeString
pointsUsedPointAmount
pointsValueVndVndAmount
pointsReturnedPointAmountPi-Point used by the order that goes back to the wallet automatically.
pendingRewardsCancelledPointAmountPending reward points of the order that are cancelled (Available points are kept).
availableRewardsKeptPointAmountU28-FU-API-B. Reward points of the order already Available: the cancel keeps them (null when not cancellable).
campaignStatusUnchangedBoolean!Always true: the campaign status does not change.
appliedRules[String!]!
remainingObligationString
refundProfileOpsCancelRefundProfile!

stockShortageCase ​

One case with its affected orders. Requires SHR-01 (GAP-83).

query · SDL không ghi quyền

Tham sốKiểuMặc địnhMô tả
idID!

Trả về StockShortageCase!

FieldKiểuMô tả
idID!
versionInt!
caseTypeStockShortageCaseType!
statusString!CONFIRMED: recorded together with the cancellations; immutable.
campaignIdID!
campaignProductIdID!
cycleNoInt
reasonString!Internal note; never shown to the buyer.
evidenceMediaIds[ID!]!
policyRefString!
orderCountInt!
recordedByID!
recordedAtDateTime!
orders[StockShortageCaseOrder!]!

stockShortageCases ​

Shortage cases, newest first. Requires ops.shortage read (SHR-01, GAP-83).

query · quyền: ops.shortage

Tham sốKiểuMặc địnhMô tả
campaignIdID
pageInt
pageSizeInt

Trả về StockShortageCasePage!

FieldKiểuMô tả
items[StockShortageCase!]!
totalInt!
pageInt!
pageSizeInt!

stockShortageImpact ​

Preview of affected orders (listed, or every LOCKED order of the product). Requires SHR-01.

query · SDL không ghi quyền

Tham sốKiểuMặc địnhMô tả
campaignProductIdID!
cycleNoInt
orderIds[ID!]

Trả về StockShortageImpact!

FieldKiểuMô tả
campaignIdID!
campaignTypeCampaignType!
campaignProductIdID!
cycleNoInt
totalInt!
selectionUnitString!PARTIAL_UNITS: the missing units are cancelled; the whole Order only when nothing is left to deliver (DEC-CP-SHORTAGE, AS-02).
orders[StockShortageOrderImpact!]!

Mutation ​

opsCancelOrder ​

Cancels the whole order for Hết hàng / thiếu hàng: idempotent by requestId, checks expectedVersion and eligibility at the server. Requires order.cancel.

mutation · quyền: order.cancel

Tham sốKiểuMặc địnhMô tả
inputOpsCancelOrderInput!

Trả về OpsCancelOrderResult!

FieldKiểuMô tả
aggregateIdID!The order id.
versionInt!The order version after the cancellation.
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextActiontrack_refund with the refund case id when one exists.
orderIdID!
orderStatusOrderState!
paymentStatusPaymentAxisASSUME-01: the payment status after the cancel.
caseIdID!
deliveredCyclesInt!
cancelledCycles[ShortageCycleUnits!]
appliedRules[String!]!
cashOpsCancelStep!
pointsOpsCancelStep!
pendingRewardsCancelledPointAmount!Pending reward points cancelled with the order.
refundProfileOpsCancelRefundProfile!

recordStockShortage ​

Records a shortage of a Mua chung product: cancels and refunds each listed order WHOLE (every unit still owed; a smaller quantity answers conflict whole_order_only, Word B048.R02). A Mua định kỳ product answers conflict whole_order_only: use opsCancelOrder (DH-US-08 AC04, U19-R34). Requires ops.shortage manage (SHR-02, GAP-83).

mutation · quyền: ops.shortage

Tham sốKiểuMặc địnhMô tả
inputRecordStockShortageInput!

Trả về RecordStockShortageResult!

FieldKiểuMô tả
aggregateIdID!The case id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
caseIdID!
caseStatusString!CONFIRMED (the case is born with its cancellations).
policyRefString!DEC-CP-SHORTAGE@2026-10-05 for every case (the whole-Order rows keep the AS-01/AS-02 rules in appliedRules).
cancelledOrders[StockShortageCancelledOrder!]!

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17