Skip to content

收银台-下单

  • Endpoint: POST /aggregate-pay/api/gateway/orderAndPay
  • Tags: 收单

Description

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
versionstringYesmaxLength: 8接口版本 当前值为:1.5
keyVersionstringYesmaxLength: 8密钥版本 当前值为:1
requestTimestringYesmaxLength: 32请求时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX 时间需要在当前时间两分钟内
appIdstringYesmaxLength: 64商户应用Id,PayerMax分配给商户应用的唯一标识
merchantNostringNomaxLength: 32商户号,商户与PayerMax业务签约时生成的唯一标识
dataobjectYes请求数据体
data.outTradeNostringYesmaxLength: 64商户订单号,唯一标识商户的一笔交易,不能重复,只能包含字母、数字、下划线且不支持大小写敏感。如:AAA和AAa被认为是相同的。
data.integratestringYesmaxLength: 16使用PayerMax_Hosted_Payment_Page进行付款方支付信息收集及处理,需传入参数:Hosted_Checkout
data.subjectstringYesmaxLength: 256订单标题或产品信息,会展示在用户支付页面,避免使用纯数字。注:巴西钱包Pix不能超过43位
data.totalAmountnumberYes标价金额,金额的单位为元。各个国家币种支持的小数位详见【交易支持国家/地区与币种】,风控限额详见【风控行业限额
data.currencystringYesmaxLength: 3标价币种,大写字母,参见【交易支持国家/地区与币种
data.countrystringNomaxLength: 2国家代码,大写字母,参见【交易支持国家/地区与币种】。 如指定了paymentMethodType,则国家代码必须上送且和支付方式对应国家匹配。 收银台可用国家地区选择策略为:上送国家代码地区>用户历史使用国家代码地区>用户IP所在国家代码地区。(可用国家地区:交易币种对应的国家与签约国家取交集)
data.userIdstringYesmaxLength: 64商户内部的用户Id,需要保证每个ID唯一性。支付方式绑定后会根据userId进行支付方式推荐
data.languagestringNomaxLength: 16收银台页面语言。【支持的国家与币种】 优先级:用户上次使用的语言 > 用户浏览器语言 > 用户ip国家语言 > 商户下单传的语言 > 默认EN
data.referralCodestringNomaxLength: 32用于更精准的支付方式推荐,如设备ID、设备指纹等。
data.referencestringNomaxLength: 512商户自定义附加数据,可支持商户自定义并在响应中返回
data.frontCallbackUrlstringYesmaxLength: 1024商户指定的跳转URL,用户完成支付后会被跳转到该地址,以http/https开头或者商户应用的scheme地址。详见【结果页跳转说明
data.notifyUrlstringNomaxLength: 256服务端回调通知URL,以http/https开头 可以通过MerchantDashboard平台配置商户通知地址,详情见【配置异步通知地址】,如果交易中上送,则以交易为准,即优先使用接口中传的url。注:如商户平台未配置通知地址,交易也没上送地址,则无法进行回调通知
data.expireTimestringNo指定关单时间(单位:秒)。 1)expireTime 传值时: - 当expireTime<=30min:则关单时间为30min - 当24hour>=expireTime>=30min:则关单时间为expireTime - 当expireTime>=24hour:则关单时间为24hour 2)expireTime 未传值时: - 取这笔订单发起过的支付方式关单时间的最大值。
data.mitManagementUrlstringNo订阅计划管理地址
data.subscriptionPlananyNo订阅计划信息
data.paymentDetailobjectNo支付信息,非必填 。 1、可指定支付方式类型,收银台会拉起该支付方式类型支持的所有目标机构 。 2、可指定支付方式类型+目标机构。
data.paymentDetail.paymentTokenIDstringNomaxLength: 64token支付或商家代扣后续支付时,此字段为必填;
data.paymentDetail.paymentMethodTypestringNomaxLength: 16支付方式类型,为空时,拉取所有可用支付方式,参见【收银台支付-支付方式列表
data.paymentDetail.targetOrgstringNomaxLength: 16目标机构,可以为空,如果指定目标机构,则paymentMethodType也必须指定。参见【收银台支付-支付方式列表
data.paymentDetail.allowedCardOrgarray[string]No指定收银台可使用的卡组
data.paymentDetail.payAccountInfoarray[object]No支付账号,当指定支付方式和目标机构时,支持上送用户在该目标机构的支付账号信息。参见【收银台支付-支付方式列表】下的支持上送账号类型列
data.paymentDetail.payAccountInfo[].accountNostringNomaxLength: 32用户在该支付方式下的目标机构注册的支付账号,详见每个支付方式介绍
data.paymentDetail.payAccountInfo[].accountNoTypestringNomaxLength: 255账号类型:EMAIL,PHONE,ACCOUNTEMAIL, PHONE, ACCOUNT
data.paymentDetail.tokenForFutureUsebooleanNotrue代表用户已授权进行支付信息绑定,用于后续使用,默认为false。
data.paymentDetail.merchantInitiatedbooleanNo代表是否MIT交易,不传默认为false。
data.paymentDetail.mitTypestringNomaxLength: 16代扣类型;枚举值:SCHEDULED、UNSCHEDULED
data.envInfoobjectNo设备信息
data.envInfo.deviceIdstringNo商户设备唯一标识
data.envInfo.deviceLanguagestringNo设备默认语言
data.envInfo.screenHeightstringNo设备高度
data.envInfo.screenWidthstringNo设备宽度
data.subMerchantobjectNo二级商户信息 平台类商户需要上送子商户信息
data.subMerchant.subMerchantNostringNomaxLength: 64二级商户号
data.goodsDetailsarray[object]No商品信息,支持传多个。注:电商场景下需要上送。如果传入该对象,则内层必填字段必须传入
data.goodsDetails[].goodsIdstringYesmaxLength: 64商品ID
data.goodsDetails[].goodsNamestringYesmaxLength: 128商品名称
data.goodsDetails[].quantitystringYesmaxLength: 16商品数量
data.goodsDetails[].pricestringYesmaxLength: 20商品价格,商户系统的报价
data.goodsDetails[].goodsCurrencystringNomaxLength: 3商品报价币种,大写字母,参见【交易支持国家/地区与币种
data.goodsDetails[].showUrlstringNomaxLength: 128商品链接地址。注:电商场景下需要上送
data.goodsDetails[].goodsCategorystringNomaxLength: 64商品类别。注:电商场景下需要上送
data.shippingInfoobjectNo邮寄信息 注:电商场景下需要上送。如果传入该对象,则内层必填字段必须传入
data.shippingInfo.firstNamestringYesmaxLength: 64收货人名
data.shippingInfo.middleNamestringNomaxLength: 64收货人中间名
data.shippingInfo.lastNamestringYesmaxLength: 64收货人姓
data.shippingInfo.phoneNostringYesmaxLength: 32收货人手机号
data.shippingInfo.emailstringYesmaxLength: 255收货邮箱地址
data.shippingInfo.address1stringYesmaxLength: 1024收货地址1
data.shippingInfo.address2stringNomaxLength: 1024收货地址2
data.shippingInfo.citystringYesmaxLength: 64收货地址所在城市
data.shippingInfo.regionstringNomaxLength: 64收货地址所在区域
data.shippingInfo.statestringNomaxLength: 32收货地址所在州 送货到加拿大,美国,英国,澳大利亚时必填
data.shippingInfo.countrystringYesmaxLength: 2收货地址所在国家
data.shippingInfo.zipCodestringYesmaxLength: 32收货地址邮编
data.billingInfoobjectNo信用卡账单信息。注:如果传入该对象,则内层必填字段必须传入
data.billingInfo.firstNamestringNomaxLength: 64账单人名
data.billingInfo.middleNamestringNomaxLength: 64账单人中间名
data.billingInfo.lastNamestringNomaxLength: 64账单人姓
data.billingInfo.phoneNostringNomaxLength: 32账单人手机号
data.billingInfo.emailstringYesmaxLength: 255账单邮箱地址
data.billingInfo.address1stringYesmaxLength: 1024账单地址1
data.billingInfo.address2stringNomaxLength: 1024账单地址2
data.billingInfo.citystringYesmaxLength: 64账单地址所在城市
data.billingInfo.regionstringNomaxLength: 64账单地址所在区域
data.billingInfo.statestringNomaxLength: 32账单地址所在州 送货到加拿大,美国,英国,澳大利亚时需要上送
data.billingInfo.countrystringYesmaxLength: 2账单地址所在国家
data.billingInfo.zipCodestringNomaxLength: 16账单地址邮编
data.riskParamsobjectNo详见风控业务数据【商户上送信息

Example: 1

正常示例

json
{
  "version": "1.5",
  "keyVersion": "1",
  "requestTime": "2022-01-17T09:05:52.194+00:00",
  "appId": "bbd8d2639a7c4dfd8df7d005294390df",
  "merchantNo": "020113838535952",
  "data": {
    "outTradeNo": "P1642410352195",
    "subject": "MacPro14 and Mouse",
    "totalAmount": 4,
    "currency": "USD",
    "country": "US",
    "userId": "test1111",
    "language": "en",
    "reference": "reference查询和回调返回",
    "frontCallbackUrl": "http://www.frontCallbackUrl.example.com",
    "notifyUrl": "http://www.notifyUrl.example.com",
    "integrate": "Hosted_Checkout",
    "expireTime": "1800",
    "mitManagementUrl": "http://your.subscription.com",
    "subscriptionPlan": {
      "subject": "subject",
      "description": "PMMAX周期首期扣款",
      "totalPeriods": 12,
      "periodRule": {
        "periodUnit": "M",
        "periodCount": 1
      },
      "periodAmount": {
        "amount": 20,
        "currency": "USD"
      },
      "trialPeriodConfig": {
        "trialPeriodCount": 1,
        "trialPeriodAmount": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "trialConfig": {
        "trialAmount": {
          "amount": 4,
          "currency": "USD"
        },
        "trialDays": 7
      }
    },
    "paymentDetail": {
      "paymentMethodType": "",
      "targetOrg": "",
      "payAccountInfo": [
        {
          "accountNo": "fasdf@example.com",
          "accountNoType": "EMAIL"
        },
        {
          "accountNo": "0999998781111111",
          "accountNoType": "PHONE"
        },
        {
          "accountNo": "FASDFDF",
          "accountNoType": "ACCOUNT"
        }
      ]
    },
    "envInfo": {
      "deviceId": "eYOIkvFpZzztg00Yu6USdprBQZCWxDhiUAHCiK&K/cH9mT6wMaMOzAKe",
      "deviceLanguage": "zh_CN",
      "screenHeight": 768,
      "screenWidth": 1024
    },
    "goodsDetails": [
      {
        "goodsId": "D002",
        "goodsName": "Jaz",
        "quantity": "2",
        "price": "500",
        "goodsCurrency": "IDR",
        "showUrl": "http://www.example.com",
        "goodsCategory": "clothes"
      }
    ],
    "shippingInfo": {
      "firstName": "zhang",
      "middleName": "shang",
      "lastName": "feng",
      "phoneNo": "13009090980",
      "email": "test@example.com",
      "address1": "er xian qiao",
      "address2": "chenghua road",
      "city": "chengdu",
      "region": "wuhou",
      "state": "sichuan",
      "country": "ID",
      "zipCode": "000000"
    },
    "billingInfo": {
      "firstName": "James",
      "middleName": "middleName",
      "lastName": "Smith",
      "email": "James@example.com",
      "phoneNo": "903124360628",
      "address1": "GOLGELI SOKAK NO.34, 06700",
      "address2": "GOLGELI SOKAK NO.34, 06700",
      "city": "GAZIOSMANPASA/ANKAR",
      "region": "region",
      "state": "state",
      "country": "TR",
      "zipCode": "06700"
    },
    "riskParams": {
      "registerName": "lily",
      "regTime": "2023-07-01 12:08:34",
      "liveCountry": "VN",
      "payerAccount": "987654XXX",
      "payerName": "lily",
      "taxId": "1234567890"
    }
  }
}

Example: 2

全量收银台

json
{
  "requestTime": "2025-06-26T20:11:30.528+08:00",
  "keyVersion": "1",
  "data": {
    "country": "DE",
    "frontCallbackUrl": "http://www.frontCallbackUrl.example.com",
    "subject": "MacPro14 and Mouse",
    "userId": "orderAndPayUserId5WPGcZilgw",
    "integrate": "Hosted_Checkout",
    "totalAmount": "100",
    "outTradeNo": "orderAndPayOutTradeNo1750939890528nSYEkJJibb",
    "notifyUrl": "http://www.notifyUrl.example.com",
    "currency": "EUR"
  },
  "appId": "d27183b7f2ea4822aa722d9efa8e7a8b",
  "version": "1.4",
  "merchantNo": "SDP01010115045982"
}

Example: 3

指定支付方式

json
{
  "requestTime": "2025-06-26T20:11:28.677+08:00",
  "keyVersion": "1",
  "data": {
    "country": "DE",
    "frontCallbackUrl": "http://www.frontCallbackUrl.example.com",
    "subject": "MacPro14 and Mouse",
    "userId": "orderAndPayUserIdmbfs36NuP4",
    "integrate": "Hosted_Checkout",
    "totalAmount": "100",
    "paymentDetail": {
      "paymentMethodType": "PAY_LATER"
    },
    "outTradeNo": "orderAndPayOutTradeNo1750939888677H6qrN2dcNb",
    "notifyUrl": "http://www.notifyUrl.example.com",
    "currency": "EUR"
  },
  "appId": "d27183b7f2ea4822aa722d9efa8e7a8b",
  "version": "1.4",
  "merchantNo": "SDP01010115045982"
}

Example: 4

指定目标机构

json
{
  "requestTime": "2025-06-26T20:11:26.911+08:00",
  "keyVersion": "1",
  "data": {
    "country": "DE",
    "frontCallbackUrl": "http://www.frontCallbackUrl.example.com",
    "subject": "MacPro14 and Mouse",
    "userId": "orderAndPayUserId9KvboN9MjK",
    "integrate": "Hosted_Checkout",
    "totalAmount": "100",
    "paymentDetail": {
      "targetOrg": "KLARNA",
      "paymentMethodType": "PAY_LATER"
    },
    "outTradeNo": "orderAndPayOutTradeNo1750939886911ALoVwQnZVz",
    "notifyUrl": "http://www.notifyUrl.example.com",
    "currency": "EUR"
  },
  "appId": "d27183b7f2ea4822aa722d9efa8e7a8b",
  "version": "1.4",
  "merchantNo": "SDP01010115045982"
}

Example: 5

指定卡组

json
{
  "requestTime": "2025-06-26T20:11:25.294+08:00",
  "keyVersion": "1",
  "data": {
    "country": "SA",
    "frontCallbackUrl": "http://www.frontCallbackUrl.example.com",
    "subject": "MacPro14 and Mouse",
    "userId": "orderAndPayUserIdxCfwTf7Sng",
    "integrate": "Hosted_Checkout",
    "totalAmount": "100",
    "paymentDetail": {
      "paymentMethodType": "CARD",
      "allowedCardOrg": [
        "VISA"
      ]
    },
    "outTradeNo": "orderAndPayOutTradeNo1750939885294iO0CZJ1WaM",
    "notifyUrl": "http://www.notifyUrl.example.com",
    "currency": "SAR"
  },
  "appId": "d27183b7f2ea4822aa722d9efa8e7a8b",
  "version": "1.4",
  "merchantNo": "SDP01010115045982"
}

Responses

200

错误码

分类结果码结果描述
SYSTEM_ERRORSystem is busy, please try again later.系统错误;请联系PayerMax
REQ_TIME_OVER_TIMErequestTime effective in two minutes请求时间与服务端偏差超过2分钟,请检查requestTime后重新发起
TOO_MANY_REQUESTExceed request limitation, please retry later触发接口并发限流,请稍后重试
SIGN_VERIFY_FAILEDThe signature verify failed.签名错误;请核实签名
MERCHANT_INVALIDThe merchant has been offline.无效商户
MERCHANT_APP_INVALIDSignature key is not configured.无效商户APP
PARAMS_INVALID${field} length must be between ${min} and ${max},but your input value length is ${length}.Make sure all requests length is correct.无效参数-入参字段长度不符合要求;请参考官网字段描述
PARAMS_INVALID${field} must be ${type} , but your input is ${valueType}.Make sure all requests type is correct.无效参数-入参字段类型不正确;请参考官网字段描述
PARAMS_INVALID${field} is invalid,because ${field} is null.无效参数-入参字段不能为空;请参考官网字段描述
AMOUNT_INVALIDAmount is incorrect.无效的金额
COUNTRY_INVALIDNo country support, pls re-pay.无效的国家;可参考支持的国家和币种
CURRENCY_INVALIDcurrency is invalid,because currency is not defined.无效的币种;可参考支持的国家和币种
CONTRACT_INVALIDMerchant has no activated contract, please check the contract status.无效合约;请检查合约有效性
CONTRACT_INVALIDMerchant has not signed the contract in ${value}.指定的国家/地区未签约;请检查合约有效性
CONTRACT_INVALIDMerchant has not signed the ${paymentMethod} payment method.指定的支付方式未签约;请检查合约有效性
CONTRACT_INVALIDMerchant has not signed the ${targetOrg} target origination correspondingly, although you have signed the ${paymentMethod} payment method.指定的目标机构未签约;请检查合约有效性
CONTRACT_INVALIDMerchant has not signed the ${currency} currency correspondingly, although you have signed the ${paymentMethod} payment method.指定的支付方式有签约,但所指定的币种未签约;请检查合约有效性
CONTRACT_INVALIDMerchant has not signed the ${currency} currency correspondingly, although you have signed the ${paymentMethod} payment method and the ${targetOrg} target origination.指定的目标机构有签约,但所指定的币种未签约;请检查合约有效性
PAYMENT_METHOD_NOT_EXISTThe payment method does not exist.支付方式不存在;请更换其他支付方式
PAYMENT_METHOD_SUSPENDThe payment method already suspend, plz try other payment methods.支付方式暂不可用;请更换其他支付方式
AMOUNT_LIMIT_MINIMUMThe order amount is lower than the minimum limit of the payment method.最小金额限制
AMOUNT_LIMIT_MAXIMUMThe order amount exceeds the maximum limit of the payment method.最大金额限制
AMOUNT_LIMITThe amount doesn't match the payment method requirement.金额限制
ORDER_REPEATThe order number repeat.订单重复
ONBOARD_ERRORPlease complete the merchant onboarding, then refresh the page.商户未报备;请先完成报备
PARTICIPANT_INVALIDInvalid participant.无效分账参与方
PAYMENT_METHOD_NOT_EXISTBank temporarily not available, please retry later.银行暂时不可用,请稍后重试
PAYMENT_METHOD_SUSPENDThe payment method is in maintenance, please try again later.支付方式维护中,请稍后重试
FieldTypeRequiredConstraintsDescriptionEnum
codestringYes返回码,’APPLY_SUCCESS’代表成功。只代表接口请求成功,不代表订单状态。
msgstringYes返回描述,’Success.’ 。只代表接口请求成功,不代表订单状态。
dataobjectYes返回数据体
data.redirectUrlstringYesmaxLength: 1024跳转地址
data.outTradeNostringYesmaxLength: 64商户订单号
data.tradeTokenstringYesmaxLength: 64PayerMax流水号
data.statusstringYesmaxLength: 32交易状态,详见【交易状态

Response Example: 1

成功示例

json
{
  "code": "APPLY_SUCCESS",
  "msg": "",
  "data": {
    "redirectUrl": "https://cashier-n.payermax.com/index.html#/cashier/home?merchantId=020213827212251&merchantAppId=3b242b56a8b64274bcc37dac281120e3&country=ID&tradeToken=TOKEN20220117091121294138752&language=en&token=IHjqkZ8%2F%2FFcnfDPxWTvJFOrulUAKfXFUkxHJSiTdlnjnX1G6AOuTiSl6%2BN05EzxTaJkcSsSyGh5a1q%2FACwWN0sDD%2FgwY5YdWu3ghDcH2wqm%2BJIcEh0qZqo%2BQFnXp65bvkLZnY7VO7HwZGzyrpMBlPhfRCQxwBbc6lJcSYuPf%2Fe8%3D&amount=10000¤cy=IDR&frontCallbackUrl=https%3A%2F%2Fwww.payermax.com",
    "outTradeNo": "P1642410680681",
    "tradeToken": "T2024062702289232000001",
    "status": "PENDING"
  }
}

Response Example: 2

异常示例

json
{
  "data": {
    "redirectUrl": "http://jtce.nz/fideg",
    "outTradeNo": "Lorem ut in culpa dolor",
    "tradeToken": "eu cupidatat magna proident",
    "status": "enim quis eiusmod occaecat"
  },
  "code": "14",
  "msg": "amet in elit"
}

Response Example: 3

异常示例2

json
{
  "data": {
    "redirectUrl": "http://jnsmsvoxlg.hn/whfocvhoq",
    "outTradeNo": "tempor dolore in cillum voluptate",
    "tradeToken": "elit velit",
    "status": "aliquip in ut"
  },
  "code": "10",
  "msg": "ut reprehenderit Ut"
}

Enum Reference

data.paymentDetail.payAccountInfo[].accountNoType

  • EMAIL
  • PHONE
  • ACCOUNT

此页面的内容有帮助吗?

感谢您帮助改进 PayerMax 产品文档!

Released under the MIT License.