Praxis Wiki logo

Update Subscription Plan

PUT /api/v1.3/subscription-plan/{planId} method is your endpoint to update an existing subscription plan. Plan ID should be sent as a part of the URL.

The following parameters will be available for updating:

  1. name
  2. description
  3. subscription_plan_status
    The list of possible options:
    active - to activate the subscription (move to the status active)
    inactive - to deactivate the subscription (move to the status inactive)
    deleted - to delete the subscription (move to the status deleted)
    New subscriptions cannot be created using plans that have an inactive status.

ENDPOINTS

Name URL
Sandbox https://pci-gw-test.praxispay.com/api/v1.3/subscription-plan/{planId}
Live https://gw.praxisgate.com/api/v1.3/subscription-plan/{planId}

REQUEST PARAMS

✓ - required value
? - optional, value or null
✕ - always appears as null

Variable Type Description
merchant_id varchar(50) Merchant API client account identifier
application_key varchar(32) Identifier of your application (website)
name varchar(32) ? Subscription plan name
description varchar(256) ? Description of the subscription plan
subscription_plan_status varchar(8) ? Subscription Plan status
version varchar(4) API version. Default value - v1.3
timestamp int(11) Response time (unix timestamp, seconds)

RESPONSE PARAMS

Variable Type Description
status int API communication status -
- 0 if the request was successful
- Negative integer if internal server/network error occurs
- Positive integer if application/logical error occurs
description varchar(256) Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production
plan_id varchar(32) Subscription Plan ID
prices varchar(256) Options with the amount/currency pairs in the subscription plan. Here is possible multiple pairs with different prices for different currencies. The currency parameter should be unique, meaning the record with two identical currencies cannot be created. The system should allow configuring only the currencies that exist in merchants gateway settings, considering only the gateways with MIT enabled.
subscription_plan_status varchar(8) ? Subscription Plan status
version varchar(3) API version
timestamp int(11) Response time (unix timestamp, seconds)

Signature

To execute the request, it is necessary to undergo the authentication process. The general authentication algorithm can be found in the Authentication section.

Request signature parameters

  1. merchant_id
  2. application_key
  3. timestamp

Response signature parameters

  1. status
  2. timestamp

Example

Request

{
  "merchant_id": "API-Merchant",
  "application_key": "test-application",
  "name": "Updated plan name",
  "description": "Updated plan description",
  "subscription_plan_status": "inactive",
  "version": 1.3,
  "timestamp": 1680712861
}

Response (successful scenario)

{
  "status": 0,
  "description": "Subscription plan updated successfully.",
  "plan_id": "i2VANeFxKR1aZGoH",
  "prices": [
    {
      "price_id": "1A8Nxpaf",
      "amount": 20000,
      "currency": "EUR"
    },
    {
      "price_id": "JWolofvu",
      "amount": 19800,
      "currency": "USD"
    },
    {
      "price_id": "0wvCJ1aU",
      "amount": 93500,
      "currency": "PLN"
    }
  ],
  "subscription_plan_status": "inactive",
  "version": 1.3,
  "timestamp": 1680712861
}

Response (unsuccessful scenario)

{
  "status": -1,
  "description": "Validation failed. Application Key cannot be empty."
}