Перейти к содержимому

Введение

  • Версия: 2.0
  • Серверы: https://api.xsolla.com/merchant/v2/

Этот справочник API описывает методы для управления подписками, купонами и акциями. Подробная информация о продукте Subscriptions приведена в руководстве по продукту и глоссарии.

Скачать описание OpenAPI
Языки
Серверы
Mock server
https://xsolla.redocly.app/_mock/ru/api/subscriptions/
Операции
Операции
Операции
Операции
Операции
Операции
Операции
Операции

Запрос

Безопасность
subscriptionsManagementJwtAuth
Путь
subscription_idinteger\d+обязательный
project_idinteger\d+обязательный
Запрос
limitinteger
offsetinteger
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/ru/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}/plans_for_change?limit=0&offset=0&locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Ответы

List of available plans for change

Телоapplication/json
has_morebooleanобязательный
Пример: "false"
itemsArray of objects(PlanResponse)
По умолчанию []
Ответ
application/json
{ "has_more": "false", "items": [] }

Запрос

Безопасность
subscriptionsManagementJwtAuth
Путь
subscription_idinteger\d+обязательный
plan_idinteger\d+обязательный
project_idinteger\d+обязательный
Запрос
localestring
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/ru/api/subscriptions/api/user/v1/management/projects/{project_id}/subscriptions/{subscription_id}/plans_for_change/{plan_id}?locale=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Ответы

Available plans for change with payment details

Телоapplication/json
chargeobject(Charge2)обязательный
charge.​amountnumber(float)обязательный
Пример: "4.99"
charge.​currencystringобязательный
Пример: "USD"
charge.​setup_feenumber or null(float)
Пример: "0.99"
payment_detailsobject(PaymentDetails)обязательный
payment_details.​surcharge(Surcharge (object or null))
По умолчанию null
(Surcharge (object or null))
По умолчанию null
payment_details.​unused(Unused (object or null))
По умолчанию null
(Unused (object or null))
По умолчанию null
periodobject(Period2)обязательный
period.​unitstring or null
По умолчанию null
Пример: "month"
period.​valueinteger or null
По умолчанию null
Пример: "1"
plan_descriptionstringобязательный
Пример: "Localized plan description"
plan_end_datestring or null(date-time)
Пример: "2031-04-11T13:51:02+03:00"
plan_external_idstringобязательный
Пример: "PlanExternalId"
plan_group_idstring or null
Пример: "TestGroupId"
plan_idintegerобязательный
Пример: "54321"
plan_namestringобязательный
Пример: "Localized plan name"
plan_start_datestring or null(date-time)
Пример: "2021-04-11T13:51:02+03:00"
plan_typestringобязательный
Пример: "all"
promotionobject(Promotion)обязательный
promotion.​promotion_charge_amountnumber or null(float)
По умолчанию null
Пример: "3.99"
promotion.​promotion_remaining_chargesinteger or null
По умолчанию null
Пример: "3"
trial_periodinteger or null
Пример: "7"
Ответ
application/json
{ "charge": { "amount": "4.99", "currency": "USD", "setup_fee": "0.99" }, "payment_details": { "surcharge": null, "unused": null }, "period": { "unit": "month", "value": "1" }, "plan_description": "Localized plan description", "plan_end_date": "2031-04-11T13:51:02+03:00", "plan_external_id": "PlanExternalId", "plan_group_id": "TestGroupId", "plan_id": "54321", "plan_name": "Localized plan name", "plan_start_date": "2021-04-11T13:51:02+03:00", "plan_type": "all", "promotion": { "promotion_charge_amount": "3.99", "promotion_remaining_charges": "3" }, "trial_period": "7" }