Skip to Content
defold-typescript libraries
defold (official)

defold/extension-xsolla/shop

Functions to use the Xsolla Shop Builder API.

  • GitHub: defold/extension-xsolla — pinned to 1.2.0 (released while Defold 1.10.2 was current)
    1. Pick a release from defold/extension-xsolla releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as shop from "shop"

Functions

shop.cancel(token: table)

Cancel a cancellation token

Parameters

  • token: table — The cancellation token

shop.cancellation_token(): table

Create a cancellation token

Returns

  • token: table — A cancellation token

shop.set_bearer_token(token: string)

Set a bearer token

Parameters

  • token: string — The bearer token

shop.set_username_password(username: string, password: string)

Set a username and password for basic authentication

Parameters

  • username: string — The username
  • password: string — The password

shop.set_merchant_auth(merchant_id: string, api_key: string)

Set merchant id and api key for use with 'basicMerchantAuth' authentication

Parameters

  • merchant_id: string — The merchant id
  • api_key: string — The API key

shop.set_auth_for_cart(authorization_id: string, user: string)

Set authorization when using 'AuthForCart' authentication

Parameters

  • authorization_id: string — Unique authorization id
  • user: string — The user email

shop.sync(fn: function, cancellation_token: table)

Run code within a coroutine.

Parameters

  • fn: function — The function to run
  • cancellation_token: table — Optional cancellation token

shop.get_bundle_list(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get list of bundles

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_bundle(project_id: integer, sku: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get specified bundle

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • sku: string — Bundle SKU.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_bundle_list_in_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get list of bundles by specified group

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • external_id: string — Group external ID.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_cart_by_id(project_id: integer, cart_id: string, currency: string, locale: string, callback: function, retry_policy: table, cancellation_token: table)

Get cart by cart ID

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • currency: string — The item price currency displayed in the cart. Three-letter currency code per ISO 4217. Check the documentation for detailed information about currencies supported by Xsolla.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_user_cart(project_id: integer, currency: string, locale: string, callback: function, retry_policy: table, cancellation_token: table)

Get current user's cart

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • currency: string — The item price currency displayed in the cart. Three-letter currency code per ISO 4217. Check the documentation for detailed information about currencies supported by Xsolla.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.cart_clear_by_id(project_id: integer, cart_id: string, callback: function, retry_policy: table, cancellation_token: table)

Delete all cart items by cart ID

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.cart_clear(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Delete all cart items from current cart

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.cart_fill(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Fill cart with items

{
  items =
  {
    {
      sku = "com.xsolla.booster_mega_1",
      quantity = 123,
    },
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.cart_fill_by_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Fill specific cart with items

{
  items =
  {
    {
      sku = "com.xsolla.booster_mega_1",
      quantity = 123,
    },
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.put_item_by_cart_id(project_id: integer, cart_id: string, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Update cart item by cart ID

{
  quantity = 123.456,
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • item_sku: string — Item SKU.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.delete_item_by_cart_id(project_id: integer, cart_id: string, item_sku: string, callback: function, retry_policy: table, cancellation_token: table)

Delete cart item by cart ID

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • item_sku: string — Item SKU.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.put_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Update cart item from current cart

{
  quantity = 123.456,
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.delete_item(project_id: integer, item_sku: string, callback: function, retry_policy: table, cancellation_token: table)

Delete cart item from current cart

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_order_by_cart_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with all items from particular cart

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_order(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with all items from current cart

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_order_with_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with specified item

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  quantity = 123,
  promo_code = "Redeems a code of a promo code promotion with payment.",
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_free_order(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with free cart

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_free_order_by_cart_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with particular free cart

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • cart_id: string — Cart ID.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_free_order_with_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with specified free item

{
  currency = "Order price currency. Three-letter currency code per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Check the documentation for detailed information about [currencies supported by Xsolla](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/).",
  locale = "Response language.",
  sandbox = true,
  quantity = 123,
  promo_code = "Redeems a code of a promo code promotion with payment.",
  settings =
  {
    cart_payment_settings_ui =
    {
      theme = "Payment UI theme. Can be `63295a9a2e47fab76f7708e1` for the light theme (default) or `63295aab2e47fab76f7708e3` for the dark theme. You can also [create a custom theme](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_in_token) and pass its ID in this parameter.",
      desktop =
      {
        header =
        {
          is_visible = true,
          visible_logo = true,
          visible_name = true,
          visible_purchase = true,
          type = "How to show the header. Can be `compact` (hides project name and user ID) or `normal` (default).",
          close_button = true,
        },
      },
      mode = "Interface mode in payment UI. 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.",
      user_account =
      {
        payment_accounts =
        {
          enable = true,
        },
        info =
        {
          enable = true,
          order = 123,
        },
        subscriptions =
        {
          enable = true,
          order = 123,
        },
      },
      header =
      {
        visible_virtual_currency_balance = true,
      },
      mobile =
      {
        header =
        {
          close_button = true,
        },
      },
      is_prevent_external_link_open = true,
      is_payment_methods_list_mode = true,
      is_independent_windows = true,
      currency_format = "Set to `code` to display a three-letter [ISO 4217](https://developers.xsolla.com/doc/pay-station/references/supported-currencies/) currency code in the payment UI. The currency symbol is displayed instead of the three-letter currency code by default.",
      is_show_close_widget_warning = true,
      layout = "Location of the main elements of the payment UI. You can open the payment UI inside your game and/or swap the columns with information about an order and payment methods. Refer to the [customization instructions](https://developers.xsolla.com/doc/pay-station/features/ui-theme-customization/#pay_station_ui_theme_customization_layout) for detailed information.",
      is_three_ds_independent_windows = true,
      is_cart_open_by_default = true,
    },
    cart_payment_settings_payment_method = 123,
    cart_payment_settings_return_url = "Page to redirect the user to after payment. Parameters `user_id`, `foreigninvoice`, `invoice_id` and `status` will be automatically added to the link.",
    cart_payment_redirect_policy =
    {
      redirect_conditions = "none",
      delay = 0,
      status_for_manual_redirection = "none",
      redirect_button_caption = "Text button",
    },
  },
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_order(project_id: integer, order_id: string, callback: function, retry_policy: table, cancellation_token: table)

Get order

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • order_id: string — Order ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_upsell_for_project_client(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Get list of upsell items in project

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_games_list(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get games list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_games_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get games list by specified group

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • external_id: string — Group external ID.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_game_by_sku(project_id: integer, item_sku: string, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get game for catalog

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_game_key_by_sku(project_id: integer, item_sku: string, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get game key for catalog

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_game_keys_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get game keys list by specified group

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • external_id: string — Group external ID.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_drm_list(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Get DRM list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_user_games(project_id: integer, limit: integer, offset: integer, sandbox: integer, additional_fields: array, callback: function, retry_policy: table, cancellation_token: table)

Get list of games owned by user

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • sandbox: integer — What type of entitlements should be returned. If the parameter is set to 1, the entitlements received by the user in the sandbox mode only are returned. If the parameter isn't passed or is set to 0, the entitlements received by the user in the live mode only are returned.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request. Available fields attributes.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.redeem_game_pin_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Redeem game code by client

{
  code = "AAAA-BBBB-CCCC-DDDD",
  sandbox = false,
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.redeem_coupon(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Redeem coupon code

{
  coupon_code = "WINTER2021",
  selected_unit_items =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_coupon_rewards_by_code(project_id: integer, coupon_code: string, callback: function, retry_policy: table, cancellation_token: table)

Get coupon rewards

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • coupon_code: string — Unique case sensitive code. Contains letters and numbers.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.redeem_promo_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Redeem promo code

{
  coupon_code = "SUMMER2021",
  cart =
  {
    id = "Cart ID.",
  },
  selected_unit_items =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.remove_cart_promo_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)

Remove promo code from cart

{
  cart =
  {
    id = "Cart ID.",
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_promo_code_rewards_by_code(project_id: integer, promocode_code: string, callback: function, retry_policy: table, cancellation_token: table)

Get promo code rewards

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • promocode_code: string — Unique case sensitive code. Contains letters and numbers.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.verify_promotion_code(project_id: integer, code: string, callback: function, retry_policy: table, cancellation_token: table)

Verify promotion code

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • code: string — Unique case-sensitive code. Contains letters and numbers.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_items(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual items list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_items_sku(project_id: integer, item_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual item by SKU

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_all_virtual_items(project_id: integer, locale: string, promo_code: string, callback: function, retry_policy: table, cancellation_token: table)

Get all virtual items list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_currency(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual currency list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_currency_sku(project_id: integer, virtual_currency_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual currency by SKU

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • virtual_currency_sku: string — Virtual currency SKU.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_currency_package(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual currency package list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_currency_package_sku(project_id: integer, virtual_currency_package_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get virtual currency package by SKU

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • virtual_currency_package_sku: string — Virtual currency package SKU.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_virtual_items_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get items list by specified group

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • external_id: string — Group external ID.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_item_groups(project_id: integer, promo_code: string, callback: function, retry_policy: table, cancellation_token: table)

Get item group list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.create_order_with_item_for_virtual_currency(project_id: integer, item_sku: string, virtual_currency_sku: string, platform: string, body: table, callback: function, retry_policy: table, cancellation_token: table)

Create order with specified item purchased by virtual currency

{
  custom_parameters =
  {
  },
}

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_sku: string — Item SKU.
  • virtual_currency_sku: string — Virtual currency SKU.
  • platform: string — Publishing platform the user plays on xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, pc_other.
  • body: table
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_sellable_items(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get sellable items list

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_sellable_item_by_id(project_id: integer, item_id: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get sellable item by ID

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • item_id: string — Item ID.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_sellable_item_by_sku(project_id: integer, sku: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get sellable item by SKU

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • sku: string — Item SKU.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_sellable_items_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)

Get sellable items list by specified group

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • external_id: string — Group external ID.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • locale: string — Response language. Two-letter lowercase language code per ISO 639-1.
  • additional_fields: array — The list of additional fields. These fields will be in the response if you send them in your request.
  • country: string — Two-letter uppercase country code per ISO 3166-1 alpha-2. Check the documentation for detailed information about countries supported by Xsolla and the process of determining the country.
  • promo_code: string — Unique case sensitive code. Contains letters and numbers.
  • show_inactive_time_limited_items: integer — Shows time-limited items that are not available to the user. The validity period of such items has not started or has already expired.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_reward_chains_list(project_id: integer, limit: integer, offset: integer, callback: function, retry_policy: table, cancellation_token: table)

Get current user's reward chains

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • limit: integer — Limit for the number of elements on the page.
  • offset: integer — Number of the element from which the list is generated (the count starts from 0). 0️⃣ 0-based; passed to shop unchanged.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_user_reward_chain_balance(project_id: integer, reward_chain_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Get current user's value point balance

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • reward_chain_id: integer — Reward chain ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.claim_user_reward_chain_step_reward(project_id: integer, reward_chain_id: integer, step_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Claim step reward

Parameters

  • project_id: integer — Project ID. You can find this parameter in your Publisher Account next to the name of the project.
  • reward_chain_id: integer — Reward chain ID.
  • step_id: integer — Reward chain step ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.get_user_clan_top_contributors(project_id: integer, reward_chain_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Get top 10 contributors to reward chain under clan

Parameters

  • project_id: integer — Project ID.
  • reward_chain_id: integer — Reward chain ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

shop.user_clan_update(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)

Update current user's clan

Parameters

  • project_id: integer — Project ID.
  • callback: function — Optional callback function
  • retry_policy: table — Optional retry policy
  • cancellation_token: table — Optional cancellation token

On this page

Functionsshop.cancel(token: table)shop.cancellation_token(): tableshop.set_bearer_token(token: string)shop.set_username_password(username: string, password: string)shop.set_merchant_auth(merchant_id: string, api_key: string)shop.set_auth_for_cart(authorization_id: string, user: string)shop.sync(fn: function, cancellation_token: table)shop.get_bundle_list(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_bundle(project_id: integer, sku: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_bundle_list_in_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_cart_by_id(project_id: integer, cart_id: string, currency: string, locale: string, callback: function, retry_policy: table, cancellation_token: table)shop.get_user_cart(project_id: integer, currency: string, locale: string, callback: function, retry_policy: table, cancellation_token: table)shop.cart_clear_by_id(project_id: integer, cart_id: string, callback: function, retry_policy: table, cancellation_token: table)shop.cart_clear(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.cart_fill(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.cart_fill_by_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.put_item_by_cart_id(project_id: integer, cart_id: string, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.delete_item_by_cart_id(project_id: integer, cart_id: string, item_sku: string, callback: function, retry_policy: table, cancellation_token: table)shop.put_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.delete_item(project_id: integer, item_sku: string, callback: function, retry_policy: table, cancellation_token: table)shop.create_order_by_cart_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.create_order(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.create_order_with_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.create_free_order(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.create_free_order_by_cart_id(project_id: integer, cart_id: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.create_free_order_with_item(project_id: integer, item_sku: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.get_order(project_id: integer, order_id: string, callback: function, retry_policy: table, cancellation_token: table)shop.get_upsell_for_project_client(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_games_list(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_games_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_game_by_sku(project_id: integer, item_sku: string, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_game_key_by_sku(project_id: integer, item_sku: string, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_game_keys_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_drm_list(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_user_games(project_id: integer, limit: integer, offset: integer, sandbox: integer, additional_fields: array, callback: function, retry_policy: table, cancellation_token: table)shop.redeem_game_pin_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.redeem_coupon(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.get_coupon_rewards_by_code(project_id: integer, coupon_code: string, callback: function, retry_policy: table, cancellation_token: table)shop.redeem_promo_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.remove_cart_promo_code(project_id: integer, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.get_promo_code_rewards_by_code(project_id: integer, promocode_code: string, callback: function, retry_policy: table, cancellation_token: table)shop.verify_promotion_code(project_id: integer, code: string, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_items(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_items_sku(project_id: integer, item_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_all_virtual_items(project_id: integer, locale: string, promo_code: string, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_currency(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_currency_sku(project_id: integer, virtual_currency_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_currency_package(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_currency_package_sku(project_id: integer, virtual_currency_package_sku: string, locale: string, country: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_virtual_items_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_item_groups(project_id: integer, promo_code: string, callback: function, retry_policy: table, cancellation_token: table)shop.create_order_with_item_for_virtual_currency(project_id: integer, item_sku: string, virtual_currency_sku: string, platform: string, body: table, callback: function, retry_policy: table, cancellation_token: table)shop.get_sellable_items(project_id: integer, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_sellable_item_by_id(project_id: integer, item_id: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_sellable_item_by_sku(project_id: integer, sku: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_sellable_items_group(project_id: integer, external_id: string, limit: integer, offset: integer, locale: string, additional_fields: array, country: string, promo_code: string, show_inactive_time_limited_items: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_reward_chains_list(project_id: integer, limit: integer, offset: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_user_reward_chain_balance(project_id: integer, reward_chain_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.claim_user_reward_chain_step_reward(project_id: integer, reward_chain_id: integer, step_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.get_user_clan_top_contributors(project_id: integer, reward_chain_id: integer, callback: function, retry_policy: table, cancellation_token: table)shop.user_clan_update(project_id: integer, callback: function, retry_policy: table, cancellation_token: table)