Xsolla-logo

Create Plan

post/projects/{project_id}/subscriptions/plans

Creates a subscription plan.

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

Project ID.

Request Body schema: application/json
required
object

Plan name. Value consists of pairs "localization":"plan name".

en
string

English.

ru
string

Russian.

cs
string

Czech.

ar
string

Arabic.

bg
string

Bulgarian.

cn
string

Chinese (Simplified).

tw
string

Chinese (Traditional).

fr
string

French.

de
string

German.

he
string

Hebrew.

it
string

Italian.

ko
string

Korean.

pl
string

Polish.

pt
string

Portuguese.

ro
string

Romanian.

es
string

Spanish.

th
string

Thai.

tr
string

Turkish.

vi
string

Vietnamese.

ja
string

Japanese.

required
object

Billing details.

required
object

Billing period.

value
required
integer

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

type
required
string

Time unit. Can be day, month or lifetime.

Enum: "day" "month" "lifetime"
amount
number <float>

Billing amount.

currency
string

Currency of the purchase. Three-letter currency code per ISO 4217.

Array of objects

List of prices in different currencies.

Array
amount
required
number <float>

Billing amount.

currency
required
string

Currency of the purchase. Three-letter currency code per ISO 4217.

setup_fee
number <float>

One-time setup fee charged as part of the first invoice.

id
integer

Subscription plan ID.

external_id
string

Plan external ID (32 characters).

object

Plan description. Value consists of pairs "localization":"plan description".

en
string

English.

ru
string

Russian.

cs
string

Czech.

ar
string

Arabic.

bg
string

Bulgarian.

cn
string

Chinese (Simplified).

tw
string

Chinese (Traditional).

fr
string

French.

de
string

German.

he
string

Hebrew.

it
string

Italian.

ko
string

Korean.

pl
string

Polish.

pt
string

Portuguese.

ro
string

Romanian.

es
string

Spanish.

th
string

Thai.

tr
string

Turkish.

vi
string

Vietnamese.

ja
string

Japanese.

group_id
string

Group ID the plan is linked to.

object

Subscription expiration details.

value
required
integer

Validity time.

type
required
string

Time unit. Can be day or month.

Enum: "day" "month"
object

Trial period details.

value
required
integer

Number of time units.

type
required
string

Time unit. Can be day.

Value: "day"
object

Grace period details.

value
required
integer

Number of time units.

type
required
string

Time unit. Can be day.

Value: "day"
object

Billing retry details.

value
required
integer

Number of billing retries.

refund_period
integer

Period of time that user can refund the payment for a subscription plan (in days).

tags
Array of strings

Plan tags.

object
value
string

Subscription plan status.

Enum: "active" "disabled"
Responses
201

Сreated.

Request samples
application/json
{
  • "charge": {
    },
  • "description": {
    },
  • "expiration": {
    },
  • "external_id": "exp",
  • "grace_period": {
    },
  • "billing_retry": {
    },
  • "refund_period": null,
  • "name": {
    },
  • "status": {
    },
  • "trial": {
    }
}
Response samples
application/json
{
  • "external_id": "exp",
  • "plan_id": 241082
}