Create SBMD-Enabled Subscription
POST
/ps/public/subscriptions/sbmdEndpoint used by CMS to create subscription with SBMD enabled
Requires
Bearer token. Get token →Header Parameters
| Field | Details |
|---|---|
Request-Timestampstringdate-time | ISO 8601 UTC timestamp of the request. Used for idempotency and audit. |
Request-IDstring | Use a global unique identifier [GUID] for the request. Constraints Minimum length: 1 characterMaximum length: 50 characters |
Request Bodyrequired
| Field | Details |
|---|---|
merchant_subscription_referencestringrequired | Unique reference ID for the subscription provided by the merchant Constraints Minimum length: 1 character |
customer_idstringrequired | Unique identifier for the customer associated with the subscription |
plan_detailsobjectrequired4 nested fields | |
callback_urlstring | URL |
expire_afterinteger | duration after which subscription expires Constraints Minimum value: 1 |
terms_acceptedboolean | pending Constraints Default value: true |
merchant_metadataobject | A key-value pair of merchant-specific metadata. Constraints Additional properties: string |
Response
| Field | Details |
|---|---|
subscription_idstring | Unique identifier for the created subscription |
order_idstring | order_id for the created order |
customer_idstring | customer_id passed |
statusstring | Current status of the subscription after creation |
start_datestringdate-time | Subscription start timestamp |
end_datestringdate-time | Subscription end timestamp |
plan_detailsobject4 nested fields | |
reserve_amountintegerrequired | Amount to be reserved |
currencystringrequired | Currency code for the subscription Allowed values: INRUSD |
validity_daysintegerrequired | Validity of the subscription in days Constraints Minimum value: 1Maximum value: 365 |
descriptionstringrequired | Description of the SBMD Plan |
expires_atstringdate-time | |
redirect_urlstring | RedirectURL |
Status Codes
200 | Success |
400 | Bad Requet |
500 | Internal Server Error |
Request
curl --request POST \
--url https://pluraluat.v2.pinepg.in/ps/public/subscriptions/sbmd \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'Request-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
--header 'Request-Timestamp: 2024-10-01T10:30:00Z' \
--data '{
"merchant_subscription_reference": "sub_ref_12345",
"customer_id": "cust_abc123",
"plan_details": {
"reserve_amount": 10000,
"currency": "INR",
"validity_days": 0,
"description": "your_description"
},
"merchant_metadata": {
"key1": "DD",
"key2": "XOF"
}
}'{
"subscription_id": "sub_xyz789",
"status": "ACTIVE",
"plan_details": {
"reserve_amount": 10000,
"currency": "INR",
"validity_days": 0,
"description": "your_description"
}
}