Xsolla-logo

Create order with particular free cart

post/v2/project/{project_id}/free/cart/{cart_id}

Creates an order with all items from the particular free cart. The created order will get a done order status.

SecurityAuthForCart
Request
path Parameters
project_id
required
integer

Project ID.

Example: 44056
cart_id
required
string

Cart ID.

Example: custom_id
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.

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

Free order was successfully created.

422

Invalid cart. Check that cart exists, not empty, and all items in it are not free.

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