Update Subscription Plan
PATCH/plans/:subscriptionPlanId
Updates the specified fields of an existing subscription plan.
The request must provide the following header: x-api-key: {merchantKey}
Request
Path Parameters
Unique Identifier of the created Subscription. Format: Subscription + - + <UUID>
SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620bHeader Parameters
Must be application/json
Must be be en-US
The origin of the request
The client making the request
x-api-key: {merchantKey}
- application/json
- Body
- Example
Bodyrequired
Name of the Subscription Plan
Description of the Subscription Plan
Amount to be billed recurrently
Possible values: <= 60 characters
Currency code. Format: ISO 4217
Period of the trial. Required if trialDurationUnit is provided.
Unit of the trial period. Required if trialDurationPeriod is provided.
Recurrence of the billing occurrences. Required if billingUnit is provided.
Unit of the billing recurrence. Required if billingOccurrence is provided.
Number of the billing occurrences.
Merchant Metadata fields sent during the creation of the Subscription Plan.
Possible values: <= 255 characters
{
"name": "Premium U",
"description": "Premium sub for only 80.9 EUR!",
"recurrentAmount": 80.9,
"currencyIsoCode": "EUR",
"trialDurationPeriod": 1,
"trialDurationUnit": "month",
"billingOccurrence": 1,
"billingUnit": "year",
"billingCycles": 1,
"merchantMetadata": "{\"orderId\": U1asd265jh4, \"usageTracking\": true, \"referenceId\": Us125jkwh2321 }"
}
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Subscription plan updated successfully
- application/json
- Schema
- Example (auto)
Schema
Unique Identifier of the Subscription Plan. Format: SubscriptionPlan + - + <UUID>
SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620bTimestamp of when the Subscription Plan was created.
2021-03-17T17:18:53.01ZTimestamp of when the Subscription Plan was last updated.
2021-03-17T17:18:53.01ZTimestamp of when the Subscription Plan was deleted (if applicable).
Name of the Subscription Plan.
Possible values: <= 255 characters
PremiumDescription of the Subscription Plan.
Possible values: <= 255 characters
Premium sub for only 90.99 EUR!Amount to be billed recurrently.
Possible values: <= 60 characters
90.99Currency code. Format ISO 4217.
Possible values: >= 3 characters and <= 3 characters
EURPeriod of the trial. MinValue 1, MaxValue 28.
Possible values: >= 1 and <= 28
1Unit of the trial period.
Possible values: [day, month, year]
dayRecurrence of the billing occurrences.
1Unit of the billing recurrence.
Possible values: [day, month, year]
monthNumber of the billing occurrences. -1 for unlimited subscription.
Possible values: >= -1 and <= 120
4Always false. Once created, a plan cannot be updated.
falsefalseField that allows the merchant to store specific metadata linked with the subscription plan.
Possible values: <= 255 characters
{"orderId": "1asd265jh4", "usageTracking": false, "referenceId": "s125jkwh2321"}{
"id": "SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620b",
"createdAt": "2021-03-17T17:18:53.01Z",
"updatedAt": "2021-03-17T17:18:53.01Z",
"deletedAt": null,
"name": "Premium",
"description": "Premium sub for only 90.99 EUR!",
"recurrentAmount": 90.99,
"currencyIsoCode": "EUR",
"trialDurationPeriod": 1,
"trialDurationUnit": "day",
"billingUnit": "month",
"billingOccurrence": 1,
"billingCycles": 4,
"prepaid": false,
"merchantMetadata": "{\"orderId\": \"1asd265jh4\", \"usageTracking\": false, \"referenceId\": \"s125jkwh2321\"}"
}
Bad Request
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
Internally generated trace_id for this error message so it can be found easily in the logs.
errors object[]
A predefined string which describes the error. The purpose of the message is to allow for future usage of translation.
A pre-defined code from the list of error codes.
The property from the request object which the error is linked to.
context object
A json object containing a list of predefined properties which are filled based on the error.
{
"traceId": "string",
"errors": [
{
"message": "string",
"code": "string",
"property": "string",
"context": {
"type": "string",
"minimum": 0,
"maximum": 0,
"maxLength": 0,
"allowedValues": [
"string"
]
}
}
]
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Value out of bounds. Value must be between 1 and 100",
"code": "value_out_of_bounds",
"property": "someField",
"context": {
"minimum": 1,
"maximum": 100
}
}
]
}
Unauthenticated
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
Internally generated trace_id for this error message so it can be found easily in the logs.
errors object[]
A predefined string which describes the error. The purpose of the message is to allow for future usage of translation.
A pre-defined code from the list of error codes.
The property from the request object which the error is linked to.
context object
A json object containing a list of predefined properties which are filled based on the error.
{
"traceId": "string",
"errors": [
{
"message": "string",
"code": "string",
"property": "string",
"context": {
"type": "string",
"minimum": 0,
"maximum": 0,
"maxLength": 0,
"allowedValues": [
"string"
]
}
}
]
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "You are not authenticated to perform this request.",
"code": "unauthorized"
}
]
}
Forbidden
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
Internally generated trace_id for this error message so it can be found easily in the logs.
errors object[]
A predefined string which describes the error. The purpose of the message is to allow for future usage of translation.
A pre-defined code from the list of error codes.
The property from the request object which the error is linked to.
context object
A json object containing a list of predefined properties which are filled based on the error.
{
"traceId": "string",
"errors": [
{
"message": "string",
"code": "string",
"property": "string",
"context": {
"type": "string",
"minimum": 0,
"maximum": 0,
"maxLength": 0,
"allowedValues": [
"string"
]
}
}
]
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "You do not have permissions to perform this request.",
"code": "forbidden"
}
]
}
Not Found
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
Internally generated trace_id for this error message so it can be found easily in the logs.
errors object[]
A predefined string which describes the error. The purpose of the message is to allow for future usage of translation.
A pre-defined code from the list of error codes.
The property from the request object which the error is linked to.
context object
A json object containing a list of predefined properties which are filled based on the error.
{
"traceId": "string",
"errors": [
{
"message": "string",
"code": "string",
"property": "string",
"context": {
"type": "string",
"minimum": 0,
"maximum": 0,
"maxLength": 0,
"allowedValues": [
"string"
]
}
}
]
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Resource not found.",
"code": "not_found"
}
]
}
Internal Server Error
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
Internally generated trace_id for this error message so it can be found easily in the logs.
errors object[]
A predefined string which describes the error. The purpose of the message is to allow for future usage of translation.
A pre-defined code from the list of error codes.
The property from the request object which the error is linked to.
context object
A json object containing a list of predefined properties which are filled based on the error.
{
"traceId": "string",
"errors": [
{
"message": "string",
"code": "string",
"property": "string",
"context": {
"type": "string",
"minimum": 0,
"maximum": 0,
"maxLength": 0,
"allowedValues": [
"string"
]
}
}
]
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Internal server error."
}
]
}