GET
/
api
/
v1
/
server-to-server-interface
/
subscription
/
{subscription_id}
curl --request GET \
  --url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/subscription/{subscription_id} \
  --header 'Authorization: <api-key>' \
  --header 'x-api-key: <api-key>'
{
  "success": true,
  "status_code": 200,
  "is_live": false,
  "subscription_details": {
    "id": "664dc930-88bd-4696-8807-5e0f1fedba0b",
    "type": "CYCLE",
    "max_cycle_count": 10,
    "status": "ACTIVE",
    "completed_payment_cycle": 1,
    "last_payment_status": "SUCCESSFUL",
    "next_payment_date": "2024-11-28T01:31:29.154Z",
    "next_payment_cycle": 2,
    "subscription_plan_details": {
      "name": "Three weeks plan",
      "desc": "Billed every two days",
      "billing_cycle_type": "DAYS",
      "billing_cycle_interval": 2,
      "amount": 1000,
      "ccy": "JPY",
      "trial_period_duration": "",
      "trial_period_duration_type": "NONE",
      "plan_discount_percentage": 10,
      "plan_discount_duration": 2
    },
    "subscription_transaction_details": [
      {
        "id": "359f39bd-673a-47b3-b9ec-cbd6cd313b8e",
        "ref": 74860,
        "cycle": 1,
        "status": "SUCCESSFUL",
        "transaction_date": "2024-11-26T01:31:29.000Z",
        "amount": 900,
        "ccy": "JPY",
        "event": "CAPTURED"
      }
    ]
  }
}

Key Points

Retrieve Detailed Subscription Data:

  • This API provides comprehensive information on an individual subscription, such as:

  • Subscription ID

  • Plan Name and Description

  • Status (active, expired, cancelled)

  • Start Date, End Date, and Next Billing Date

  • Cycle Interval (e.g., monthly, every 2 days)

  • Trial Period and Discount Information

  • Billing History: Details of past payments, including amounts and dates

Subscription ID

  • The Subscription ID must be provided in the URL to retrieve the details of a specific subscription.

Authorizations

Authorization
string
header
required

API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'

x-api-key
string
header
required

API Key specific to x-api-key.

Path Parameters

subscription_id
string
required

The Subscription ID of the subscription. Example: 664dc930-88bd-4696-8807-5e0f1fedba0b.

Maximum length: 36

Response

200 - application/json
A successful response containing the subscription details.
success
boolean

Indicates whether the transaction was successful.

Example:

true

status_code
integer

The HTTP status code of the response.

Example:

200

is_live
boolean

Indicates if the transaction is live or a test transaction.

Example:

false

subscription_details
object

Details of the subscription.