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.

object

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

object

Interface settings.

size
string

Payment UI size. Can be:

  • small: the least possible size of the payment UI. Use this value when the window size is strictly limited (dimensions: 620 x 630)
  • medium: recommended size. Use this value to display the payment UI in a lightbox (dimensions: 740 x 760)
  • large: the optimal size for displaying the payment UI in a new window or tab (dimensions: 820 x 840)
Enum: "large" "medium" "small"
theme
string [ 1 .. 20 ] characters
Default: "default"

Payment UI theme. Can be default, default_dark or dark.

Enum: "default" "default_dark" "dark"
version
string
Default: "desktop"

Device type. Can be desktop (default) or mobile.

Enum: "desktop" "mobile"
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.

object
mode
any

A user can only pay using their saved payment methods. Can be saved_accounts.

Value: "saved_accounts"
object
is_visible
required
boolean

Whether to hide the footer in the mobile version of the payment UI.

object
close_button
required
boolean
Default: false

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

license_url
string

Link to the EULA.

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.

Enum: "user_account" "without_purchase"
object

User account details.

object

History 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.

object

My payment accounts 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.

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.

422

Invalid item. Check that item exists, not turned off, deleted, and not free.

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