Praxis Wiki logo

Get Available Subscription Plans

GET /api/v1.3/subscription-plan/search method is your endpoint to get the list of available subscriptions plans (with status active and inactive, without the records with deleted status)

ENDPOINTS

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

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)
plan_id varchar(32) ? Subscription Plan ID
name varchar(32) ? Subscription plan name
billing_cycle varchar(14) ? The frequency of charging within the subscription plan. List of possible values:
- Weekly (weekly)
- Monthly (monthly)
- Every 3 months (every_3_months)
- Every 6 months (every_6_months)
- Yearly (yearly)
trial_period int(2) ? Number of days/months without charging the client. List of possible values:
- null - meaning the trial period is not enabled
- [1, 2, 3, … N] - the number of days/months without charging
currency varchar(256) ? Price currency. Can contain multiple values. Example: USD,EUR
subscription_plan_status varchar(8) ? Subscription Plan status
sort varchar(32) ? In case the value starts from minus (-), this means sorting by DESC
page int(3) ? Current results page
per-page int(3) ? Count of entities for one page
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
plans string Array of result of plans search query
page int(3) ? Current results page
per-page int(3) ? Count of entities for one page
pages_count int(3) Count of pages in result
records_count int(3) Count of entities in full result
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

/api/v1.3/subscription-plan/search?
merchant_id=API-Merchant&
application_key=test-application&
name=plan&
trial_period=1&
currency=USD,EUR&
status=active&
sort=application_key&
page=0&
per_page=20&
version=1.3&
timestamp=1680712861

Response (successful scenario)

{
  "status": 0,
  "description": "Subscription plans fetched successfully.",
  "plans": [
    {
      "plan_id": "i2VANeFxKR1aZGoH",
      "application_key": "test-application",
      "name": "Plan 1",
      "description": "Basic plan for casino",
      "billing_cycle": "weekly",
      "prices": [
        {
          "price_id": "1A8Nxpaf",
          "amount": 20000,
          "currency": "EUR"
        },
        {
          "price_id": "JWolofvu",
          "amount": 19800,
          "currency": "USD"
        },
        {
          "price_id": "0wvCJ1aU",
          "amount": 93500,
          "currency": "PLN"
        }
      ],
      "trial_period": 14,
      "trial_period_cycle": "days",
      "expiration_cycles": 12,
      "retries_number": 3,
      "retries_delay_days": 1,
      "subscription_status_failed_payments": "inactive",
      "inactive_subscription_lifetime": 14,
      "subscription_plan_status": "active",
      "created_at": 1680712861,
      "updated_at": 1680723151
    },
    {
      "plan_id": "yUqO6XZC3uvDukFF",
      "application_key": "test-application",
      "name": "Plan 2",
      "description": "Basic plan for streaming service",
      "billing_cycle": "monthly",
      "prices": [
        {
          "price_id": "KdGw29Fc",
          "amount": 4000,
          "currency": "EUR"
        },
        {
          "price_id": "BwIkLfhR",
          "amount": 39600,
          "currency": "USD"
        },
        {
          "price_id": "wimNgR4J",
          "amount": 187000,
          "currency": "PLN"
        }
      ],
      "trial_period": 7,
      "trial_period_cycle": "days",
      "expiration_cycles": 12,
      "retries_number": 3,
      "retries_delay_days": 1,
      "subscription_status_failed_payments": "inactive",
      "inactive_subscription_lifetime": 7,
      "subscription_plan_status": "active",
      "created_at": 1680712861,
      "updated_at": 1680723151
    },
  ],
  "page": 0,
  "per_page": 20,
  "pages_count": 13,
  "records_count": 250,
  "version": 1.3,
  "timestamp": 1680712861
}

Response (unsuccessful scenario)

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