ShoppingateShoppingateDevelopers
shoppinggate.app ↗
Documentation
  • What is a Mini App
  • Why Mini Apps
  • API integration
  • SDK
  • Webview
  • Mini App architecture
  • Getting started
  • Choosing your path
  • Introduction
    • Introduction
    • Sign up & login
    • Dashboard & analytics
    • Mini-Programs
    • Submit & publish a version
    • App Binding
    • Privacy Settings
    • Allowed URL
    • Users & roles
    • Introduction
    • Become a Mini-App vendor
    • API keys
    • My Mini-Apps
    • Orders
    • Webhook
    • Deep-link config
    • Introduction
    • Install & log in
    • Create a project
    • The workspace
    • Preview & upload
  • Introduction
  • Configuration
  • Lifecycle
  • Routing & query
  • Host functions
  • orderPayment
  • Permissions
  • User info
  • Introduction
  • Configuration
  • SDK
  • Lifecycle
  • Routing & query
  • Host functions
  • orderPayment
  • Permissions
  • User info
  • Web app and shell calls
  • Look and feel
  • Overview
    • Verify user
    • Create order
    • Get order
    • Update order status
    • Charge an order
    • Send a notification
  • Subscriptions
    • Create a subscription
    • List subscriptions
    • Get a subscription
    • Update a subscription
    • Reschedule next charge
    • Change plan (upgrade)
    • Cancel a subscription
  • Webhooks
Endpoints

Update order status

Moves an order to its next state — for example processing, completed or cancelled. Every call carries your API key headers — see Overview.

POST/s2s/v1/orders/{orderUuid}/transitions
What it does

Move an order to a new state — accept it into processing, mark it completed, or cancel it. Enforced by the platform's state machine, so only transitions valid for a vendor actor are accepted. Vendor-allowed moves: created → cancelled, paid → processing, paid → cancelled, processing → completed, processing → cancelled. Not vendor-driven: created → paid (the payments service fires it on successful capture), and any transition to refunded (admin-only). Terminal states (completed, cancelled, refunded) accept no further outgoing transitions.

Auto-refund on vendor cancel. A vendor cancel from paid or processing also triggers a full automatic refund of order.total_amount, routed back to the original payment method (card → card gateway, wallet → wallet, tamara → tamara, split-paid → proportional). The response returns as soon as the state flip commits; the gateway leg settles asynchronously. Two webhooks fire on cancel-from-paid: order.cancelled (immediate) + order.refunded (when the gateway confirms settlement — usually seconds for wallet/Tamara, up to a few days for card). Cancel from created has no captured payment: only order.cancelled fires, no refund. Partial refunds on cancel are not supported — full only.

Path
orderUuidRequired
The order_uuid returned by create-order or received on a webhook.
to_stateRequired
Target state. One of paid, processing, completed, cancelled, refunded. Vendors cannot pick paid or refunded — those are gated to the payments service and admin respectively.
reason
Free-form string, ≤ 1000 chars — audit note captured on the transition row. Recommended for cancelled.
metadata
Free-form JSON object stored on the transition row for your own audit (e.g. { "internal_note": "kitchen accepted" }).
Request schema
{
  "to_state": <string, enum>,           // required — "paid" | "processing" | "completed" | "cancelled" | "refunded"
                                        //   vendor-driven set: "processing" | "completed" | "cancelled"
  "reason":   <string, ≤1000> | null,   // optional — audit note
  "metadata": <object> | null           // optional — free-form JSON stored on the transition row
}
Response
statusboolean
true on 200, false on every error envelope.
data.order_uuidstring, UUID
Echo of the path param.
data.status, data.statestring
The order's new state — same value as the to_state you sent. Both keys are returned for backwards compat; treat them as aliases.
data.updated_atstring, ISO 8601 UTC
Timestamp of this transition. Also emitted on the matching webhook (order.processing, order.completed, order.cancelled), so you can diff against your side.
error_code (on 4xx)string
Machine string for branching: TARGET_STATE_REQUIRED (400), ORDER_NOT_FOUND (404), INVALID_TRANSITION / TERMINAL_STATE / ORDER_UPDATED_ELSEWHERE (409). Do not parse the human message.
messagestring
Human string for logs — do not parse.
Response schema
// 200 OK — transition applied
{
  "status": true,
  "data": {
    "order_uuid": "0193b09d-9c8a-7af3-8b56-a51d6a3e4f10",
    "status":     "processing",   // the new state
    "state":      "processing",   // alias of status (backwards-compat)
    "updated_at": "2026-09-21T14:22:11.000Z"
  },
  "message": "OK"
}

// 400 Bad Request — required field missing or malformed
{
  "status":     false,
  "error_code": "TARGET_STATE_REQUIRED",
  "message":    "to_state is required"
}

// 404 Not Found — no such order for this mini-app
{
  "status":     false,
  "error_code": "ORDER_NOT_FOUND",
  "message":    "Order 0193b09d-… not found"
}

// 409 Conflict — state machine rejected the transition.
// error_code narrows the failure:
//   INVALID_TRANSITION       — not allowed from the current state for a vendor
//   TERMINAL_STATE           — the order is already in a terminal state
//   ORDER_UPDATED_ELSEWHERE  — optimistic-lock lost, refetch and retry
{
  "status":     false,
  "error_code": "INVALID_TRANSITION",
  "message":    "no transition from \"created\" to \"completed\""
}
Try it
Base URL
https://microservices.shoppinggate.app/mini-app-core/