Add new subscription plan
POST
/v1/subscriptions/plansAdds one particular subscription plan. Within a single subscription plan, one product can be included (one plan, one product). There can be multiple plans for the same product. The plans can differ by some parameters such as trial period, fee charge day, activation fee, amount, currency, interval count or interval unit etc.
The added plan is activated by default.
Request
Header Params
request-id
string
required
A unique identifier generated by requesting client
>= 38 characters<= 1024 characters
Example:
|us04oqdnzFQVr0rITD9/c9OvDRE2sXVfwerv.
Match pattern:
^[a-zA-Z0-9?&:_|\-\/=+.,#\s]+$
Body Params application/json
trialPeriodDays
integer
optional
>= 0
chargeDay
integer
optional
>= 1
setupFee
string
optional
Start subscription fee
Example:
123.0004
Match pattern:
^(?=.*[0-9])\d{1,16}(?:\.\d{1,12})?$
amount
string
required
Amount of the transaction.
Example:
123.0004
Match pattern:
^(?=.*[1-9])\d{1,16}(?:\.\d{1,12})?$
currency
string
required
Currency of the amount specified in the amount
property.
>= 3 characters<= 3 characters
Example:
EUR
intervalUnit
string
required
Allowed values:
dayweekmonthyear
intervalCount
integer
required
>= 1
chargeRetry
boolean
optional
productId
string <uuid>
required
totalCount
integer
optional
Default:
0
Example
{
"trialPeriodDays": 0,
"chargeDay": 1,
"setupFee": "123.0004",
"amount": "123.0004",
"currency": "EUR",
"intervalUnit": "day",
"intervalCount": 1,
"chargeRetry": true,
"productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
"totalCount": 0
}
Request samples
Responses
OK(201)
Not Found(404)
HTTP Code: 201
Content Type : JSONapplication/json
Data Schema
id
string <uuid>
required
merchantId
string
required
shopId
string
required
terminalId
string
required
status
boolean
required
trialPeriodDays
integer
optional
>= 0
chargeDay
integer
optional
>= 1
setupFee
string
optional
amount
string
required
<= 128 characters
currency
string
required
<= 3 characters
intervalUnit
string
required
Allowed values:
dayweekmonthyear
intervalCount
integer
required
>= 1
totalCount
integer
required
chargeRetry
boolean
required
productId
string <uuid>
required
createdAt
required
One of
updatedAt
required
One of
deletedAt
string
optional
Match pattern:
d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d.d+Z?
Example
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"merchantId": "string",
"shopId": "string",
"terminalId": "string",
"status": true,
"trialPeriodDays": 0,
"chargeDay": 1,
"setupFee": "string",
"amount": "string",
"currency": "str",
"intervalUnit": "day",
"intervalCount": 1,
"totalCount": 0,
"chargeRetry": true,
"productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
"createdAt": "2019-08-24",
"updatedAt": "2019-08-24",
"deletedAt": "string"
}
Modified at 14 days ago