Saltar para o conteúdo

Visão geral

  • Versão: 2.0
  • Servidores: https://api.xsolla.com/merchant/v2/

Essa referência API descreve os pontos de extremidade na gerência de assinaturas, cupons e promoções. Para obter mais informações sobre as Assinaturas, veja o guia do produto e o glossário.

Transferir a descrição da OpenAPI
Idiomas
Servidores
Mock server
https://xsolla.redocly.app/_mock/pt/api/subscriptions/
Operações
Operações
Operações
Operações
Operações
Operações
Operações
Operações

Pedido

Segurança
projectUserJwtAuth
Caminho
project_idinteger\d+obrigatório
Consulta
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Respostas

Get subscription info

Corpoapplication/json
has_morebooleanobrigatório
Exemplo: "false"
itemsArray of objects
Padrão []
items[].​chargeobjectobrigatório
items[].​charge.​amountnumber(float)obrigatório
Exemplo: 4.99
items[].​charge.​amount_with_promotionnumber or null(float)
Padrão null
Exemplo: 3.99
items[].​charge.​currencystringobrigatório
Exemplo: "USD"
items[].​date_createstring(date-time)obrigatório
Exemplo: "2031-04-11T13:51:02+03:00"
items[].​date_last_chargestring or null(date-time)
Exemplo: "2031-04-11T13:51:02+03:00"
items[].​date_next_chargestring or null(date-time)
Exemplo: "2031-04-11T13:51:02+03:00"
items[].​idintegerobrigatório
Exemplo: "12345"
items[].​is_in_trialbooleanobrigatório
Exemplo: "false"
items[].​periodobjectobrigatório
items[].​period.​unitstring or null
Padrão null
Exemplo: "month"
items[].​period.​valueinteger or null
Padrão null
Exemplo: "1"
items[].​plan_descriptionstringobrigatório
Exemplo: "Localized plan description"
items[].​plan_end_datestring or null(date-time)
Exemplo: "2031-04-11T13:51:02+03:00"
items[].​plan_external_idstringobrigatório
Exemplo: "PlanExternalId"
items[].​plan_idintegerobrigatório
Exemplo: "54321"
items[].​plan_namestringobrigatório
Exemplo: "Localized plan name"
items[].​plan_start_datestring or null(date-time)
Exemplo: "2021-04-11T13:51:02+03:00"
items[].​product_descriptionstring or null
Exemplo: "Localized product description"
items[].​product_external_idstring or null
Exemplo: "ProductExternalId"
items[].​product_idinteger or null
Exemplo: "12345"
items[].​product_namestring or null
Exemplo: "Product name"
items[].​statusstringobrigatório
Exemplo: "active"
items[].​trial_periodinteger or null
Exemplo: "0"
Resposta
application/json
{ "has_more": "false", "items": [] }

Pedido

Segurança
projectUserJwtAuth
Caminho
project_idinteger\d+obrigatório
Consulta
countrystring
Corpoapplication/jsonobrigatório

Buy subscription

available_plansobject or null

Planos de assinatura para exibir na interface de pagamento.

Padrão null
custom_parametersobject or null

You can pass additional parameters in the token

Padrão null
plan_external_idstring or null

You must provide either a plan_external_id

Padrão null
Exemplo: "PlanExternalId"
product_idinteger or null

ID of the product associated with the plan

Padrão null
Exemplo: "12345"
settings(object or null)
(object or null)
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/pt/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"
    }
  }'

Respostas

Get buy subscription url

Corpoapplication/json
link_to_psstringobrigatório
Exemplo: "https://secure.xsolla.com/paystation2/?access_token=<access_token>"
Resposta
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
Operações
Operações
Operações
Operações