Skip to content

Create Payin Order

API EndPoint

POST baseUrl + /api/payIn

Request Parameters

ParameterRequiredTypeDescriptionExample
currencyYstring(32)Currency codeUSD
payTypeYintPay product typePayin PayType Enum
amountYdecimal(20,2)Amount[1,500]
reusableStatusYboolean是否多次支付目前只能是false
mchOrderNoYstring(32)Merchant order number不允许重复
expireTimeYlongexpireTime实际上游没有固定过期时间,Default: 3600 seconds 不一定有效,部分通道支持
notifyUrlYstring(250)webhooks (callback) addresshttps://merchant.com/webhooks
nonceStrYstring(32)Random string1863484722378907648
remarkYstring(32)RemarkPlease use English characters or unaccented Spanish
realNameYstring(64)User name请传递全名
phoneYstring(32)代收付款人手机号请勿使用重复的手机号
emailYstring(64)代收付款人邮箱 ,请勿使用重复的邮箱
idTypeYstring(32)代收付款人证件类型代收付款人证件类型
idCardYstring(32)付款人证件号(身份证1=CC 长度10位)

Request Example

bash
curl -L 'baseUrl/api/payIn' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"realName":"Reza Wijaya","amount":"20000.00","reusableStatus":false,"payType":"200","expireTime":3600,"mchOrderNo":"1386556787811426305","notifyUrl":"https://merchant.com/webhooks/payin","currency":"IDR","remark":"Electronic Cigarettes","nonceStr":"16a5a70f43384134bfae33acc77132e0"}'

Response Parameters

ParameterTypeDescription
merchantIdlongMerchant id
mchOrderNostring(32)Merchant order number
orderNostring(32)Platform order number
amountdecimal(20,0)Amount
orderFeedecimal(20,0)Fee
payCodestring(32)payCode
payUrlstring(250)Payment information display page/payment jump URL

Response Example

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556787811426305",
    "orderNo": "PAYIN8551844049125523456",
    "payCode": "RN123456",
    "payUrl": "https://gcash.com/pay?bizNo=20241202111212800110166154827",
    "biller": "Gcash",
    "amount": "20000",
    "orderFee": "1700"
  }
}
json
{
  "msg": "Payin_Order_Error",
  "code": 500
}

Query Payin Order

API EndPoint

POST baseUrl + /api/payInQuery

Request Parameters

ParameterRequiredTypeExampleDescription
mchOrderNoNstring(32)1386556575370063873Merchant order number
orderNoNstring(32)PAYIN8551843837024997376Platform order number
nonceStrYstring(32)9459931608Random string

TIP

We recommend using orderNo (platform order number) first. At least one of the platform order number and the merchant order number must be passed.

Request Example

bash
curl -L 'baseUrl/api/payInQuery' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"mchOrderNo":"1386556575370063873","nonceStr":"9459931608","orderNo":"PAYIN8551843837024997376"}'

Response Parameters

ParameterTypeDescription
merchantIdintMerchant id
mchOrderNostring(32)Merchant order number
orderNostring(32)Platform order number
channelOrderNostring(32)Channel order number
payTypestring(32)Payin PayType Enum
payCodestring(32)Payment Code
payUrlstring(250)Payment url
amountdecimal(20,0)Amount
feedecimal(20,4)Fee
orderStatusstring(32)Order StatusPayin Order Status Enum
completionTimeyyyy-MM-dd HH:mm:ssComplete time

Response Example

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "SUCCESS",
    "completionTime": "2024-12-02 15:40:50",
    "nonceStr": null
  }
}
json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "PAYING",
    "completionTime": null,
    "nonceStr": null
  }
}

Supplementary instructions when orderType is PATCH

If the user does not pay according to the order amount or pays repeatedly, a supplementary order will appear. In this case, the orderType of the supplementary order is PATCH:

  • orderNo is the platform order number newly generated for this order.
  • patchOrderNo is the platform order number of the associated original order,
  • patchMchOrderNo is the merchant order number of the associated original order.
  • mchOrderNo is the merchant order number of the associated original order (with a serial number identifier). Note that at this time, the serial number identifier will be added to the end of the mchOrderNo returned by the callback to distinguish multiple partial repayment orders.

For example, if your merchant order number is MCH20230088, when the first partial payment is generated, we will add the serial number 00001 to the end of the merchant order number mchOrderNo of the original order.

The mchOrderNo you receive in the callback is MCH2023008800001, and so on.

When a patch order occurs, our robot will also notify the corresponding merchant group, and the notification will contain all the information you need.

When the orderType of the order is API:

  • patchOrderNo is the same as orderNo
  • patchMchOrderNo is the same as mchOrderNo

At this time, the above parameters have no additional meaning.

Async Webhook Notification

The webhooks url is provided by the merchant

POST Merchant NotifyUrl

Webhook Request Parameters

ParameterTypeDescription
merchantIdintMerchant id
mchOrderNostring(32)Merchant order number
orderNostring(32)Platform order number
referenciastring(32)Payment referencia
amountdecimal(20,2)Amount
feedecimal(20,4)Fee
payUrlstring(32)Payment url
payDeskUrlstring(250)Paydesk url
payTypestring(32)Payin PayType Enum
orderStatusstring(32)Payin Order Status Enum
completionTimedateCompletion time
nonceStrstring(32)Random string
patchOrderNostring(32)The platform order number of the associated original order
patchMchOrderNostring(32)The merchant order number of the associated original order
orderTypestring(32)API=API order MCH=Merchant dashboard DESK=Paydesk order PATCH=PATCH order

TIP

referencia is the payment voucher number. This value will be present on the payment voucher of some payment products, but not all orders have this field. If your signature is not verified based on the original HTTP request body, please pay attention to the processing of the signature verification logic.

Webhook Request Example

bash
curl -L 'merchant.com/webhooks/payin' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":20000.00,"completionTime":"2024-12-02 12:07:06","fee":2500.0000,"mchOrderNo":"1386503284355244033","merchantId":"3002120","nonceStr":"1733116026894","orderNo":"PAYIN8551790545658687488","orderStatus":"SUCCESS","payCode":"OR.GPNQR..INOPROID_BS","payType":"41","payUrl":"https://payurl.com"}'

Supplementary instructions when orderType is PATCH

If the user does not pay according to the order amount or pays repeatedly, a supplementary order will appear. In this case, the orderType of the supplementary order is PATCH:

  • orderNo is the platform order number newly generated for this order.
  • patchOrderNo is the platform order number of the associated original order,
  • patchMchOrderNo is the merchant order number of the associated original order.
  • mchOrderNo is the merchant order number of the associated original order (with a serial number identifier). Note that at this time, the serial number identifier will be added to the end of the mchOrderNo returned by the callback to distinguish multiple partial repayment orders.

For example, if your merchant order number is MCH20230088, when the first partial payment is generated, we will add the serial number 00001 to the end of the merchant order number mchOrderNo of the original order.

The mchOrderNo you receive in the callback is MCH2023008800001, and so on.

When a patch order occurs, our robot will also notify the corresponding merchant group, and the notification will contain all the information you need.

When the orderType of the order is API:

  • patchOrderNo is the same as orderNo
  • patchMchOrderNo is the same as mchOrderNo

At this time, the above parameters have no additional meaning.

TIP

When the webhooks response HTTP status code is 200, 301 or 302, we believe that the merchant has successfully received and processed the callback. For other statuses, we believe that the merchant has failed to process the callback.

After the webhooks fails, it will be retried in 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 minutes, and the webhooks will be retried 10 times in total

Released under the MIT License.