Skip to content

Drop-In Payment

  • Endpoint: POST /aggregate-pay/api/gateway/orderAndPay/(for-drop-dont-copy-me)
  • Tags: Collection Service/DropIn Payment

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
dataobjectYesRequest data body.
data.outTradeNostringYesmaxLength: 64Merchant order id, which uniquely identifies a transaction of the merchant, cannot be repeated, and can only contain letters (Case sensitivity not supported), numbers, and underlines.For example, AAA and AAa are considered the same.
data.integratestringYesmaxLength: 16The merchant collects the payer's payment information by itself and sends it to PayerMax for transaction processing. Incoming parameter: Direct_Payment
data.subjectstringYesmaxLength: 256Order title or product information, which will be displayed on the user payment page, please avoid using pure numbers.  Note: it cannot exceed 43 digits for Brazil Pix.
data.totalAmountnumberYesThe order amount is passed in by the merchant. The decimal point supported by the currency of each country.See【Supported Country/Region and Currency】,Risk control limit list.See【Risk control limit list
data.currencystringYesmaxLength: 3Currency code, capital letter see【Supported Country/Region and Currency
data.countrystringYesmaxLength: 2Country code, capital letters,If the passed country code does not match the currency, the cashier will be displayed in the region corresponding to the currency code. If a payment method is specified, the country must be sent, see【Supported Country/Region and Currency
data.userIdstringYesmaxLength: 64The user ID of the merchant, needs to ensure the uniqueness of each user ID. After the payment method is bound, the payment method will be recommended according to the userId.
data.expireTimestringNomaxLength: 16Define the payment duration in seconds, If the order has not been completed within the duration, it will be closed. The range is 1800~86400.
data.referralCodestringNomaxLength: 32Used for more accurate payment method recommendations, such as device ID, device fingerprint, etc.
data.mitManagementUrlstringNomerchant subscription plan management address
data.subscriptionPlanobjectNosubscription plan info
data.subscriptionPlan.subscriptionNostringNoPayerMax subscription plan management order number
data.subscriptionPlan.subjectstringNosubscription topic, required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.descriptionstringNosubscription description, required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.totalPeriodsstringNototal subscription periods. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.periodRuleobjectNosubscription rules
data.subscriptionPlan.periodRule.periodUnitstringNosubscription deduction cycle, deduct by month (M), day (D), week (W), year (Y). Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.periodRule.periodCountstringNosubscription deduction frequency. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.periodAmountobjectNofixed period deduction amount. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.periodAmount.amountnumberYesfixed period deduction amount. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.periodAmount.currencystringYesfixed period deduction currency. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.firstPeriodStartDate ⚠️stringNoFirst deduction time of subscription plan. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.trialPeriodConfigobjectNodiscount period rules
data.subscriptionPlan.trialPeriodConfig.trialPeriodCountstringYesdiscount period count.
data.subscriptionPlan.trialPeriodConfig.trialPeriodAmountobjectYesdiscount deduct amount.
data.subscriptionPlan.trialPeriodConfig.trialPeriodAmount.amountnumberNodiscount deduct amount. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.trialPeriodConfig.trialPeriodAmount.currencystringNodiscount deduct currency. Required when payment method is APPLEPAY or GOOGLEPAY and merchant manages subscription plan
data.subscriptionPlan.trialConfigobjectNoSubscription trial for n days information
data.subscriptionPlan.trialConfig.trialAmountobjectYesTrial fee information
data.subscriptionPlan.trialConfig.trialAmount.amountnumberYesTrial fee
data.subscriptionPlan.trialConfig.trialAmount.currencystringYesTrial currency
data.subscriptionPlan.trialConfig.trialDaysnumberYesTrial days
data.paymentDetailobjectYesPayment method information.
data.paymentDetail.tokenForFutureUsebooleanNotrue means that the user has been authorized to bind payment information for subsequent use, the default is false
data.paymentDetail.sessionKeystringNoIt is used as a sessionKey for Drop-In payment.
data.paymentDetail.paymentTokenstringNomaxLength: 64It is used as a token for Drop-In payment.
data.paymentDetail.buyerInfoobjectYesbuyer information.
data.paymentDetail.buyerInfo.clientIpstringYesThe user's IP address. Must be in standard IPv4 or IPv6 format.
data.paymentDetail.buyerInfo.userAgentstringYesUser browser information.
data.paymentDetail.merchantInitiatedbooleanNoIndicates whether it is a MIT transaction. If not passed, it defaults to false.
data.paymentDetail.mitTypestringNomit typeSCHEDULED, UNSCHEDULED
data.subMerchantobjectNoSubmerchant Information, Platform merchants need to submit sub-merchant information.
data.subMerchant.subMerchantNostringNomaxLength: 64Submerchant ID.
data.languagestringNomaxLength: 16Cashier page language.【Supported Country/Region and Currency】 The priority is: the language last used by the user > the language of the user's browser > the country language of the user's IP > the language of the merchant's order > Default EN
data.terminalTypestringYesmaxLength: 3Device terminal, WEB, WAP, APP.
data.osTypestringNoDevice operating system, when the device terminal is Wap and App, the device operating system can be ANDROID or IOS.
data.frontCallbackUrlstringYesmaxLength: 1024The redirect URL specified by the merchant, the user will be redirected to this address after completing the payment, starting with http/https or the scheme address of the merchant’s application. FrontCallbackUrl is mandated for API-only payment to support callback transactions that need to redirect to external links.
data.notifyUrlstringNomaxLength: 256Server-side callback notification URL, starting with http/https The merchant notification address can be configured through the MerchantDashboard platform. If the transaction is uploaded, the transaction shall prevail.Note: If the merchant platform does not configure a notifyUrl and the transaction does not have a sending notifyUrl, callback notification cannot be made.

Example

json
{
  "version": "1.5",
  "keyVersion": "1",
  "requestTime": "2022-02-25T09:23:06.473+00:00",
  "appId": "6666c8b036a24579974497c2f9800001",
  "merchantNo": "020213834421284",
  "data": {
    "totalAmount": 77.44,
    "country": "HK",
    "expireTime": "7200",
    "paymentDetail": {
      "paymentToken": "332e4cc1af1740aeafe9e7df82aeb5a1",
      "buyerInfo": {
        "clientIp": "59.82.59.92",
        "userAgent": "Chrome"
      },
      "sessionKey": "86409e2c04b44536a484caa5ce3ce0e9"
    },
    "frontCallbackUrl": "http://frontCallbackUrl.example.com",
    "subject": "GoGeal PTE. LTD.",
    "outTradeNo": "123456789",
    "notifyUrl": "http://notifyUrl.example.com",
    "currency": "HKD",
    "userId": "3ff0495692d152be96d84dbc9352dc57",
    "integrate": "Direct_Payment",
    "terminalType": "WEB"
  }
}

Responses

200

FieldTypeRequiredConstraintsDescriptionEnum
codestringYesReturn code, ‘APPLY_SUCCESS’ means success.It only represents the success of the interface request, not the order status.
msgstringYesReturn message, ‘Success.’.It only represents the success of the interface request, not the order status.
dataobjectNoReturn data body.
data.outTradeNostringYesmaxLength: 64Merchant order id. order id.
data.tradeTokenstringYesmaxLength: 64PayerMax order id.
data.statusstringYesmaxLength: 32transaction status.
data.redirectUrlstringNomaxLength: 1024redirect link; Some payment methods need to jump to the outside to complete the payment.

Response Example: 1

成功示例

json
{
  "code": "APPLY_SUCCESS",
  "msg": " Success.",
  "data": {
    "outTradeNo": "Test1645780876511",
    "tradeToken": "T2024062702289232000001",
    "status": "SUCCESS"
  }
}

Response Example: 2

apm-redirect-response

json
{
  "msg": "Success.",
  "code": "APPLY_SUCCESS",
  "data": {
    "redirectUrl": "https://cashier-n-uat.payermax.com/v2/index.html#/mocks?simulatorType=payment&pmaxUrlMock=1&referenceNo=UPC594700175093987893951000031&merchantId=SDP01010115045982&merchantAppId=d27183b7f2ea4822aa722d9efa8e7a8b&tradeToken=T2025062612594747000086&payRequestNo=20250626121118EP2094594711153204T05&token=8cfe3859f5f04c5783481a26089c6416",
    "outTradeNo": "orderAndPayOutTradeNo1750939878336UokUa96TMY",
    "tradeToken": "T2025062612594747000086",
    "status": "PENDING"
  }
}

Response Example: 3

apm-direct-response

json
{
  "msg": "Success.",
  "code": "APPLY_SUCCESS",
  "data": {
    "vaCode": "TEST***001",
    "outTradeNo": "orderAndPayOutTradeNo1751265358900gHyeC8LHpb",
    "tradeToken": "T2025063006003647012140",
    "status": "PENDING"
  }
}

Response Example: 4

apm-qrcode-response

json
{
  "msg": "Success.",
  "code": "APPLY_SUCCESS",
  "data": {
    "redirectUrl": "https://gopay.co.id/app/merchanttransfer?tref=A120240108055206Yf6o5risurID&amount=15000&activity=GP:RR&callback_url=https%3A%2F%2Fchannel.payermax.com%2Fin-pay-channel%2Fc%2FoutService%2FfrontCallbackV1%2FmidTrans%2FPPC788800170469312633195812771%2Fredirect%3Forder_id%3DPPC788800170469312633195812771",
    "qrCodeUrl": "https://api.midtrans.com/v2/gopay/b54f6b26-c3b8-4756-acb8-4c53097ab8ca/qr-code",
    "outTradeNo": "orderAndPayOutTradeNo17512653582106DuKJbyYzW",
    "tradeToken": "T2025063006734147012136",
    "status": "PENDING"
  }
}

Enum Reference

data.paymentDetail.mitType

  • SCHEDULED
  • UNSCHEDULED

Was this page helpful?

Thank you for your help in improving PayerMax Product Docs!

Released under the MIT License.