Skip to content

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

FieldInTypeRequiredConstraintsDescription
Content-TypeheaderstringYes
signheaderstringYes签名信息请参考技术文档

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

FieldTypeRequiredConstraintsDescriptionEnum
versionstringYesAPI version. Current value: 1.5
keyVersionstringYesSignature Algorithm Version, Current value: 1
requestTimestringYesRequest 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
appIdstringYesMerchant AppId,The unique identifier assigned to the merchant app by PayerMax
merchantNostringNomaxLength: 32Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax
dataobjectYes
data.subscriptionRequestIdstringNomaxLength: 64Merchant's request ID for subscription plan creation. Note: At least one of subscriptionNo or subscriptionRequestId must be provided.
data.subscriptionNostringNomaxLength: 64PayerMax 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

FieldTypeRequiredConstraintsDescriptionEnum
codestringYesReturn code, ‘APPLY_SUCCESS’ means success
msgstringYesReturn message, ‘Success.’
dataobjectYes
data.subscriptionRequestIdstringYesmaxLength: 64Merchant's request ID for subscription creation.
data.merchantNostringYesmaxLength: 32Merchant ID.
data.userIdstringYesmaxLength: 64User ID.
data.subscriptionPlanobjectYes
data.subscriptionPlan.subscriptionNostringYesmaxLength: 64PayerMax subscription ID.
data.subscriptionPlan.subscriptionStatusstringYesmaxLength: 32Subscription 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.subscriptionPaymentDetailsarray[object]No
data.subscriptionPaymentDetails[].subscriptionIndexnumberNoSubscription period sequence number.
data.subscriptionPaymentDetails[].paymentStatusstringNomaxLength: 32Current payment order status.
data.subscriptionPaymentDetails[].periodStartTimestringNoSubscription period start time. Format: 2025-01-13T15:59:59+0000
data.subscriptionPaymentDetails[].periodEndTimestringNoSubscription period end time. Format: 2025-02-13T15:59:59+0000
data.subscriptionPaymentDetails[].payAmountobjectNoPayment amount details.
data.subscriptionPaymentDetails[].payAmount.amountnumberNoPayment amount.
data.subscriptionPaymentDetails[].payAmount.currencystringNomaxLength: 3Currency code.
data.subscriptionPaymentDetails[].paymentMethodTypestringNomaxLength: 64Payment method type.
data.subscriptionPaymentDetails[].cardOrgstringNomaxLength: 64Card organization/brand.
data.subscriptionPaymentDetails[].lastPaymentInfoobjectNoLatest payment details for current period.
data.subscriptionPaymentDetails[].lastPaymentInfo.lastPaymentStatusstringNomaxLength: 32Payment status: PENDING: Processing SUCCESS: Successful FAILED: Failed
data.subscriptionPaymentDetails[].lastPaymentInfo.payTimestringNoPayment timestamp. Format: 2025-01-12T15:59:59+0000
data.subscriptionPaymentDetails[].lastPaymentInfo.tradeTokenstringNomaxLength: 64Payment transaction ID (Can be used for refund). Note: Present when payment is successful.
data.subscriptionPaymentDetails[].lastPaymentInfo.errorCodestringNomaxLength: 64Payment failure error code.
data.subscriptionPaymentDetails[].lastPaymentInfo.errorMsgstringNomaxLength: 512Payment failure error message.
data.subscriptionPaymentDetails[].cardInfoobjectNoCard Info
data.subscriptionPaymentDetails[].cardInfo.cardOrgstringNomaxLength: 32Card Scheme, will return when the user chooses card scheme to pay
data.subscriptionPaymentDetails[].cardInfo.countrystringNomaxLength: 2Card issuing country
data.subscriptionPaymentDetails[].cardInfo.cardTypestringNomaxLength: 32Card funding type, such as DEBITCREDIT and so on.
data.subscriptionPaymentDetails[].cardInfo.totalCardOrgarray[string]NoBrand of the card.Dual-standard card returns two brands.
data.subscriptionPaymentDetails[].cardInfo.typestringNomaxLength: 32Type of the card. PAN is a full pan; NETWORK_TOKEN is not a full pan, such as APPLEPAY.
data.subscriptionPaymentDetails[].cardInfo.sourcestringNomaxLength: 32Source of the card. CARDAPPLEPAYGOOGLEPAY_PANGOOGLEPAY_CRYPTOGRAMNETWORK_TOKEN
data.subscriptionPaymentDetails[].cardInfo.cardBinNostringNomaxLength: 16Card BIN number.
data.subscriptionPaymentDetails[].cardInfo.cardNumberstringNomaxLength: 32Masked card number.
data.subscriptionPaymentDetails[].cardInfo.cardHolderNamestringNomaxLength: 128Masked cardholder name.
data.subscriptionPaymentDetails[].cardInfo.cardLast4stringNomaxLength: 4The last four digits of the card.
data.subscriptionPaymentDetails[].cardInfo.cardExpirationYearstringNomaxLength: 2Two-digit number representing the card’s expiration year.
data.subscriptionPaymentDetails[].cardInfo.cardExpirationMonthstringNomaxLength: 2Two-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"
        }
      }
    ]
  }
}

Was this page helpful?

Thank you for your help in improving PayerMax Product Docs!

Released under the MIT License.