Skip to main content

Update Subscription Plan

Request parameters

FieldDescriptionTypeLengthMandatory
nameName of the Subscription PlanString255No
descriptionDescription of the Subscription PlanString255No
recurrentAmountAmount to be billed recurrentlyDouble18.2No
currencyIsoCodeCurrency code.String3No
trialDurationPeriodPeriod of the trial. Required if trialDurationUnit is provided.Int2Conditional
trialDurationUnitUnit of the trial period. Required if trialDurationPeriod is provided.String5Conditional
billingOccurrenceRecurrence of the billing occurrences. Required if billingUnit is provided.Int2Conditional
billingUnitUnit of the billing recurrence. Required if billingOccurrence is provided.String5Conditional
billingCyclesNumber of the billing occurrences.Int2No
merchantMetadataMerchant Metadata fields sent during the creation of the Subscription Plan.String255No
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

FieldDescriptionTypeLengthMandatory
idUnique Identifier of the created Subscription Plan. Format: "SubscriptionPlan" + "-" + <UUID>String53Yes
createdAtTimestamp of when the Subscription Plan was created. Format: yyyy-MM-dd'T'HH:mm:ss.SS'ZDateTime24Yes
updatedAtTimestamp of when the Subscription Plan was last updated. Format: yyyy-MM-dd'T'HH:mm:ss.SS'ZDateTime24Yes
deletedAtTimestamp of when the Subscription Plan was deleted (if applicable). Format: yyyy-MM-dd'T'HH:mm:ss.SS'ZDateTime24Yes
nameName of the Subscription Plan.String255Yes
descriptionDescription of the Subscription Plan.String255Yes
recurrentAmountAmount to be billed recurrently.Double18.2Yes
currencyIsoCodeCurrency code.String3Yes
trialDurationPeriodPeriod of the trial.Int2Conditional
trialDurationUnitUnit of the trial period.String5Conditional
billingOccurrenceRecurrence of the billing occurrences.Int2Yes
billingUnitUnit of the billing recurrence.String5Yes
billingCyclesNumber of the billing occurrences.Int2Yes
prepaidTRUE by default in current version.Boolean5No
merchantMetadataMerchant Metadata fields sent during the creation of the Subscription Plan.String255No

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.