Update Subscription Plan
Request parameters
Field | Description | Type | Length | Mandatory |
---|---|---|---|---|
name | Name of the Subscription Plan | String | 255 | No |
description | Description of the Subscription Plan | String | 255 | No |
recurrentAmount | Amount to be billed recurrently | Double | 18.2 | No |
currencyIsoCode | Currency code. | String | 3 | No |
trialDurationPeriod | Period of the trial. Required if trialDurationUnit is provided. | Int | 2 | Conditional |
trialDurationUnit | Unit of the trial period. Required if trialDurationPeriod is provided. | String | 5 | Conditional |
billingOccurrence | Recurrence of the billing occurrences. Required if billingUnit is provided. | Int | 2 | Conditional |
billingUnit | Unit of the billing recurrence. Required if billingOccurrence is provided. | String | 5 | Conditional |
billingCycles | Number of the billing occurrences. | Int | 2 | No |
merchantMetadata | Merchant Metadata fields sent during the creation of the Subscription Plan. | String | 255 | No |
info
The request must provide the following header:
x-api-key: {merchantKey}
Request sample
Path:
PATCH {baseURL}/plans/SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620b
Header:
Content-Type: application/json
Accept-Language: en-US
{
"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,
"prepaid": false,
"merchantMetadata": "{\"orderId\": U1asd265jh4, \"usageTracking\": true, \"referenceId\": Us125jkwh2321 }"
}
Response parameters
Field | Description | Type | Length | Mandatory |
---|---|---|---|---|
id | Unique Identifier of the created Subscription Plan. Format: "SubscriptionPlan" + "-" + <UUID> | String | 53 | Yes |
createdAt | Timestamp of when the Subscription Plan was created. Format: yyyy-MM-dd'T'HH:mm:ss.SS'Z | DateTime | 24 | Yes |
updatedAt | Timestamp of when the Subscription Plan was last updated. Format: yyyy-MM-dd'T'HH:mm:ss.SS'Z | DateTime | 24 | Yes |
deletedAt | Timestamp of when the Subscription Plan was deleted (if applicable). Format: yyyy-MM-dd'T'HH:mm:ss.SS'Z | DateTime | 24 | Yes |
name | Name of the Subscription Plan. | String | 255 | Yes |
description | Description of the Subscription Plan. | String | 255 | Yes |
recurrentAmount | Amount to be billed recurrently. | Double | 18.2 | Yes |
currencyIsoCode | Currency code. | String | 3 | Yes |
trialDurationPeriod | Period of the trial. | Int | 2 | Conditional |
trialDurationUnit | Unit of the trial period. | String | 5 | Conditional |
billingOccurrence | Recurrence of the billing occurrences. | Int | 2 | Yes |
billingUnit | Unit of the billing recurrence. | String | 5 | Yes |
billingCycles | Number of the billing occurrences. | Int | 2 | Yes |
prepaid | TRUE by default in current version. | Boolean | 5 | No |
merchantMetadata | Merchant Metadata fields sent during the creation of the Subscription Plan. | String | 255 | No |
Response sample
Status Code: 200 (OK)
Header:
Content-Type: application/json
Accept-Language: en-US
{
"id": "SubscriptionPlan-a2a88967-db66-481d-9f29-00e684866cd6",
"createdAt": "2021-03-18T08:53:56.65Z",
"updatedAt": "2021-03-18T08:55:20.85Z",
"deletedAt": null,
"name": "Premium U",
"description": "Premium sub for only 80.9 EUR!",
"recurrentAmount": 80.90,
"currencyIsoCode": "EUR",
"trialDurationPeriod": 1,
"trialDurationUnit": "month",
"billingUnit": "year",
"billingOccurrence": 1,
"billingCycles": 1,
"prepaid": true,
"merchantMetadata": "{\"orderId\": U1asd265jh4, \"usageTracking\": true, \"referenceId\": Us125jkwh2321 }"
}
info
For error handling, please refer to this section.