Query Subscription
- Endpoint:
POST /aggregate-pay/api/gateway/subscriptionQuery - Tags: Collection Service/Subscription Management
Description
After the merchant creates a subscription plan, he can use this interface to query the subscription status and deduction information.
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | API version. Current value: 1.5 | ||
keyVersion | string | Yes | Signature Algorithm Version, Current value: 1 | ||
requestTime | string | Yes | Request time, compliant with rfc3339 specification, format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX The time must be within two minutes of the current time | ||
appId | string | Yes | Merchant AppId,The unique identifier assigned to the merchant app by PayerMax | ||
merchantNo | string | No | maxLength: 32 | Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax | |
data | object | Yes | |||
data.subscriptionRequestId | string | No | maxLength: 64 | Merchant's request ID for subscription plan creation. Note: At least one of subscriptionNo or subscriptionRequestId must be provided. | |
data.subscriptionNo | string | No | maxLength: 64 | PayerMax subscription plan ID. Note: At least one of subscriptionNo or subscriptionRequestId must be provided. |
Example
json
{
"version": "1.5",
"keyVersion": "1",
"requestTime": "2025-02-26T05:00:00+00:00",
"appId": "6666c8b036a245799744912345a123456",
"merchantNo": "010213834123456",
"data": {
"subscriptionRequestId": "testRequestId0001",
"subscriptionNo": "SUB20250417120949065211234"
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | Return code, ‘APPLY_SUCCESS’ means success | ||
msg | string | Yes | Return message, ‘Success.’ | ||
data | object | Yes | |||
data.subscriptionRequestId | string | Yes | maxLength: 64 | Merchant's request ID for subscription creation. | |
data.merchantNo | string | Yes | maxLength: 32 | Merchant ID. | |
data.userId | string | Yes | maxLength: 64 | User ID. | |
data.subscriptionPlan | object | Yes | |||
data.subscriptionPlan.subscriptionNo | string | Yes | maxLength: 64 | PayerMax subscription ID. | |
data.subscriptionPlan.subscriptionStatus | string | Yes | maxLength: 32 | Subscription plan status: INACTIVE: Not activated EXPIRED: Expired without activation ACTIVE_FAILED: Activation failed ACTIVE: Successfully activated FINISH: Subscription completed CANCEL: Subscription canceled TERMINATE: Subscription terminated | |
data.subscriptionPaymentDetails | array[object] | No | |||
data.subscriptionPaymentDetails[].subscriptionIndex | number | No | Subscription period sequence number. | ||
data.subscriptionPaymentDetails[].paymentStatus | string | No | maxLength: 32 | Current payment order status. | |
data.subscriptionPaymentDetails[].periodStartTime | string | No | Subscription period start time. Format: 2025-01-13T15:59:59+0000 | ||
data.subscriptionPaymentDetails[].periodEndTime | string | No | Subscription period end time. Format: 2025-02-13T15:59:59+0000 | ||
data.subscriptionPaymentDetails[].payAmount | object | No | Payment amount details. | ||
data.subscriptionPaymentDetails[].payAmount.amount | number | No | Payment amount. | ||
data.subscriptionPaymentDetails[].payAmount.currency | string | No | maxLength: 3 | Currency code. | |
data.subscriptionPaymentDetails[].paymentMethodType | string | No | maxLength: 64 | Payment method type. | |
data.subscriptionPaymentDetails[].cardOrg | string | No | maxLength: 64 | Card organization/brand. | |
data.subscriptionPaymentDetails[].lastPaymentInfo | object | No | Latest payment details for current period. | ||
data.subscriptionPaymentDetails[].lastPaymentInfo.lastPaymentStatus | string | No | maxLength: 32 | Payment status: PENDING: Processing SUCCESS: Successful FAILED: Failed | |
data.subscriptionPaymentDetails[].lastPaymentInfo.payTime | string | No | Payment timestamp. Format: 2025-01-12T15:59:59+0000 | ||
data.subscriptionPaymentDetails[].lastPaymentInfo.tradeToken | string | No | maxLength: 64 | Payment transaction ID (Can be used for refund). Note: Present when payment is successful. | |
data.subscriptionPaymentDetails[].lastPaymentInfo.errorCode | string | No | maxLength: 64 | Payment failure error code. | |
data.subscriptionPaymentDetails[].lastPaymentInfo.errorMsg | string | No | maxLength: 512 | Payment failure error message. | |
data.subscriptionPaymentDetails[].cardInfo | object | No | Card Info | ||
data.subscriptionPaymentDetails[].cardInfo.cardOrg | string | No | maxLength: 32 | Card Scheme, will return when the user chooses card scheme to pay | |
data.subscriptionPaymentDetails[].cardInfo.country | string | No | maxLength: 2 | Card issuing country | |
data.subscriptionPaymentDetails[].cardInfo.cardType | string | No | maxLength: 32 | Card funding type, such as DEBIT、CREDIT and so on. | |
data.subscriptionPaymentDetails[].cardInfo.totalCardOrg | array[string] | No | Brand of the card.Dual-standard card returns two brands. | ||
data.subscriptionPaymentDetails[].cardInfo.type | string | No | maxLength: 32 | Type of the card. PAN is a full pan; NETWORK_TOKEN is not a full pan, such as APPLEPAY. | |
data.subscriptionPaymentDetails[].cardInfo.source | string | No | maxLength: 32 | Source of the card. CARD、APPLEPAY、GOOGLEPAY_PAN、GOOGLEPAY_CRYPTOGRAM、NETWORK_TOKEN | |
data.subscriptionPaymentDetails[].cardInfo.cardBinNo | string | No | maxLength: 16 | Card BIN number. | |
data.subscriptionPaymentDetails[].cardInfo.cardNumber | string | No | maxLength: 32 | Masked card number. | |
data.subscriptionPaymentDetails[].cardInfo.cardHolderName | string | No | maxLength: 128 | Masked cardholder name. | |
data.subscriptionPaymentDetails[].cardInfo.cardLast4 | string | No | maxLength: 4 | The last four digits of the card. | |
data.subscriptionPaymentDetails[].cardInfo.cardExpirationYear | string | No | maxLength: 2 | Two-digit number representing the card’s expiration year. | |
data.subscriptionPaymentDetails[].cardInfo.cardExpirationMonth | string | No | maxLength: 2 | Two-digit number representing the card’s expiration month. |
Response Example
json
{
"code": "APPLY_SUCCESS",
"msg": "Success.",
"data": {
"subscriptionRequestId": "testRequestId0001",
"merchantNo": "010213834123456",
"userId": "testUserId0001",
"subscriptionPlan": {
"subscriptionNo": "SUB20250417120949065211234",
"subscriptionStatus": "ACTIVE"
},
"subscriptionPaymentDetails": [
{
"subscriptionIndex": 0,
"paymentStatus": "SUCCESS",
"periodStartTime": "2025-01-13T15:59:59+0000",
"periodEndTime": "2025-02-13T15:59:59+0000",
"payAmount": {
"amount": 128.39,
"currency": "USD"
},
"paymentMethodType": "CARD",
"cardOrg": "VISA",
"lastPaymentInfo": {
"tradeToken": "T20250417174800970112345",
"lastPaymentStatus": "SUCCESS",
"payTime": "2025-01-12T15:59:59+0000"
}
},
{
"subscriptionIndex": 1,
"paymentStatus": "SUCCESS",
"periodStartTime": "2025-02-13T15:59:59+0000",
"periodEndTime": "2025-03-13T15:59:59+0000",
"payAmount": {
"amount": 128.39,
"currency": "USD"
},
"paymentMethodType": "CARD",
"cardOrg": "VISA",
"lastPaymentInfo": {
"tradeToken": "T20250417174800970112346",
"lastPaymentStatus": "SUCCESS",
"payTime": "2025-02-12T15:59:59+0000"
}
}
]
}
}