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>
Header 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
required
Name of the Subscription Plan
Description of the Subscription Plan
Possible values: <= 60 characters
Amount to be billed recurrently
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.
Possible values: <= 255 characters
Merchant Metadata fields sent during the creation of the Subscription Plan.
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Subscription plan updated successfully
- application/json
- Schema
- Example (from schema)
Schema
Unique Identifier of the Subscription Plan. Format: SubscriptionPlan + - + <UUID>
Timestamp of when the Subscription Plan was created.
Timestamp of when the Subscription Plan was last updated.
Timestamp of when the Subscription Plan was deleted (if applicable).
Possible values: <= 255 characters
Name of the Subscription Plan.
Possible values: <= 255 characters
Description of the Subscription Plan.
Possible values: <= 60 characters
Amount to be billed recurrently.
Possible values: >= 3 characters
and <= 3 characters
Currency code. Format ISO 4217.
Possible values: >= 1
and <= 28
Period of the trial. MinValue 1, MaxValue 28.
Possible values: [day
, month
, year
]
Unit of the trial period.
Recurrence of the billing occurrences.
Possible values: [day
, month
, year
]
Unit of the billing recurrence.
Possible values: >= -1
and <= 120
Number of the billing occurrences. -1 for unlimited subscription.
Always false
. Once created, a plan cannot be updated.
Possible values: <= 255 characters
Field that allows the merchant to store specific metadata linked with the subscription plan.
{
"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 (from schema)
- 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 (from schema)
- 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 (from schema)
- 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 (from schema)
- 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 (from schema)
- 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."
}
]
}