Paid services
Use these methods to manage the paid services to which clients can be subscribed, as well as manage clients’ subscriptions.
GET[host]api/v2/subscriptions |
|
GET[host]/api/v2/subscriptions/{subscriptionId} |
|
POST[host]/api/v2/subscriptions |
|
PUT[host]/api/v2/subscriptions/{subscriptionId} PATCH[host]/api/v2/subscriptions/{subscriptionId} |
|
DELETE[host]/api/v2/subscriptions/{subscriptionId} |
GET[host]/api/v2/subscriptions/groups |
|
GET[host]/api/v2/subscriptions/groups/{groupId} |
|
POST[host]/api/v2/subscriptions/groups |
|
PATCH[host]/api/v2/subscriptions/groups/{groupId} |
|
DELETE[host]/api/v2/subscriptions/groups/{groupId} |
GET[host]/api/v2/subscriptions/parameters |
|
GET[host]/api/v2/subscriptions/parameters/{parameterId} |
|
POST[host]/api/v2/subscriptions/parameters |
|
PATCH[host]/api/v2/subscriptions/parameters/{parameterId} |
|
DELETE[host]/api/v2/subscriptions/parameters/{parameterId} |
GET[host]/api/v2/v2/subscriptions/plans |
|
GET[host]/api/v2/subscriptions/plans/{planId} |
|
POST[host]/api/v2/subscriptions/plans |
|
PATCH[host]/api/v2/subscriptions/plans/{planId} |
|
DELETE[host]/api/v2/subscriptions/plans/{planId} |
GET[host]/api/v2/subscriptions/services |
|
GET[host]/api/v2/subscriptions/services/{serviceId} |
|
POST[host]/api/v2/subscriptions/services |
|
PATCH[host]/api/v2/subscriptions/services/{serviceId} |
|
DELETE[host]/api/v2/subscriptions/services/{serviceId} |
Get a list of subscriptions
Use this method to obtain a list of paid services to which clients are subscribed.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- clientId
The client identifier.
- serviceId
The identifier of a paid service.
- isActive
If
1
, the subscription to a paid service is active; otherwise,0
.
The following sorting parameter is available for this method:
- createTime
The date and time when a client was subscribed to a paid service.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]api/v2/subscriptions
curl --location -g 'https://host.name/api/v2/subscriptions?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[clientId]=1&filter[serviceId]=1&filter[isActive]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Subscription objects providing information about the subscriptions matching the request parameters.
Get subscription details
Use this method to obtain detailed information about a specific paid service to which a client is subscribed.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- subscriptionId required
The subscription identifier.
GET[host]/api/v2/subscriptions/{subscriptionId}
curl --location 'https://host.name/api/v2/subscriptions/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Subscription object providing information about the specified subscription.
Create a subscription
Use this method to subscribe a client to a paid service.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a new subscription:
- clientId integer required
The client identifier.
- serviceId integer required
The identifier of a paid service to which you want to subscribe a client.
- isActive integer required
If
1
, the subscription to a paid service is active; otherwise,0
.- parameters object
The parameters that you want to specify for the subscription.
POST[host]/api/v2/subscriptions
curl --location --request POST 'https://host.name/api/v2/subscriptions' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"clientId": 1,
"serviceId": 1,
"isActive": 0,
"parameters": {}
}'
Response
A response contains a Subscription object providing information about the created subscription.
Update a subscription
Use this method to update a specified subscription to a paid service.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- subscriptionId required
The subscription identifier.
Body:
The following field values can be updated for a specified subscription:
- isActive integer
If
1
, the subscription to a paid service is active; otherwise,0
.- parameters object
The parameters that you want to specify for the subscription.
PATCH[host]/api/v2/subscriptions/:path-param:`{subscriptionId}
curl --location --request PATCH 'https://host.name/api/v2/subscriptions/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"isActive": 1,
"parameters": {}
}'
Response
A response contains a Subscription object providing information about the subscription that was updated.
Delete a subscription
Use this method to unsubscribe a client from a specified paid service.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- subscriptionId required
The subscription identifier.
DELETE[host]/api/v2/subscriptions/{subscriptionId}
curl --location --request DELETE 'https://host.name/api/v2/subscriptions/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of paid-service groups
Use this method to obtain a list of groups that are used to categorize paid services.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- caption
The name of a paid-service group.
- comment
The internal description of a paid-service group.
The following sorting parameter is available for this method:
- id
The identifier of a paid-service group.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/subscriptions/groups
curl --location -g 'https://host.name/api/v2/subscriptions/groups?limit=10&offset=0&sort_order=desc&sort_by=id&filter[caption]=Caption&filter[comment]=Comment' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Paid-Service group objects providing information about the groups matching the request parameters.
Get paid-service group details
Use this method to obtain detailed information about a specified paid-service group.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- groupId required
The identifier of a paid-service group.
GET[host]/api/v2/subscriptions/groups/{groupId}
curl --location 'https://host.name/api/v2/subscriptions/groups/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Paid-Service group object providing information about the specified group.
Create a paid-service group
Use this method to create a new paid-service group.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a new group:
- caption string required
The name of a paid-service group.
- comment string
The internal description of a paid-service group.
POST[host]/api/v2/subscriptions/groups
curl --location --request POST 'https://host.name/api/v2/subscriptions/groups' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "The group description",
"comment": "The group name"
}'
Response
A response contains a Paid-Service group object providing information about the created group.
Update a paid-service group
Use this method to update a specified paid-service group.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- groupId required
The identifier of a paid-service group.
Body:
The following field values can be updated for a group:
- caption string
The name of a paid-service group.
- comment string
The internal description of a paid-service group.
PATCH[host]/api/v2/subscriptions/groups/{groupId}
curl --location --request PATCH 'https://host.name/api/v2/subscriptions/groups/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "The group name",
"comment": "The group description"
}'
Response
A response contains a Paid-Service group object providing information about the group that was updated.
Delete a paid-service group
Use this method to delete a specified paid-service group.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- groupId required
The identifier of a paid-service group.
DELETE[host]/api/v2/subscriptions/groups/{groupId}
curl --location --request DELETE 'https://host.name/api/v2/subscriptions/groups/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of paid-service parameters
Use this method to obtain a list of parameters that can be specified for paid services when subscribing clients to them.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following filter parameters are available for this method:
- name
The service parameter name.
- caption
The service parameter description.
- categoryId
The identifier of a category in which a service parameter is included.
The following sorting parameter is available for this method:
- id
The identifier of a service parameter.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/subscriptions/parameters
curl --location -g 'https://host.name/api/v2/subscriptions/parameters?limit=10&offset=0&sort_order=desc&sort_by=id&filter[caption]=Caption&filter[name]=Name&filter[categoryId]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Paid-Service parameter objects providing information about the retrieved service parameters.
Get paid-service parameter details
Use this method to obtain detailed information about a specific parameter that can be defined when subscribing clients to paid services.
Request
Path parameters:
- parameterId required
The service parameter identifier.
GET[host]/api/v2/subscriptions/parameters/{parameterId}
curl --location 'https://host.name/api/v2/subscriptions/parameters/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Paid-Service parameter object providing information about the specified parameter.
Add a paid-service parameter
Use this method to add a new parameter that can be specified when subscribing clients to paid services.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters:
- name string required
The service parameter name.
- caption string required
The service parameter description.
- categoryId integer required
The identifier of a category in which a parameter is included.
If no category is assigned to a parameter, it can be used by all Back Office users who are allowed to manage paid services.
- type string required
The parameter type. Possible values:
text
numeric
date
select
multiselect
checkbox
spread_sheet
- services array
An array of integer values identifying the paid services for which a parameter can be specified.
- settings object
The value options added for a parameter.
POST[host]/api/v2/subscriptions/parameters
curl --location --request POST 'https://host.name/api/v2/subscriptions/parameters' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Payment period",
"caption": "The parameter description",
"categoryId": 1,
"type": "select",
"services": [
1,
2
],
"settings": {
"options": [
"Weekly",
"Monthly",
"Quarterly",
"Yearly",
]
}
}'
Response
A response body includes a Paid-Service parameter object providing information about the added paid-service parameter.
Update a paid-service parameter
Use this method to update a specified paid-service parameter.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- parameterId required
The service parameter identifier.
Body:
The following field values can be updated for a service parameter:
- name string
The service parameter name.
- caption string
The service parameter description.
- categoryId integer
The identifier of a category in which a parameter is included.
If no category is assigned to a parameter, it can be used by all Back Office users who are allowed to manage paid services.
- type string
The parameter type. Possible values:
text
numeric
date
select
multiselect
checkbox
spread_sheet
- services array
An array of integer values identifying the paid services for which a parameter can be specified.
- settings object
The value options added for a parameter.
PATCH[host]/api/v2/subscriptions/parameters/{parameterId}
curl --location --request PATCH 'https://host.name/api/v2/subscriptions/parameters/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Payment period",
"caption": "The parameter description",
"categoryId": 1,
"type": "select",
"services": [
1,
3
],
"settings": {
"options": [
"Weekly",
"Monthly",
"Quarterly",
]
}
}'
Response
A response includes a Paid-Service parameter object providing information about the parameter that was updated.
Delete a paid-service parameter
Use this method to delete a specified paid-service parameter.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- parameterId required
The service parameter identifier.
DELETE[host]/api/v2/subscriptions/parameters/{parameterId}
curl --location --request DELETE 'https://host.name/api/v2/subscriptions/parameters/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of parameter presets
Use this method to obtain a list of saved parameter presets.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following filter parameters are available for this method:
- name
The name of a parameter preset.
- serviceId
The identifier of a paid service for which a parameter preset can be applied.
The following sorting parameter is available for this method:
- createTime
The date and time when a parameter preset was saved.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/v2/subscriptions/plans
curl --location -g 'https://host.name/api/v2/subscriptions/plans?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[name]=Name&filter[serviceId]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Parameter Preset objects providing information about the presets matching the request parameters.
Get parameter preset details
Use this method to obtain detailed information about a specific parameter preset.
Request
Path parameters:
- planId required
The identifier of a parameter preset.
GET[host]/api/v2/subscriptions/plans/{planId}
curl --location -g 'https://host.name/api/v2/subscriptions/plans/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Parameter Preset object providing information about the specified preset.
Create a parameter preset
Use this method to create a new parameter preset.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters when adding a parameter preset:
- name string required
The name of a parameter preset.
- serviceId integer required
The identifier of a paid service to which a parameter preset can be applied.
- data object
The details about the parameters included in a preset.
POST[host]/api/v2/subscriptions/plans
curl --location --request POST 'https://host.name/api/v2/subscriptions/plans' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Name",
"serviceId": 1,
"data": {}
}'
Response
A response body includes a Parameter Preset object providing information about the added preset.
Update a parameter preset
Use this method to update a specified parameter preset.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- planId required
The identifier of a parameter preset.
Body:
The following field values can be updated for a parameter preset:
- name string
The name of a parameter preset.
PATCH[host]/api/v2/subscriptions/plans/{planId}
curl --location --request PATCH 'https://host.name/api/v2/subscriptions/plans/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Name"
}'
Response
A response includes a Parameter Preset object providing information about the preset that was updated.
Delete a parameter preset
Use this method to delete a parameter preset.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters
- planId required
The identifier of a parameter preset.
DELETE[host]/api/v2/subscriptions/plans/{planId}
curl --location --request DELETE 'https://host.name/api/v2/subscriptions/plans/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of paid services
Use this method to obtain a list of paid services to which clients can be subscribed.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
The following filter parameters are available for this method:
- name
The name of a paid service.
- externalId
The identifier of an external service provider.
- fullName
The full name of a paid service.
- groupId
The identifier of a group in which a paid service is included.
- isActive
If
1
, a paid service is enabled, and clients can be subscribed to it; otherwise,0
.- comment
The internal description of a paid service.
The following sorting parameter is available for this method:
- creteTime
The date and time when a paid service was configured in the Back Office.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/subscriptions/services
curl --location -g 'https://host.name/api/v2/subscriptions/services?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[name]=Name&filter[externalId]=1&filter[fullName]=Name&filter[groupId]=1&filter[isActive]=&filter[comment]=Comment' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Paid Service objects providing information about the paid services matching the request parameters.
Get paid service details
Use this method to obtain detailed information about a specified paid service.
Request
Path parameters:
- serviceId required
The identifier of a paid service.
GET[host]/api/v2/subscriptions/services/{serviceId}
curl --location 'https://host.name/api/v2/subscriptions/services/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Paid Service object providing information about a specified paid service.
Add a paid service
Use this method to add a new paid service to which clients can be subscribed.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters when adding a paid service:
- name string required
The name of a paid service.
- fullName string required
The full name of a paid service.
- groupId integer required
The identifier of a group in which a paid service is included.
- isActive integer required
If
1
, a paid service is enabled, and clients can be subscribed to it; otherwise,0
.- externalId string
The identifier of an external service provider.
- comment string
The internal description of a paid service.
POST[host]/api/v2/subscriptions/services
curl --location --request POST 'https://host.name/api/v2/subscriptions/services' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "The service name",
"fullName": "The full service name",
"groupId": 1,
"isActive": 0,
"externalId": "15",
"comment": "The service description"
}'
Response
A response body includes a Paid Service object providing information about the added paid service.
Update a paid service
Use this method to update a paid service.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- serviceId required
The identifier of a paid service.
Body:
The following field values can be updated for a paid service:
- name string
The name of a paid service.
- externalId string
The identifier of an external service provider.
- fullName string
The full name of a paid service.
- comment string
The internal description of a paid service.
- groupId integer
The identifier of a group in which a paid service is included.
- isActive integer
If
1
, a paid service is enabled, and clients can be subscribed to it; otherwise,0
.
PATCH[host]/api/v2/subscriptions/services/{serviceId}
curl --location --request PATCH 'https://host.name/api/v2/subscriptions/services/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "The service name",
"externalId": "16",
"fullName": "The full service name",
"comment": "The service description",
"groupId": 1,
"isActive": 1
}'
Response
A response includes a Paid Service object providing information about the paid service that was updated.
Delete a paid service
Use this method to delete a paid service from the Back Office.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters
- serviceId required
The identifier of a paid service.
DELETE[host]/api/v2/subscriptions/services/{serviceId}
curl --location --request DELETE 'https://host.name/api/v2/subscriptions/services/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.