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é
subscriptionsManagementJwtAuth
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/management/projects/{project_id}/subscriptions?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Réponses

Get subscriptions info

Corpsapplication/json
has_morebooleanobligatoire
Exemple: "false"
itemsArray of objects(ManagementSubscriptionResponse2)
Par défaut []
Réponse
application/json
{ "has_more": "false", "items": [] }

Requête

Sécurité
subscriptionsManagementJwtAuth
Chemin
project_idinteger\d+obligatoire
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/fr/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/settings' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Réponses

Returns project settings for managing subscription

Corpsapplication/json
allow_change_packagebooleanobligatoire
Exemple: "true"
recurrent_cancel_possiblebooleanobligatoire
Exemple: "true"
Réponse
application/json
{ "allow_change_package": "true", "recurrent_cancel_possible": "true" }

Requête

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

Réponses

Get subscription info

Corpsapplication/json
chargeobject(Charge)obligatoire
charge.​amountnumber(float)obligatoire
Exemple: "4.99"
charge.​amount_with_promotionnumber or null(float)
Par défaut null
Exemple: "3.99"
charge.​currencystringobligatoire
Exemple: "USD"
date_createstring(date-time)obligatoire
Exemple: "2031-04-11T13:51:02+03:00"
date_endstring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
date_last_chargestring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
date_next_chargestring or null(date-time)
Exemple: "2031-04-11T13:51:02+03:00"
idintegerobligatoire
Exemple: "12345"
is_change_plan_allowedbooleanobligatoire
Exemple: "false"
is_change_to_non_renew_possiblebooleanobligatoire
Exemple: "true"
is_in_trialbooleanobligatoire
Exemple: "false"
is_renew_possiblebooleanobligatoire
Exemple: "true"
last_successful_charge(LastSuccessfulCharge (object or null))
(LastSuccessfulCharge (object or null))
payment_account(PaymentRecurrentAccountResponse2 (object or null))
(PaymentRecurrentAccountResponse2 (object or null))
periodobject(Period)obligatoire
period.​unitstring or null
Par défaut null
Exemple: "month"
period.​valueinteger or null
Par défaut null
Exemple: "1"
plan_descriptionstringobligatoire
Exemple: "Localized plan description"
plan_namestringobligatoire
Exemple: "Localized plan name"
product_descriptionstring or null
Exemple: "Localized product description"
product_namestring or null
Exemple: "Product name"
statusstringobligatoire
Exemple: "active"
trial_periodinteger or null
Exemple: "0"
Réponse
application/json
{ "charge": { "amount": "4.99", "amount_with_promotion": "3.99", "currency": "USD" }, "date_create": "2031-04-11T13:51:02+03:00", "date_end": "2031-04-11T13:51:02+03:00", "date_last_charge": "2031-04-11T13:51:02+03:00", "date_next_charge": "2031-04-11T13:51:02+03:00", "id": "12345", "is_change_plan_allowed": "false", "is_change_to_non_renew_possible": "true", "is_in_trial": "false", "is_renew_possible": "true", "last_successful_charge": { "amount": "3.99", "currency": "USD", "date": "2031-04-11T13:51:02+03:00" }, "payment_account": { "card_expiry_date": {}, "id": "123", "name": "** 7398", "ps_name": "Mastercard", "switch_icon_name": "mastercard.svg", "type": "card" }, "period": { "unit": "month", "value": "1" }, "plan_description": "Localized plan description", "plan_name": "Localized plan name", "product_description": "Localized product description", "product_name": "Product name", "status": "active", "trial_period": "0" }