Passer au contenu

Présentation

  • Version : 2.0
  • Serveurs : https://api.xsolla.com/merchant/v2/

Cette référence API décrit les endpoints pour la gestion des abonnements, des coupons et des promotions. Pour plus d'informations sur les abonnements, consultez le guide du produit et le glossaire.

Télécharger la description d'OpenAPI
Langues
Serveurs
Mock server
https://xsolla.redocly.app/_mock/fr/api/subscriptions/
Opérations
Opérations
Opérations
Opérations
Opérations
Opérations
Opérations
Opérations

Requête

Sécurité
projectUserJwtAuth
Chemin
project_idinteger\d+obligatoire
Requête
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/fr/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Réponses

Get subscription info

Corpsapplication/json
has_morebooleanobligatoire
Exemple: "false"
itemsArray of objects
Par défaut []
items[].​chargeobjectobligatoire
items[].​charge.​amountnumber(float)obligatoire
Exemple: 4.99
items[].​charge.​amount_with_promotionnumber or null(float)
Par défaut null
Exemple: 3.99
items[].​charge.​currencystringobligatoire
Exemple: "USD"
items[].​date_createstring(date-time)obligatoire
Exemple: "2031-04-11T13:51:02+03:00"
items[].​date_last_chargestring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
items[].​date_next_chargestring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
items[].​idintegerobligatoire
Exemple: "12345"
items[].​is_in_trialbooleanobligatoire
Exemple: "false"
items[].​periodobjectobligatoire
items[].​period.​unitstring or null
Par défaut null
Exemple: "month"
items[].​period.​valueinteger or null
Par défaut null
Exemple: "1"
items[].​plan_descriptionstringobligatoire
Exemple: "Localized plan description"
items[].​plan_end_datestring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
items[].​plan_external_idstringobligatoire
Exemple: "PlanExternalId"
items[].​plan_idintegerobligatoire
Exemple: "54321"
items[].​plan_namestringobligatoire
Exemple: "Localized plan name"
items[].​plan_start_datestring or null(date-time)
Exemple: "2021-04-11T13:51:02+03:00"
items[].​product_descriptionstring or null
Exemple: "Localized product description"
items[].​product_external_idstring or null
Exemple: "ProductExternalId"
items[].​product_idinteger or null
Exemple: "12345"
items[].​product_namestring or null
Exemple: "Product name"
items[].​statusstringobligatoire
Exemple: "active"
items[].​trial_periodinteger or null
Exemple: "0"
Réponse
application/json
{ "has_more": "false", "items": [] }

Requête

Sécurité
projectUserJwtAuth
Chemin
project_idinteger\d+obligatoire
Requête
countrystring
Corpsapplication/jsonobligatoire

Buy subscription

available_plansobject or null

Plans d'abonnement à afficher dans l'interface de paiement.

Par défaut null
custom_parametersobject or null

You can pass additional parameters in the token

Par défaut null
plan_external_idstring or null

You must provide either a plan_external_id

Par défaut null
Exemple: "PlanExternalId"
product_idinteger or null

ID of the product associated with the plan

Par défaut null
Exemple: "12345"
settings(object or null)
(object or null)
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/fr/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/buy?country=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "available_plans": null,
    "custom_parameters": null,
    "plan_external_id": "PlanExternalId",
    "product_id": "12345",
    "settings": {
      "currency": "str",
      "external_id": "string",
      "hide_saved_payment_accounts": true,
      "locale": "st",
      "payment_method": 1,
      "redirect_policy": {
        "delay": 0,
        "redirect_button_caption": "string",
        "redirect_conditions": "none",
        "status_for_manual_redirection": "none"
      },
      "return_url": "string",
      "steam_user_id": "stringstringstrin",
      "ui": {
        "desktop": {
          "header": {
            "close_button": true,
            "is_visible": true,
            "type": "compact",
            "visible_logo": true,
            "visible_name": true
          }
        },
        "independent_windows": true,
        "license_url": "string",
        "mobile": {
          "footer": {
            "is_visible": true
          },
          "header": {
            "close_button": true
          },
          "mode": "saved_accounts"
        },
        "mode": "user_account",
        "size": "large",
        "theme": "string",
        "user_account": {
          "history": {
            "enable": true,
            "order": 1
          },
          "info": {
            "enable": true,
            "order": 1
          },
          "payment_accounts": {
            "enable": true,
            "order": 1
          },
          "subscriptions": {
            "enable": true,
            "order": 1
          }
        },
        "version": "desktop"
      },
      "xsolla_product_tag": "string"
    }
  }'

Réponses

Get buy subscription url

Corpsapplication/json
link_to_psstringobligatoire
Exemple: "https://secure.xsolla.com/paystation2/?access_token=<access_token>"
Réponse
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
Opérations
Opérations
Opérations
Opérations