---
title: "Create Order"
method: POST
path: "/v1/orders"
tags: ["Orders"]
---

# Create Order

`POST /v1/orders`

Creates an order for the specified `player_id` and list of `items`.

The response includes a `checkout_url` that the player should be
redirected to in order to complete the purchase.

You can optionally provide:
- `back_to_game_url`: A universal deep link that appears as a "Back to Game"
  button on the checkout page. Typically, this should open the game client.
- `back_to_store_url`: A web URL that appears as a "Back to Store"
  button on the checkout page. Usually links to your store website.

## Request body

- OrderCreate
  - `items` OrderItemCreate[], required — A list of items the player wants to purchase.
    - `sku` string, required — Stock Keeping Unit (SKU) identifier.
    - `name` string, nullable — The name of the item.
    - `description` string, nullable — The description of the item
    - `image_url` union — The URL of the image for the item
      - string, uri
      - ''
    - `quantity` integer, nullable — The quantity of the item.
    - `store_key` string, nullable — The key of the store where order taking store item for discount and benefits.
    - `selected_plan_key` string, nullable — The key of the subscription plan to pre-select on the checkout page. Only applicable to subscription SKUs.
  - `player_id` string, required — A unique identifier for the player making the purchase.
  - `email` string, email — The player's email address, used as the billing email address.
  - `player_info` PlayerInfo
    - `attributes` PlayerAttributes
      - `level` integer
      - `platform` 'any' | 'ios' | 'android' | 'other'
      - `marketplace` 'none' | 'app_store' | 'google_play' | 'aghanim' | 'other' | 'one_store' | 'galaxy_store'
      - `device_type` 'Apple' | 'Android' | 'Unknown' | 'Other'
      - `tags` PlayerTag[]
      - `soft_currency_amount` integer
      - `hard_currency_amount` integer
      - `appsflyer_id` string
      - `appsflyer_app_id` string
      - `appsflyer_meta` object
      - `appsflyer_event_params` object
      - `appsflyer_customer_user_id` string
      - `adjust_device_id` object
      - `adjust_adid` string
      - `adjust_app_token` string
      - `adjust_authorization_token` string
      - `adjust_purchase_event_token` string
      - `adjust_callback_params` object
      - `adjust_partner_params` object
      - `singular_device_id` object
      - `singular_app_id` string
      - `devtodev_appid` string
      - `devtodev_apikey` string
      - `devtodev_device_id` DevtodevDeviceId
        - `deviceId` string
        - `devtodevId` integer
        - `userId` string
        - `advertisingId` string
      - `ga4_client_id` string — GA4 web `client_id` from the `_ga` cookie.
      - `ga4firebase_app_instance_id` string — Firebase mobile `app_instance_id` from the SDK.
      - `ga4_user_id` string — Partner-set GA4 cross-device `user_id`; falls back to `User.player_id` when unset.
    - `custom_attributes` object — The player's custom attributes.
    - `name` string — The player's name.
    - `avatar_url` string — The player's avatar URL.
  - `discount_percent` integer — The percentage of discount applied to the order.
  - `eligible_for_reward_points` integer — The number of reward points the order is eligible for.
  - `eligible_for_loyalty_points` integer — The number of loyalty points the order is eligible for.
  - `country` string — The two-letter country code (ISO 3166-1 alpha-2) for the order. If not provided, the country will be determined by the IP address of the player when the checkout page is opened.
  - `country_locked` boolean — Whether the order country is locked after creation. If `true`, the player cannot pay from a different country than the one initially specified in the `country` field.
  - `redirect_settings` RedirectSettings
    - `mode` 'no_redirect' | 'immediate' | 'delayed' — An enumeration.
    - `delay_seconds` number — The redirect delay in seconds when `mode` is set to `delayed`. If not specified, defaults to 5 seconds.
    - `target` 'game' | 'store' — An enumeration.
  - `ui_settings` UISettings
    - `mode` 'dark' | 'light' | 'auto' — An enumeration.
    - `show_player_info` boolean — Whether to display player information on checkout page
  - `ip_address` string, ipvanyaddress — The IP address of the player placing the order.
  - `user_agent` string — The User-Agent string representing the player's browser properties, including browser type, version, and operating system
  - `locale` 'cs' | 'de' | 'en' | 'es' | 'fr' | 'fr-CA' | 'hi' | 'id' | 'it' | 'ja' | 'ko' | 'ms' | 'nl' | 'no' | 'pl' | 'pt' | 'pt-BR' | 'ru' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh-Hant' — Language codes according to ISO 639-1.
  - `return_url` string — DEPRECATED: Use `back_to_game_url` or `back_to_store_url` instead. The URL to redirect the player after the purchase.
  - `back_to_game_url` string — The URL to redirect the player back to the game after the purchase. Supports formatting with {order_id}.
  - `back_to_store_url` string, uri — The URL to redirect the player back to the store. Supports formatting with {order_id}.
  - `payment_methods_enabled` PublicPaymentMethod[] — The list of payment methods enabled for the order.
  - `coupons_enabled` boolean — Whether coupons are enabled for the order.
  - `metadata` object — The metadata object structured as key-value pairs to store additional information about the order.
  - `price_decimal` number, nullable — Order price in decimal units. Overrides item price if set.
  - `currency` 'USD' | 'EUR' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XCG' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWG' | 'ZWL' | 'RP' | 'VC'
  - `currency_preferred` boolean — Prefer the specified currency and ignore country-specific pricing.
  - `price_template_id` string, nullable — The unique identifier for the price template.
  - `platform` 'ios' | 'android' | 'other' — An enumeration.
  - `expires_at` integer, nullable — Order expiration date in Unix epoch time. If not provided, defaults to 3 days from creation. Orders cannot be paid after this date.
  - `coupon_code` string, nullable — A coupon code to apply to the order on creation. Used for creator attribution when the code belongs to a creator program.
  - `creator_settings` CreatorSettings
    - `attribution_mode` 'persistent' | 'one_time' — An enumeration.

## Response `201`

Successful Response

- OrderCreateResponse
  - `order_id` string, required — The unique ID of the created order.
  - `checkout_url` string, uri, required — The URL to redirect the player to complete the purchase.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/aghanim/apis/aghanim-server-to-server-api.md) · [All operations](https://skmtc.net/aghanim/apis/aghanim-server-to-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aghanim/aghanim-server-to-server-api/versions/0c1b4ac1865b/schema)
