Subscription Query
Request URL
HTTP
https://{{gateway_domain}}/pg/v2/payment/subscription/queryRequest Parameters
HTTP Method
POST
HTTP Header
| Field | Data Type | Length Limit | Required | Description |
|---|---|---|---|---|
| Content-Type | String | N/A | YES | This field value only supports application/json. |
| Accept | String | N/A | YES | This field value only supports application/json. |
| Authorization | String | YES | Authorization: {type} {credentials}, refer to the Signature specification |
HTTP Body
| Field | Data Type | Length Limit | Required | Description |
|---|---|---|---|---|
| merchantSubscriptionNo | String | 50 | Choose one of merchantSubscriptionNo, subscriptionNo | Merchant subscription number |
| subscriptionNo | String | 32 | Choose one of merchantSubscriptionNo, subscriptionNo | Platform subscription number |
Response Data
HTTP Header
| Field | Data Type | Required | Description |
|---|---|---|---|
| Content-Type | String | YES | This field value only supports application/json. |
| Authorization | String | YES | Authorization: {type} {credentials}, refer to the Signature specification |
HTTP Body
| Field | Data Type | Required | Description |
|---|---|---|---|
| code | String | YES | |
| message | |||
| data | JSON Object |
Description of data field
| Field | Data Type | Description |
|---|---|---|
| subscription | JSON Object | Subscription master data |
| currentCycle | JSON Object | Current cycle data |
- subscription parameter structure
| Field | Data Type | Description |
|---|---|---|
| subscriptionNo | String | Subscription number |
| merchantSubscriptionNo | String | Merchant subscription number |
| status | String | Subscription master status |
| merchantAttach | String | If used in the request, it will be returned |
| createdTime | String | Subscription creation time |
- currentCycle parameter structure
- This value is only available when the event is
SUBSCRIPTION.ACTIVATEDorSUBSCRIPTION.CHARGED.
- This value is only available when the event is
| Field | Data Type | Description |
|---|---|---|
| status | String | Subscription cycle status |
| cycleNo | String | Unique code for one cycle |
| paymentNo | String | Payment platform transaction number (no payment number in trial period) |
| amount | String | Amount for the current period |
| currency | String | Currency for the current period |
| cycleIndex | String | Current cycle index |
| rrn | String | Channel retrieval reference number |
| chargedTime | String | Time of charge for the current subscription period |
Examples
Request
HTTP
curl https://{{gateway_domain}}/pg/v2/payment/subscription/query \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H 'Authorization: V2_SHA256 appId=1111b620f93b48c5904210ff47bb1111,sign=9e494e8a91bcdd08f18ad5b2cfdbfd5654f5c00c89f8216eebd7c1637b6ce01b,timestamp=1714128828114,nonce=C7CA27DC6D55DA935DFC8450C721CC99' \
-d '{
"merchantSubscriptionNo": "MSN-1162"
}'Response
HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Server: nginx/1.18.0
Date: Mon, 06 Mar 2024 12:00:00 GMT
Authorization: V2_SHA256 appId=1111b620f93b48c5904210ff47bb1111,sign=ac6ae72f8c46f5c2092c3dab9bb0e08b6cdb6d5e7ff8ad190499a8955d57f297,timestamp=1714128245401,nonce=28FA11BF8FD1309767551B4FD8A57BD5
{
"code": "OK",
"errorMessage": null,
"data": {
"subscription": {
"status": "CHARGED",
"subscriptionNo": "20240423221044300800001096000005",
"merchantSubscriptionNo": "MSN-1162",
"merchantAttach": null,
"createdTime": "2024-04-23T22:10:45+08:00",
},
"currentCycle": {
"status": "CHARGED",
"cycleNo": "20240423221044300800001096000005",
"amount": "1.00",
"currency": "RUB",
"cycleIndex": 2,
"rrn": "1234567890",
"chargeTime": "2025-04-23T22:10:45+08:00"
}
}
}Subscription Master Status
| Status | Description |
|---|---|
| PENDING | Waiting for user to sign and pay |
| ACTIVATED | Subscription activated (user's first subscription and first payment completed) |
| CHARGE_PENDING | When a new period starts, charging is attempted until a clear success/failure |
| CHARGED | Current period charged successfully |
| HALTED | Entered when charging fails; can return to CHARGE_PENDING or CHARGED |
| CANCELLED | User actively cancelled |
| CLOSED | User-initiated refund or system action |