Skip to content

applyPaymentToken

  • Endpoint: POST /aggregate-pay/api/gateway/applyPaymentToken
  • Tags: Collection Service/Payment Tokenization

Parameters

FieldInTypeRequiredConstraintsDescription
signheaderstringYes
Content-TypeheaderstringYes

Parameter Examples

  • sign: "FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
  • Content-Type: "application/json"

Request Body

Content-Type: application/json

FieldTypeRequiredConstraintsDescriptionEnum
dataobjectYes
data.requestIdstringYesmaxLength: 64Merchant request id, which uniquely identifies a transaction of the merchant, cannot be repeated
data.countrystringYesmaxLength: 2Country code, in uppercase letters. If the payment method is specified, the country code must be provided, see【Supported Country/Region and Currency】The cashier's area selection strategy is: sending the country code region > user's historical use of country code region > user's IP location country code region.
data.paymentMethodTypestringYesmaxLength: 64Payment method, when it is empty, pull all available payment methods, value is CARD,BANKTRANSFER
data.targetOrgstringNomaxLength: 32The target organization, when paymentMethodType is BANKTRANSFER, targetOrg is YUAHSNBANK
data.userIdstringYesmaxLength: 64The user ID by the merchant, needs to ensure the uniqueness of each user.After the payment method is saved, the payment method will be recommended according to the userId.
data.frontCallbackUrlstringYesmaxLength: 1024The user will be redirected to this address after completing the payment, starting with HTTP/HTTPS or the scheme address of the merchant’s application.
data.tokenScopestringYesconstant value:tokenAcq
data.mitTypestringNowhen mitType is not null,represent paymentTokenID support mit, otherwise the paymentTokenID support citSCHEDULE, UNSCHEDULE
data.cardInfoobjectNoCard information. when paymentMethodType is CARD, cardInfo is required
data.cardInfo.cardOrgstringNoCard organization, when the paymentMethodType is CARD, if it is empty, all supported card groups will be displayed by default
data.cardInfo.cardIdentifierNostringNocard ID, card number.
data.cardInfo.cardHolderFullNamestringNoCardholder’s Name.
data.cardInfo.cardExpirationMonthstringNoCard Expiration Date - month, two digits.
data.cardInfo.cardExpirationYearstringNoCard Expiration Date - year, only the last two years are taken.
data.cardInfo.cvvstringYesCard cvv, three digits for Visa and Master, four digits for AMEX.
data.envInfoobjectYesDevice information
data.envInfo.userAgentstringYesuser brower information
data.envInfo.clientIpstringYesuser ip
data.envInfo.terminalTypestringYesterminal type, value is WEB,WAP,APP
data.envInfo.osTypestringYesOperating System Type, value is ANDROID,IOS
data.envInfo.osVersionstringNoOperating System Version
data.envInfo.browserTypestringNobrower type
data.envInfo.timeZonestringNotime zone
data.envInfo.deviceIdstringNodevice unique id
data.envInfo.deviceLanguagestringYesdevice language
data.envInfo.screenHeightstringYesscreen height
data.envInfo.screenWidthstringYesscreen width
data.riskParamsobjectNoRisk control business data. see https://docs-v2.payermax.com/en/doc-center/receipt/risk-control/information.html
versionstringYesAPI version. Current value: 1.4
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

Example

json
{
  "data": {
    "requestId": "{{orderNumber}}",
    "country": "RU",
    "paymentMethodType": "CARD",
    "targetOrg": null,
    "userId": "SONG052718",
    "frontCallbackUrl": "http://baidu.com",
    "tokenScope": "tokenAcq",
    "mitType": "UNSCHEDULE",
    "cardInfo": {
      "cardOrg": "VISA",
      "cardIdentifierNo": "4024023875811263",
      "cardHolderFullName": "ZHANGSAN",
      "cardExpirationMonth": "12",
      "cardExpirationYear": "33",
      "cvv": "123"
    },
    "envInfo": {
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
      "clientIp": "124.233.22.213",
      "terminalType": "app",
      "osType": "ios",
      "osVersion": "15.5",
      "browserType": "",
      "timeZone": "",
      "deviceId": "eYOIkvFpZzztg00Yu6USdprBQZCWxDhiUAHCiK&K/cH9mT6wMaMOzAKe",
      "deviceLanguage": "zh_CN",
      "screenHeight": "768",
      "screenWidth": "1024"
    },
    "riskParams": {
      "accountNo": "xsxxx",
      "bindEmail": "xx@mail.com",
      "regTime": "2024-03-14 12:08:34"
    }
  }
}

Responses

200

FieldTypeRequiredConstraintsDescriptionEnum
dataobjectYes
data.redirectUrlstringNoToken authentication url, when status is PENDING, the value is required
data.requestIdstringYesMerchant request id, which uniquely identifies a transaction of the merchant, cannot be repeated
data.statusstringYesapply request statusPENDING, SUCCESS, FAILED
data.paymentTokenIDstringNoPMMax token, when status is SUCCESS, the value is required
codestringYesReturn code, ‘APPLY_SUCCESS’ means success
msgstringYesReturn message, ‘Success.’

Response Example

json
{
  "msg": "",
  "code": "APPLY_SUCCESS",
  "data": {
    "redirectUrl": "https://cashier-n-test-new.payermax.com/index.html#/paySDKH5/newAuthResultSimulator?pmaxUrlMock=1&notifyType=CONTROL&referenceNo=TUC858400171807425915435000029&frontCallbackURL=http://baidu.com",
    "requestId": "DirectApi1718074257802",
    "status": "PENDING"
  }
}

Enum Reference

data.mitType

  • SCHEDULE
  • UNSCHEDULE

data.status

  • PENDING
  • SUCCESS
  • FAILED

Was this page helpful?

Thank you for your help in improving PayerMax Product Docs!

Released under the MIT License.