Xsolla-logo

Update Subscription

put/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}

Updates a subscription by either changing its status (active, canceled, or non_renewing) or postponing the next billing date.

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

Project ID.

user_id
required
string

User ID.

subscription_id
required
integer

Subscription ID.

Request Body schema: application/json
user_id
string

User ID.

status
string

Status.

Enum: "active" "canceled" "non_renewing"
cancel_subscription_payment
boolean

Setting to true will refund the last payment made for this subscription. Only works together with setting the status to canceled.

object

Billing postponement.

type
string

Billing time unit. Can be day or month.

Enum: "day" "month"
value
string

Number of time units to postpone the billing by. 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

object
collaborator_id
string

Collaborator ID — influencer or affiliate network identifier. You can find it in your Publisher Account > Partner Network > Influencers section.

Responses
200

OK.

Request samples
application/json
{
  • "status": "active"
}
Response samples
application/json
{
  • "charge_amount": 0.03,
  • "currency": "USD",
  • "date_create": "2018-09-21T16:54:59+0300",
  • "date_end": null,
  • "date_last_charge": "2018-09-21T16:55:05+0300",
  • "date_next_charge": "2018-09-21T16:55:05+0300",
  • "id": 24953579,
  • "plan": {
    },
  • "product": null,
  • "status": "active",
  • "user": {
    }
}