Project ID.
Subscriptions API (2.0)
- Version: 2.0
- Servers:
https://api.xsolla.com/merchant/v2/
This API reference describes endpoints for managing subscriptions, coupons, and promotions. To get more information about Subscriptions, see the product guide and the glossary.
Setting to true will refund the last payment made for this subscription. Only works together with setting the status to canceled.
Billing postponement.
Collaborator ID — influencer or affiliate network identifier. You can find it in your Publisher Account > Partner Network > Influencers section.
- https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}
- Mock serverhttps://xsolla.redocly.app/_mock/api/subscriptions/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/api/subscriptions/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}' \
-H 'Content-Type: application/json' \
-d '{
"status": "active"
}'{ "charge_amount": 0.03, "currency": "USD", "date_create": "2018-09-21T16:54:59+03:00", "date_end": null, "date_last_charge": "2018-09-21T16:55:05+03:00", "date_next_charge": "2018-09-21T16:55:05+03:00", "id": 24953579, "plan": { "charge": { … }, "description": null, "expiration": { … }, "external_id": "lowcost", "grace_period": { … }, "billing_retry": { … }, "refund_period": null, "group_id": "newPlans", "id": 66001, "localized_name": null, "name": null, "project_id": 18404, "status": { … }, "tags": null, "trial": { … }, "type": "all" }, "product": null, "status": "active", "user": { "id": "jb1", "name": "J.Black" } }
Request
Lists all recurrent subscriptions.
This API method can’t be used under a high load. The maximum load is 20 requests per minute.
Notice
This API call does not contain the project_id path-parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization.
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/subscriptions
- Mock serverhttps://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/subscriptions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/api/subscriptions/merchants/{merchant_id}/subscriptions?offset=0&limit=0&user_id=string&project_id%5B%5D=0&plan_id%5B%5D=0&product_id%5B%5D=0&group_id%5B%5D=string&status%5B%5D=active&datetime_from=string&datetime_to=string'OK.
Plan name. Value consists of pairs "localization":"plan name".
Billing details.
Billing period.
Number of time units. The value depends on the type parameter and can be:
- from 1 to 366, if type is day
- from 1 to 12, if type is month
- 0 if type is lifetime
Currency of the purchase. Three-letter currency code per ISO 4217.
List of prices in different currencies.
Currency of the purchase. Three-letter currency code per ISO 4217.
Plan description. Value consists of pairs "localization":"plan description".
Subscription expiration details.
Trial period details.
Grace period details.
Billing retry details.
Period of time that user can refund the payment for a subscription plan (in days).
Localized item descriptions.
Subscription creation date in the YYYY-MM-DD’T’HH:MM:SS format per ISO 8601.
Subscription end date in the YYYY-MM-DD’T’HH:MM:SS format per ISO 8601.
Last subscription charge date in the YYYY-MM-DD’T’HH:MM:SS format per ISO 8601.
Next subscription charge date in the YYYY-MM-DD’T’HH:MM:SS format per ISO 8601.
[ { "id": 45, "status": "canceled", "user": { … }, "charge_amount": 0.03, "currency": "USD", "date_create": "2013-09-05T15:27:47+04:00", "date_end": "2014-02-06T11:32:48+04:00", "date_last_charge": null, "date_next_charge": null, "plan": { … }, "product": { … } } ]