Buy subscription
/
Get management link
Subscriptions API (2.0)
- 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/
Corpoapplication/jsonobrigatório
Planos de assinatura para exibir na interface de pagamento.
Padrão null
You must provide either a plan_external_id
Padrão null
Exemplo: "PlanExternalId"
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/buy
- Mock serverhttps://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/buy
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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"
}
}'Resposta
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
Corpoapplication/jsonobrigatório
Manage subscription
Planos de assinatura para exibir na interface de pagamento.
Padrão null
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/manage
- Mock serverhttps://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/manage
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/manage?country=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"available_plans": null,
"custom_parameters": null,
"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"
},
"steam_user_id": "string"
}'Resposta
application/json
{ "link_to_ps": "https://secure.xsolla.com/paystation2/?access_token=<access_token>" }
- https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/user_account
- Mock serverhttps://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/user_account
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://xsolla.redocly.app/_mock/pt/api/subscriptions/api/user/v1/projects/{project_id}/subscriptions/user_account?locale=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'Resposta
application/json
{ "redirect_url": "https://subscriptions-user-account.xsolla.com/?token=<access_token>&projectId=<project_id>&merchantId=<merchant_id>&locale=<locale>" }