Get subscription interface returns all details about defined subscription through HTTP Get method. The response body is same as that of defined subscription interface.
Environment
Path: {base_url}/api/sub/v1/merchant/subscriptions/{subscriptionId}
HTTP Method: GET
Request parameters
Header
| Parameter | Description |
|---|---|
| X-PayU-_ _Subscription- Signature mandatory | SHA512 Signature generated by encrypting request parameters in body by Merchant Key, Merchant Salt and Subscription Id. |
merchantIdmandatory | Merchant Key received during onboarding.
|
Sample request
curl --location 'https://subscription.payu.in/api/sub/v1/merchant/subscriptions/5dbffd362fc4f8363c4fd397' \
--header 'Authorization: Bearer 810aa8723c4a626bf2c157e50204aebca72d33e9f2bf350e29eade8ae912c703' \
--header 'merchantId: 0BVomn' \
--header 'X-PayU-Subscription-Signature: 36c0c4b22d1c616237d518c939107e3b01ed14c32147f2c79232444392e0656b040782af69cef7e0640a3f7868145695be3903eb2692a8ef5b68e4bf0a1803ff' \
--header 'Content-Type: application/json' \
--header 'Cookie: PHPSESSID=jp38t4gvop7ami1ksncksj398v; USERTXNINFO=68ed4df291d9b7.27710642'
Sample response
{
"subscriptionId": "5dbffd362fc4f8363c4fd397",
"createdDate": "2019-11-04T04:58:06.000012Z",
"modifiedDate": "2023-11-08T13:03:54.000724Z",
"subscriptionPlans": [
{
"planId": "ZION15728632860122",
"startDate": "2019-12-03T00:00:00.000Z",
"totalCount": 60,
"numberOfPaidInvoices": 0,
"numberOfInvoiceGenerated": 46,
"status": "Forced_Cancel",
"deleted": false,
"nextBillingDates": "2023-10-03T00:00:00Z",
"lastPaymentDates": "2020-09-03T00:00:00Z",
"billingInterval": 1,
"billingCycle": "MONTHLY",
"planName": "ZION15728632860122",
"amount": {
"value": 69.00,
"currency": "INR"
}
}
],
"status": "Forced_Cancel",
"authRefId": "403993715520071757",
"subscriberEmail": "[email protected]",
"subscriberMobile": "5412345026",
"paymentOption": {},
"freeTrial": false,
"setupAmount": {
"value": 0.00
},
"customParameter": {
"memUUID": "38050cdb-b145-4d5a-8a77-7605df72f5ee"
},
"possibleActions": [
{
"action": "Update Subscription",
"href": "{{base-url}}/api/sub/v1/subscription/5dbffd362fc4f8363c4fd397",
"httpMethod": "PATCH"
},
{
"action": "Delete Subscription",
"href": "{{base-url}}/api/sub/v1/subscription/5dbffd362fc4f8363c4fd397",
"httpMethod": "DELETE"
}
],
"requestId": "403993715520071757"
}
Response parameters
| Parameter | Description | Example |
|---|---|---|
subscriptionId | Unique identifier for the subscription | "5dbffd362fc4f8363c4fd397" |
createdDate | ISO 8601 timestamp when the subscription was created | "2019-11-04T04:58:06.000012Z" |
modifiedDate | ISO 8601 timestamp when the subscription was last modified | "2023-11-08T13:03:54.000724Z" |
subscriptionPlans | Array of subscription plan objects. For more information, refer to Refer to subscriptionPlans JSON object fields table. | Refer to subscriptionPlans JSON object fields table. |
status | Overall status of the subscription | "Forced_Cancel" |
authRefId | Authorization reference ID | "403993715520071757" |
subscriberEmail | Email address of the subscriber | "[email protected]" |
subscriberMobile | Mobile number of the subscriber | "5412345026" |
paymentOption | Payment method details (object) | {} |
freeTrial | Boolean indicating if this includes a free trial. By default, it is false. | false |
setupAmount | One-time setup fee object | {"value": 0.00} |
customParameter | Custom parameters passed during subscription creation | {"memUUID": "38050cdb-b145-4d5a-8a77-7605df72f5ee"} |
possibleActions | Array of available actions for this subscription. For more information, refer to Refer to possibleActions JSON object fields table. | Refer to possibleActions JSON object fields table. |
requestId | Unique identifier for this API request | "403993715520071757" |
subscriptionPlans JSON object fields
Example JSON object
{
"planId": "ZION15728632860122",
"startDate": "2019-12-03T00:00:00.000Z",
"totalCount": 60,
"numberOfPaidInvoices": 0,
"numberOfInvoiceGenerated": 46,
"status": "Forced_Cancel",
"deleted": false,
"nextBillingDates": "2023-10-03T00:00:00Z",
"lastPaymentDates": "2020-09-03T00:00:00Z",
"billingInterval": 1,
"billingCycle": "MONTHLY",
"planName": "ZION15728632860122",
"amount": {
"value": 69.00,
"currency": "INR"
}
}Field descriptions
| Parameter | Description | Example |
|---|---|---|
planId | Unique identifier for the subscription plan | "ZION15728632860122" |
startDate | ISO 8601 timestamp when the plan started | "2019-12-03T00:00:00.000Z" |
totalCount | Total number of billing cycles planned | 60 |
numberOfPaidInvoices | Number of successfully paid invoices | 0 |
numberOfInvoiceGenerated | Total number of invoices generated | 46 |
status | Current status of the subscription plan | "Forced_Cancel" |
deleted | Boolean indicating if the plan is deleted | false |
nextBillingDates | ISO 8601 timestamp for the next billing date | "2023-10-03T00:00:00Z" |
lastPaymentDates | ISO 8601 timestamp of the last successful payment | "2020-09-03T00:00:00Z" |
billingInterval | Frequency of billing (number of cycles) | 1 |
billingCycle | Billing cycle type. It can be any of the following:
| "MONTHLY" |
planName | Name of the subscription plan | "ZION15728632860122" |
amount | Billing amount object with value and currency | {"value": 69.00, "currency": "INR"} |
amount.value | Amount to be charged per billing cycle | 69.00 |
amount.currency | Currency code for the amount | "INR" |
possibleActions JSON object fields
Example JSON
{
"action": "Update Subscription",
"href": "{{base-url}}/api/sub/v1/subscription/5dbffd362fc4f8363c4fd397",
"httpMethod": "PATCH"
},
{
"action": "Delete Subscription",
"href": "{{base-url}}/api/sub/v1/subscription/5dbffd362fc4f8363c4fd397",
"httpMethod": "DELETE"
}Field descriptions
| Parameter | Description | Example |
|---|---|---|
action | Name of the available action | "Update Subscription" |
href | API endpoint URL for the action | "{{base-url}}/api/sub/v1/subscription/5dbffd362fc4f8363c4fd397" |
httpMethod | HTTP method required for the action | "PATCH" |
