---
title: "Create an HTML Mode public order"
method: POST
path: "/v3/pages/{page_unique_id}/orders"
tags: ["HTML Mode Pages"]
---

# Create an HTML Mode public order

`POST /v3/pages/{page_unique_id}/orders`

Page-scoped public endpoint for HTML Mode `Scalev.checkout.createOrder`. This route accepts HTML Mode order payloads with `customer`, `destination`, `items`, and `shipping_option`, requires `X-Scalev-Page-Api-Key`, and does not accept storefront public API keys. The page and store are resolved from the path and page API key; any `page_unique_id` or `store_unique_id` values supplied in the JSON body are ignored. Orders created as `payment_link` start with zero Other Income and zero Service Fee. The hosted Payment Link quotes the Store's frozen Other Income and Service Fee after the buyer chooses a concrete payment method.

## Request body

- PagePublicOrderCreateRequest — HTML Mode public order payload. Use `customer`, `destination`, and one combined `items` list for checkout details. Pass the chosen option returned by `shippingOptions` as `shipping_option`. The API ignores any supplied `page_unique_id` or `store_unique_id` and uses the path page plus the authenticated page API key instead.
  - `form` object, nullable
  - `customer` PagePublicCheckoutCustomer — Buyer contact details submitted by an HTML Mode page.
    - `name` string, required
    - `phone` string, required
    - `email` string, email, nullable
  - `destination` PagePublicCheckoutDestination — Buyer destination submitted by an HTML Mode page.
    - `address` string, nullable
    - `subdistrict_id` union — Destination subdistrict ID.
      - integer
      - string
    - `postal_code` string, nullable
  - `items` PagePublicCheckoutItem[]
    - `type` 'product' | 'bundle', required
    - `variant_unique_id` string — Required when `type` is `product`.
    - `bundle_price_option_unique_id` string — Required when `type` is `bundle`.
    - `quantity` integer, required
  - `payment_method` string — Public order payment method code. Required for normal checkout. May be omitted when the store uses strict two-step Payment Link checkout; Scalev resolves it to `payment_link`. Virtual Accounts use flat method codes such as `va_bca`.
  - `payment_account_unique_id` string, nullable
  - `shipping_option` StorefrontShippingOption
    - `courier_service_id` integer, required
    - `courier_code` string, required
    - `service_code` string, required
    - `name` string, required
    - `cost` union, required
      - string, nullable
      - number
    - `etd` string, nullable, required — Estimated delivery time returned by the courier integration.
    - `is_cod` boolean, required
    - `warehouse_unique_id` string, required
    - `courier_aggregator_code` string, nullable, required
    - `logo_url` string, uri, nullable
  - `product_discount` union
    - string, nullable
    - number
  - `shipping_discount` union
    - string, nullable
    - number
  - `other_income` union
    - string, nullable
    - number
  - `other_income_name` string, nullable — Optional compatibility label for direct checkout. It is ignored during `payment_link` order creation; the hosted link supplies the frozen Store label with the concrete-method quote.
  - `discount_code_code` string, nullable
  - `is_post_payment_redirect_enabled` boolean — Optional creation-only override for the page post-payment redirect. This field accepts only the native JSON booleans `true` and `false`; `null`, strings, numbers, arrays, and objects are rejected. Omit it to inherit the page setting. Set it to `false` to force Scalev's hosted success flow for this order and clear the redirect snapshot. Set it to `true` together with `post_payment_redirect_url` to replace the page setting for this order.
  - `post_payment_redirect_url` string, uri — Absolute HTTPS destination required when `is_post_payment_redirect_enabled` is `true`. HTTP is accepted only for loopback development hosts outside production. Supplying this field without `is_post_payment_redirect_enabled` does not enable an order override; the page setting is inherited. The canonical value is snapshotted at creation and cannot be changed by order updates.
  - `notes` string, nullable
  - `transferproof_url` string, nullable
  - `cart_id` union
    - integer
    - string
  - `recaptcha_token` string, nullable — Runtime-generated form reCAPTCHA token.
  - `event_source_url` string, uri, nullable
  - `fbc` string, nullable
  - `fbp` string, nullable
  - `ttclid` string, nullable
  - `gclid` string, nullable
  - `ttp` string, nullable
  - `kwai_clickid` string, nullable
  - `utm_source` string, nullable
  - `utm_medium` string, nullable
  - `utm_campaign` string, nullable
  - `utm_content` string, nullable
  - `utm_term` string, nullable
  - `affiliate_code` string, nullable
  - `channel_unique_id` string, nullable
  - `metadata` object, nullable

## Response `201`

Flat HTML Mode public order object.

- StorefrontPublicOrder
  - `id` string, uuid, required — Canonical UUIDv7 order primary key returned by the partitioned orders table.
  - `business` object, nullable
    - `username` string, nullable
    - `contact_email` string, nullable
    - `aff_code` string, nullable
    - `logo` string, nullable
  - `secret_slug` string, required
  - `public_order_url` string, uri, nullable, required
  - `payment_url` string, uri, nullable, required
  - `order_id` string, required
  - `status` string, required
  - `payment_status` string, nullable, required — Buyer-facing payment status. A settled payment is exposed as `paid`; this field never returns `settled`.
  - `post_payment_redirect_url` string, uri — Canonical post-payment destination exposed only after a buyer-paid outcome (internal payment status `paid` or `settled`) when a valid redirect snapshot exists. Omitted before payment and when Scalev's hosted success flow applies.
  - `is_probably_spam` boolean, nullable
  - `draft_time` string, date-time, nullable
  - `paid_time` string, date-time, nullable
  - `transfer_time` string, date-time, nullable
  - `transferproof_url` string, nullable
  - `handler_phone` string, nullable
  - `chat_message` string, nullable
  - `customer_id` integer, nullable
  - `discount_code_code` string, nullable
  - `page` object, nullable
    - `slug` string, nullable
  - `gross_revenue` union, required
    - string, nullable
    - number
  - `product_price` union, required
    - string, nullable
    - number
  - `product_discount` union
    - string, nullable
    - number
  - `shipping_cost` union, required
    - string, nullable
    - number
  - `shipping_discount` union
    - string, nullable
    - number
  - `other_income` union
    - string, nullable
    - number
  - `payment_link_income` union
    - string, nullable
    - number
  - `other_income_name` string, nullable — Other Income label. For `payment_link`, the winning concrete Payment Request's frozen Store label is reconciled after payment.
  - `unique_code_discount` union
    - string, nullable
    - number
  - `discount_code_discount` union
    - string, nullable
    - number
  - `pg_payment_info` object, required — Buyer-facing payment gateway payload. Manual methods such as `bank_transfer` and `cod` can return an empty object. Virtual account methods expose provider reference and account details under the provider's `payment_method` object. QRIS responses expose QR data or a QR image payload. E-wallet, card, and invoice methods may expose provider actions or hosted provider URLs. SingaPay payments use normalized keys such as `payment_url`, `deeplink_url`, `qr_string`, `qr_image_url`, `va_number`, and `va_name`.
  - `status_history` object[]
  - `payment_method` string, required
  - `epayment_provider` string, nullable — E-payment provider. `xendit` is the current/managed Xendit provider; `xendit_legacy` is the owned legacy Xendit provider. Other possible values include `duitku`, `midtrans`, `durianpay`, and `singapay`.
  - `payment_account_holder` string, nullable
  - `payment_account_number` string, nullable
  - `shipment_status_history` object[]
    - `timestamp_source` string, nullable
    - `status` string, nullable
    - `description` string, nullable
  - `shipment_receipt` string, nullable
  - `courier_service` object, nullable
    - `name` string, nullable
    - `courier` object, nullable
      - `name` string, nullable
  - `variants` object
  - `bundle_price_options` object
  - `orderlines` object[], required
    - `quantity` integer
    - `product_name` string, nullable
    - `item_type` string, nullable
    - `variant_option1_value` string, nullable
    - `variant_option2_value` string, nullable
    - `variant_option3_value` string, nullable
    - `variant_price` union
      - string, nullable
      - number
  - `payment_expiration_at` string, date-time, nullable
  - `store_custom_domain` object, nullable
    - `full_url` string, nullable
  - `store` object, nullable
    - `name` string, nullable
    - `payment_accounts` object[]
      - `id` integer
      - `account_holder` string, nullable
      - `account_number` string, nullable
      - `method` string, nullable
      - `financial_entity` object, nullable
        - `id` integer
        - `code` string, nullable
        - `name` string, nullable
    - `custom_domain` object, nullable
      - `full_url` string, nullable
    - `days_of_payment_processing` integer, nullable
    - `is_auto_expire` boolean, nullable
    - `auto_expire_days` integer, nullable
    - `is_show_whatsapp` boolean, nullable
    - `is_show_download_invoice` boolean, nullable
  - `destination_address` object, nullable
    - `name` string, nullable
    - `phone` string, nullable
    - `address` string, nullable
    - `subdistrict` string, nullable
    - `city` string, nullable
    - `province` string, nullable
  - `customer` object, nullable
    - `email` string, nullable

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/scalev/apis/nexus-commerce-api.md) · [All operations](https://skmtc.net/scalev/apis/nexus-commerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scalev/nexus-commerce-api/versions/4354959d76dc/schema)
