> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a public checkout order

> Public storefront endpoint. Create an order from direct `items`, from the guest cart referenced by `X-Scalev-Guest-Token`, or from direct `items` while clearing the referenced guest cart after successful order creation. Direct checkout items are store-scoped and not blocked by storefront listing visibility.




## OpenAPI

````yaml https://api-openapi.scalev.com/specs/v3/openapi.json post /v3/stores/{store_id}/public/checkout
openapi: 3.0.3
info:
  title: Nexus Commerce API
  version: 3.0.0
  description: >
    Public v3 commerce contract for storefront, customer, and authenticated
    business

    commerce flows.


    This specification intentionally documents only the `/v3` namespace.

    Store-derived public storefront routes under
    `/v3/stores/{store_id}/public/*` require `X-Scalev-Storefront-Api-Key`.

    HTML Mode public page runtime routes under `/v3/pages/{page_unique_id}/*`
    require `X-Scalev-Page-Api-Key` and do not accept storefront public API
    keys.

    Storefront API requests made with `X-Scalev-Storefront-Api-Key`, page
    runtime requests made with `X-Scalev-Page-Api-Key`, and guest-cart requests
    made with `X-Scalev-Guest-Token` are browser client requests and use the
    direct client/IP rate limiter. Machine-authenticated business requests are
    rate-limited per API key or OAuth installation. Rate-limit metadata is
    returned in `X-Ratelimit-*` headers, and `429` responses may be plain text.
  license:
    name: Proprietary
servers:
  - url: https://api.scalev.com
    description: Production
security: []
tags:
  - name: Orders
    description: Authenticated business order management endpoints.
  - name: Storefront
    description: >-
      Public storefront catalog, guest cart, and guest checkout flows. All
      store-derived public storefront routes require
      `X-Scalev-Storefront-Api-Key`.
  - name: HTML Mode Pages
    description: >-
      Public HTML Mode runtime endpoints. These routes require
      `X-Scalev-Page-Api-Key` for the path page and reject storefront public API
      keys.
  - name: OAuth
    description: >-
      Public and machine OAuth token-management endpoints. The authorization
      code flow accepts the standard `scope` parameter; public OAuth clients may
      use PKCE with `token_endpoint_auth_method=none`, and metadata document
      clients may use `private_key_jwt`.
  - name: Identity
    description: Authenticated business identity context.
  - name: Business Users
    description: Authenticated business-user membership self-service endpoints.
  - name: Landing Pages
    description: >-
      Authenticated business landing page endpoints. The documented payloads
      focus on HTML Mode pages.
    externalDocs:
      description: >-
        Read the Landing Pages API guide before creating or publishing HTML Mode
        pages.
      url: https://docs.scalev.com/en/landing-pages-api
  - name: Analytics Setup
    description: >-
      Authenticated business analytics provider catalogs and pixel/container
      endpoints used when configuring landing page displays.
  - name: OAuth Billing
    description: OAuth billing runtime, refund, and developer finance endpoints.
  - name: Customer Auth
    description: Public customer authentication and password-reset endpoints.
  - name: Customer Account
    description: Authenticated customer profile endpoints.
  - name: Customer Cart
    description: Authenticated customer cart management endpoints.
  - name: Customer Checkout
    description: Authenticated customer checkout preparation and confirmation endpoints.
  - name: Customer Orders
    description: Authenticated customer order read endpoints.
  - name: Customer Subscriptions
    description: Authenticated customer subscription and subscription-item endpoints.
  - name: Customer Courses
    description: Authenticated customer digital course access and progress endpoints.
  - name: Discounts
    description: Discount-code validation and authenticated management endpoints.
  - name: Locations
    description: Authenticated business location lookup endpoints.
  - name: Business Stores
    description: >-
      Authenticated business store lookup endpoints. These routes use direct
      numeric Scalev store database IDs.
  - name: Storefront Setup
    description: >-
      Authenticated business setup endpoints for public storefront keys and CORS
      origins.
  - name: Shipping
    description: Authenticated business shipping lookup endpoints.
  - name: Business Products
    description: >-
      Authenticated business product, variant, taxonomy, and course management
      endpoints.
  - name: Business Bundles
    description: >-
      Authenticated business bundle, bundle-price-option, and related
      bundle-management endpoints.
  - name: Business Customers
    description: Authenticated business customer and customer-address management endpoints.
  - name: WABA
    description: >-
      Authenticated WhatsApp Business Account operations and related WABA
      resources.
  - name: WhatsApp Integrations
    description: Authenticated WhatsApp integration management endpoints.
paths:
  /v3/stores/{store_id}/public/checkout:
    parameters:
      - $ref: '#/components/parameters/StoreId'
      - $ref: '#/components/parameters/StorefrontPublicApiKey'
      - $ref: '#/components/parameters/StorefrontScalevGuestToken'
    post:
      tags:
        - Storefront
      summary: Create a public checkout order
      description: >
        Public storefront endpoint. Create an order from direct `items`, from
        the guest cart referenced by `X-Scalev-Guest-Token`, or from direct
        `items` while clearing the referenced guest cart after successful order
        creation. Direct checkout items are store-scoped and not blocked by
        storefront listing visibility.
      operationId: createPublicCheckout
      requestBody:
        $ref: '#/components/requestBodies/PublicCheckoutRequestBody'
      responses:
        '201':
          description: Public checkout order
          headers:
            X-Scalev-Guest-Token:
              description: >-
                Browser-safe guest cart token when the request used a guest
                cart.
              schema:
                type: string
                format: uuid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontPublicOrder'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
components:
  parameters:
    StoreId:
      name: store_id
      in: path
      required: true
      schema:
        type: string
      description: Store `unique_id`.
    StorefrontPublicApiKey:
      name: X-Scalev-Storefront-Api-Key
      in: header
      required: true
      schema:
        type: string
      description: >-
        Publishable storefront public API key for the target store. Page public
        API keys are not accepted on Storefront public routes.
    StorefrontScalevGuestToken:
      name: X-Scalev-Guest-Token
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: >-
        Browser-safe guest cart token returned by the first guest-cart response
        when no token is sent. Send it on later guest-cart and public checkout
        calls to keep the same cart after reloads.
  requestBodies:
    PublicCheckoutRequestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicCheckoutRequest'
  schemas:
    StorefrontPublicOrder:
      type: object
      required:
        - id
        - secret_slug
        - public_order_url
        - payment_url
        - order_id
        - status
        - payment_status
        - payment_method
        - gross_revenue
        - product_price
        - shipping_cost
        - pg_payment_info
        - orderlines
      properties:
        id:
          $ref: '#/components/schemas/OrderPrimaryKey'
        business:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            username:
              type: string
              nullable: true
            contact_email:
              type: string
              nullable: true
            aff_code:
              type: string
              nullable: true
            logo:
              type: string
              nullable: true
        secret_slug:
          type: string
        public_order_url:
          type: string
          format: uri
          nullable: true
        payment_url:
          type: string
          format: uri
          nullable: true
        order_id:
          type: string
        status:
          type: string
        payment_status:
          type: string
          nullable: true
        is_probably_spam:
          type: boolean
          nullable: true
        draft_time:
          type: string
          format: date-time
          nullable: true
        paid_time:
          type: string
          format: date-time
          nullable: true
        transfer_time:
          type: string
          format: date-time
          nullable: true
        transferproof_url:
          type: string
          nullable: true
        handler_phone:
          type: string
          nullable: true
        chat_message:
          type: string
          nullable: true
        customer_id:
          type: integer
          nullable: true
        discount_code_code:
          type: string
          nullable: true
        page:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            slug:
              type: string
              nullable: true
        gross_revenue:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        product_price:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        product_discount:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        shipping_cost:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        shipping_discount:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        other_income:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        other_income_name:
          type: string
          nullable: true
        unique_code_discount:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        discount_code_discount:
          $ref: '#/components/schemas/StorefrontMoneyValue'
        pg_payment_info:
          type: object
          additionalProperties: true
          description: >
            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:
          type: array
          items:
            type: object
            additionalProperties: true
        payment_method:
          type: string
          example: bank_transfer
        sub_payment_method:
          type: string
          nullable: true
        epayment_provider:
          type: string
          nullable: true
          description: >-
            E-payment provider. Possible values include `xendit`, `duitku`,
            `midtrans`, `ipaymu`, and `singapay`.
        payment_account_holder:
          type: string
          nullable: true
        payment_account_number:
          type: string
          nullable: true
        shipment_status_history:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              timestamp_source:
                type: string
                nullable: true
              status:
                type: string
                nullable: true
              description:
                type: string
                nullable: true
        shipment_receipt:
          type: string
          nullable: true
        courier_service:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            name:
              type: string
              nullable: true
            courier:
              type: object
              nullable: true
              additionalProperties: false
              properties:
                name:
                  type: string
                  nullable: true
        variants:
          type: object
          additionalProperties: true
        bundle_price_options:
          type: object
          additionalProperties: true
        orderlines:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              quantity:
                type: integer
              product_name:
                type: string
                nullable: true
              item_type:
                type: string
                nullable: true
              variant_option1_value:
                type: string
                nullable: true
              variant_option2_value:
                type: string
                nullable: true
              variant_option3_value:
                type: string
                nullable: true
              variant_price:
                $ref: '#/components/schemas/StorefrontMoneyValue'
        payment_expiration_at:
          type: string
          format: date-time
          nullable: true
        store_custom_domain:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            full_url:
              type: string
              nullable: true
        store:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            name:
              type: string
              nullable: true
            payment_accounts:
              type: array
              items:
                type: object
                additionalProperties: false
                properties:
                  id:
                    type: integer
                  account_holder:
                    type: string
                    nullable: true
                  account_number:
                    type: string
                    nullable: true
                  method:
                    type: string
                    nullable: true
                  financial_entity:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                        nullable: true
                      code:
                        type: string
                        nullable: true
                    additionalProperties: false
            custom_domain:
              type: object
              nullable: true
              additionalProperties: false
              properties:
                full_url:
                  type: string
                  nullable: true
            days_of_payment_processing:
              type: integer
              nullable: true
            is_auto_expire:
              type: boolean
              nullable: true
            auto_expire_days:
              type: integer
              nullable: true
            is_show_whatsapp:
              type: boolean
              nullable: true
            is_show_download_invoice:
              type: boolean
              nullable: true
        destination_address:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            name:
              type: string
              nullable: true
            phone:
              type: string
              nullable: true
            address:
              type: string
              nullable: true
            subdistrict:
              type: string
              nullable: true
            city:
              type: string
              nullable: true
            province:
              type: string
              nullable: true
        customer:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            email:
              type: string
              nullable: true
      additionalProperties: true
    PublicCheckoutRequest:
      type: object
      required:
        - customer_name
        - customer_email
        - payment_method
      properties:
        items:
          type: array
          description: >
            Optional direct item source. If supplied, direct items create the
            order. If `X-Scalev-Guest-Token` references a guest cart, that cart
            is cleared after successful order creation. If omitted, the guest
            cart referenced by `X-Scalev-Guest-Token` creates the order.
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/StorefrontCheckoutItem'
        customer_name:
          type: string
          maxLength: 200
        customer_email:
          type: string
          format: email
          maxLength: 254
        customer_phone:
          type: string
          maxLength: 20
          nullable: true
        shipping_address:
          type: string
          nullable: true
        shipping_province:
          type: string
          nullable: true
        shipping_city:
          type: string
          nullable: true
        shipping_subdistrict:
          type: string
          nullable: true
        shipping_postal_code:
          type: string
          nullable: true
        shipping_location_id:
          oneOf:
            - type: integer
            - type: string
        address:
          type: string
          nullable: true
          deprecated: true
        location:
          type: string
          nullable: true
          deprecated: true
        location_id:
          oneOf:
            - type: integer
            - type: string
        postal_code:
          type: string
          nullable: true
          deprecated: true
        payment_method:
          type: string
          description: Storefront payment method code selected by the buyer.
          example: bank_transfer
        sub_payment_method:
          type: string
          nullable: true
        courier_service_id:
          type: integer
          nullable: true
        warehouse_unique_id:
          type: string
          nullable: true
        courier_aggregator_code:
          type: string
          nullable: true
        discount_code_code:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
      additionalProperties: false
    OrderPrimaryKey:
      description: >-
        Canonical UUIDv7 order primary key returned by the partitioned orders
        table.
      type: string
      format: uuid
    StorefrontMoneyValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
    ApiErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/FlexibleValue'
        error_code:
          type: string
        message:
          type: string
          description: Error-only human-readable detail.
        errors:
          $ref: '#/components/schemas/FlexibleValue'
      additionalProperties: false
    StorefrontCheckoutItem:
      oneOf:
        - $ref: '#/components/schemas/StorefrontCheckoutVariantItem'
        - $ref: '#/components/schemas/StorefrontCheckoutBundlePriceOptionItem'
      discriminator:
        propertyName: type
        mapping:
          variant:
            $ref: '#/components/schemas/StorefrontCheckoutVariantItem'
          bundle_price_option:
            $ref: '#/components/schemas/StorefrontCheckoutBundlePriceOptionItem'
    FlexibleValue:
      oneOf:
        - $ref: '#/components/schemas/FlexibleObject'
        - type: array
          items: {}
        - type: string
        - type: number
        - type: boolean
    StorefrontCheckoutVariantItem:
      type: object
      required:
        - type
        - variant_id
        - quantity
      properties:
        type:
          type: string
          enum:
            - variant
        variant_id:
          type: integer
          minimum: 1
        quantity:
          type: integer
          minimum: 1
          maximum: 100
      additionalProperties: false
    StorefrontCheckoutBundlePriceOptionItem:
      type: object
      required:
        - type
        - bundle_price_option_id
        - quantity
      properties:
        type:
          type: string
          enum:
            - bundle_price_option
        bundle_price_option_id:
          type: integer
          minimum: 1
          description: Bundle price option ID from the storefront catalog.
        quantity:
          type: integer
          minimum: 1
          maximum: 100
      additionalProperties: false
    FlexibleObject:
      type: object
      additionalProperties: true
  responses:
    BadRequestResponse:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    NotFoundResponse:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'

````