Xsolla-logo

Create order with specified item

post/v2/project/{project_id}/payment/item/{item_sku}

Creates an order with a specified item. The created order will get a new order status.

To open the payment UI in a new window, use the following link: https://secure.xsolla.com/paystation2/?access_token=ACCESS_TOKEN, where ACCESS_TOKEN is the received token.

For testing purposes, use this URL: https://sandbox-secure.xsolla.com/paystation2/?access_token=ACCESS_TOKEN.

SecurityXsollaLoginUserJWT
Request
path Parameters
project_id
required
integer

Project ID.

Example: 44056
item_sku
required
string

Item SKU.

Example: booster_mega_1
Request Body schema: application/json
currency
string

The currency which prices are displayed in (USD by default). Three-letter currency code per ISO 4217.

locale
string

Response language.

sandbox
boolean
Default: false

Creates an order in the sandbox mode. The option is available for those users who are specified in the list of company users.

quantity
integer >= 1
Default: 1

Item quantity.

promo_code
string

Redeems a code of a promo code promotion with payment.

object

Settings for configuring payment process and the payment UI for a user.

object

Interface settings.

theme
string
Default: "63295a9a2e47fab76f7708e1"

Payment UI theme. Can be 63295a9a2e47fab76f7708e1 for the light theme (default) or 63295aab2e47fab76f7708e3 for the dark theme. You can also create a custom theme and pass its ID in this parameter.

Enum: "63295a9a2e47fab76f7708e1" "63295aab2e47fab76f7708e3"
object

Interface settings for the desktop version.

object

Header settings.

is_visible
boolean

Whether to show the header in the payment UI.

visible_logo
boolean

If true, the header will show your logo (first provide the image to your account manager).

visible_name
boolean

Whether to show the project name in the header.

visible_purchase
boolean
Default: true

Whether to show the purchase description (purchase.description.value) in the header. true by default.

type
string
Default: "normal"

How to show the header. Can be compact (hides project name and user ID) or normal (default).

Enum: "compact" "normal"
close_button
boolean
Default: false

Whether to show a Close button in Pay Station desktop. The button closes Pay Station and redirects the user to the URL specified in the settings.return_url parameter. false by default.

mode
string

Interface mode in Pay Station. Can be user_account only: The header contains only the account navigation menu, and the user cannot select a product or make a payment. This mode is only available on the desktop.

Value: "user_account"
object

User account details.

object

My payment accounts submenu.

enable
required
boolean
Default: false

Whether to show the submenu. false by default.

object
Default: "Page **My account**.\n"
enable
required
boolean
Default: false

Whether to show the submenu. false by default.

order
required
integer >= 1

Position of the submenu in the menu.

object

Manage subscriptions submenu.

enable
required
boolean
Default: false

Whether to show the submenu. false by default.

order
required
integer >= 1

Position of the submenu in the menu.

payment_method
integer >= 1

Payment method ID.

return_url
string <uri> <= 1000 characters

Page to redirect the user to after payment. Parameters user_id, foreigninvoice, invoice_id and status will be automatically added to the link.

object
redirect_conditions
string

Payment status triggering user redirect to the return URL.

Enum: "none" "successful" "successful_or_canceled" "any"
delay
integer

Delay after which the user will be automatically redirected to the return URL.

status_for_manual_redirection
string

Payment status triggering the display of a button clicking which redirects the user to the return URL.

Enum: "none" "vc" "successful" "successful_or_canceled" "any"
redirect_button_caption
string

Localized redirect button captions.

custom_parameters
object [ 1 .. 200 ] properties

Project specific parameters.

object

User shipping data.

country
required
string^[A-Z]{2}$
address1
required
string
address2
required
string
address3
required
string
state
required
string
first_name
required
string
last_name
required
string
city
required
string
postal_code
required
string
region
required
string
phone
required
string^\+
comment
string
email
string
object

Selected shipping method. The format depends on the integrated delivery provider.

property name*
additional property
any
Responses
200

Order was successfully created.

404

Item or coupon not found. Make sure the used data is correct.

422

Invalid error.

Request samples
application/json
{
  • "sandbox": true,
  • "quantity": 5,
  • "promo_code": "discount_code",
  • "settings": {
    },
  • "custom_parameters": {
    }
}
Response samples
application/json
{
  • "order_id": 641,
  • "token": "f4puMEFFDZcx9nv5HoNHIkPe9qghvBQo"
}