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.
Request body
A unique identifier for the player making the purchase.
The player's email address, used as the billing email address.
The percentage of discount applied to the order.
The number of reward points the order is eligible for.
The number of loyalty points the order is eligible for.
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.
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.
The IP address of the player placing the order.
The User-Agent string representing the player's browser properties, including browser type, version, and operating system
Language codes according to ISO 639-1.
DEPRECATED: Use back_to_game_url or back_to_store_url instead. The URL to redirect the player after the purchase.
The URL to redirect the player back to the game after the purchase. Supports formatting with {order_id}.
The URL to redirect the player back to the store. Supports formatting with {order_id}.
The list of payment methods enabled for the order.
Whether coupons are enabled for the order.
Whether the player is allowed to save a payment method (card, wallet) for future purchases on this order. Enabled by default.
The metadata object structured as key-value pairs to store additional information about the order.
Prefer the specified currency and ignore country-specific pricing.
The unique identifier for the price template.
Order expiration date in Unix epoch time. If not provided, defaults to 3 days from creation. Orders cannot be paid after this date.
A coupon code to apply to the order on creation. Used for creator attribution when the code belongs to a creator program.
Example request
{
"items": [
{
"sku": "crystal"
}
],
"player_id": "r2d2-c3po"
}Response
Successful Response
The unique ID of the created order.
The URL to redirect the player to complete the purchase.
The amount the player pays, in minor currency units.
Example response
{
"amount": 999,
"checkout_url": "https://pay.aghanim.com/order/ord_XXXXXXX",
"currency": "USD",
"order_id": "ord_XXXXXXX"
}