v2

latestOpenAPI 3.1.02026-08-07168434918.5 KB
Orders

Create Order

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.
post/v1/orders

Request body

player_idstring required

A unique identifier for the player making the purchase.

emailstring email

The player's email address, used as the billing email address.

discount_percentinteger

The percentage of discount applied to the order.

eligible_for_reward_pointsinteger

The number of reward points the order is eligible for.

eligible_for_loyalty_pointsinteger

The number of loyalty points the order is eligible for.

countrystring

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_lockedboolean

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.

ip_addressstring ipvanyaddress

The IP address of the player placing the order.

user_agentstring

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_urlstring

DEPRECATED: Use back_to_game_url or back_to_store_url instead. The URL to redirect the player after the purchase.

back_to_game_urlstring

The URL to redirect the player back to the game after the purchase. Supports formatting with {order_id}.

back_to_store_urlstring uri

The URL to redirect the player back to the store. Supports formatting with {order_id}.

payment_methods_enabledPublicPaymentMethod[]

The list of payment methods enabled for the order.

coupons_enabledboolean

Whether coupons are enabled for the order.

metadataobject

The metadata object structured as key-value pairs to store additional information about the order.

price_decimalnumber 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_preferredboolean

Prefer the specified currency and ignore country-specific pricing.

price_template_idstring nullable

The unique identifier for the price template.

platform'ios' | 'android' | 'other'

An enumeration.

expires_atinteger 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_codestring nullable

A coupon code to apply to the order on creation. Used for creator attribution when the code belongs to a creator program.

Example request

{
  "player_id": "r2d2-c3po",
  "items": [
    {
      "sku": "crystal"
    }
  ]
}

Response

Successful Response

order_idstring required

The unique ID of the created order.

checkout_urlstring uri required

The URL to redirect the player to complete the purchase.

Example response

{
  "order_id": "ord_XXXXXXX",
  "checkout_url": "https://pay.aghanim.com/order/ord_XXXXXXX"
}