Skip to main content

Update Subscription Plan

PATCH 

/plans/:subscriptionPlanId

Updates the specified fields of an existing subscription plan.

info

The request must provide the following header: x-api-key: {merchantKey}

Request​

Path Parameters

    subscriptionPlanId stringrequired

    Unique Identifier of the created Subscription. Format: Subscription + - + <UUID>

    Example: SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620b

Header Parameters

    Content-Type stringrequired

    Must be application/json

    Accept-Language stringrequired

    Must be be en-US

    Origin stringrequired

    The origin of the request

    User-Agent stringrequired

    The client making the request

    x-api-key stringrequired

    x-api-key: {merchantKey}

Bodyrequired

    namestring

    Name of the Subscription Plan

    descriptionstring

    Description of the Subscription Plan

    recurrentAmountnumber<decimal>

    Amount to be billed recurrently

    Possible values: <= 60 characters

    currencyIsoCodestring

    Currency code. Format: ISO 4217

    trialDurationPeriodintegernullable

    Period of the trial. Required if trialDurationUnit is provided.

    trialDurationUnitstringnullable

    Unit of the trial period. Required if trialDurationPeriod is provided.

    billingOccurrenceintegernullable

    Recurrence of the billing occurrences. Required if billingUnit is provided.

    billingUnitstringnullable

    Unit of the billing recurrence. Required if billingOccurrence is provided.

    billingCyclesinteger

    Number of the billing occurrences.

    merchantMetadatastringnullable

    Merchant Metadata fields sent during the creation of the Subscription Plan.

    Possible values: <= 255 characters

Responses​

Subscription plan updated successfully

Schema
    idstring

    Unique Identifier of the Subscription Plan. Format: SubscriptionPlan + - + <UUID>

    Example: SubscriptionPlan-12033695-99d8-4dc6-bf51-db64ef27620b
    createdAtstring<date-time>

    Timestamp of when the Subscription Plan was created.

    Example: 2021-03-17T17:18:53.01Z
    updatedAtstring<date-time>

    Timestamp of when the Subscription Plan was last updated.

    Example: 2021-03-17T17:18:53.01Z
    deletedAtstring<date-time>nullable

    Timestamp of when the Subscription Plan was deleted (if applicable).

    namestringrequired

    Name of the Subscription Plan.

    Possible values: <= 255 characters

    Example: Premium
    descriptionstringrequired

    Description of the Subscription Plan.

    Possible values: <= 255 characters

    Example: Premium sub for only 90.99 EUR!
    recurrentAmountnumber<decimal>required

    Amount to be billed recurrently.

    Possible values: <= 60 characters

    Example: 90.99
    currencyIsoCodestringrequired

    Currency code. Format ISO 4217.

    Possible values: >= 3 characters and <= 3 characters

    Example: EUR
    trialDurationPeriodinteger

    Period of the trial. MinValue 1, MaxValue 28.

    Possible values: >= 1 and <= 28

    Example: 1
    trialDurationUnitstring

    Unit of the trial period.

    Possible values: [day, month, year]

    Example: day
    billingOccurrenceintegerrequired

    Recurrence of the billing occurrences.

    Example: 1
    billingUnitstringrequired

    Unit of the billing recurrence.

    Possible values: [day, month, year]

    Example: month
    billingCyclesintegerrequired

    Number of the billing occurrences. -1 for unlimited subscription.

    Possible values: >= -1 and <= 120

    Example: 4
    prepaidboolean

    Always false. Once created, a plan cannot be updated.

    Default value: false
    Example: false
    merchantMetadatastringnullable

    Field that allows the merchant to store specific metadata linked with the subscription plan.

    Possible values: <= 255 characters

    Example: {"orderId": "1asd265jh4", "usageTracking": false, "referenceId": "s125jkwh2321"}