Create Payin Order
HTTP Request
TIP
POST baseUrl
+ /api/payIn
Request Headers
HeaderName | Required | Value |
---|---|---|
Content-Type | Y | application/json |
MerchantId | Y | MerchantId |
Sign | Y | Sign |
RequestBody
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
currency | Y | string(32) | VND | Currency code |
payType | Y | int | 123 | pls refer to Payin PayType Enum |
amount | Y | decimal(20,0) | [1000,20000000] | Amount |
reusableStatus | Y | boolean | false | Currently it can only be false |
mchOrderNo | Y | string(32) | mch12345 | Merchant order number (should be unique in the merchant system) |
expireTime | Y | long | 3600 | Expiration time, default 3600 seconds |
notifyUrl | Y | string(250) | https://acb.com/ | webhooks (callback) address |
nonceStr | Y | string(32) | 162838128 | Random string |
remark | Y | string(32) | remark | Order remarks |
realName | Y | string(32) | Jack | Payer Name |
phone | Y | string(32) | +57xxxxxxx | Payer phonenumber |
email | Y | string(32) | xyz@gamil.com | Payer email |
idType | Y | string(32) | 暂无 | Payin Payer ID Type |
idCard | Y | string(32) | Payer ID number | |
goodsSubject | N | string(32) | apple | Product subject |
goodsBody | N | string(32) | apple | Product description |
TIP
Note that callback/webhook addresses only support https
or http
protocol addresses. If the address is an ip
address, be sure to use a public domain name.
ResponseBody
JSON 示例
{
"msg": "SUCCESS",
"code": 200,
"data": {
"merchantId": "100001",
"mchOrderNo": "M1656908719283",
"orderNo": "PAYIN8232154612109344768",
"payCode": "646012000000015942",
"payUrl": null,
"amount": 100
}
}
2
3
4
5
6
7
8
9
10
11
12
Parameter | Type | Description |
---|---|---|
merchantId | long | MerchantId |
mchOrderNo | string(32) | Merchant order number |
orderNo | string(32) | Platform order number |
amount | decimal(20,0) | Amount |
orderFee | decimal(20,0) | fee |
payCode | string(32) | Payment account VA |
payUrl | string(250) | Payment Url |
Query Payin Order
HTTP Request
TIP
POST baseUrl
+ /api/payInQuery
Request Headers
HeaderName | Required | Value |
---|---|---|
Content-Type | Y | application/json |
MerchantId | Y | MerchantId |
Sign | Y | Sign |
RequestBody
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
mchOrderNo | N | string(32) | P123456 | Merchant order number |
orderNo | N | string(32) | PAYIN12345 | Platform order number |
nonceStr | Y | string(32) | 1628381288000 | Random string |
TIP
We recommend using orderNo (platform order number) first. At least one of the platform order number and merchant order number needs to be passed.
ResponseBody
{
"msg": "SUCCESS",
"code": 200,
"data": {
"merchantId": "100001",
"mchOrderNo": "M1656752128806",
"orderNo": "PAYIN8231497473279467520",
"payType": "1",
"payCode": "646012000000015887",
"payUrl": null,
"payDeskUrl": null,
"amount": 100.0,
"patchOrderNo": "PAYIN82xxxxxxxxx",
"orderType": "PATCH",
"fee": null,
"orderStatus": "PAYING",
"completionTime": null
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Parameter | Type | Description |
---|---|---|
merchantId | int | MerchantId |
mchOrderNo | string(32) | Merchant order number |
orderNo | string(32) | Platform order number |
channelOrderNo | string(32) | Channel order number |
payType | string(32) | pls refer to Payin PayType Enum |
payCode | string(32) | 支付码 |
payUrl | string(250) | Payment QR Code |
payDeskUrl | string(250) | PayDesk Payment Url |
amount | decimal(20,2) | Amount |
fee | decimal(20,4) | fee |
orderStatus | string(32) | Order StatusPayin Order Status Enum |
completionTime | date | Complete timeyyyy-MM-dd HH:mm:ss |
patchOrderNo | string(32) | The platform orderNo associated with the replenishment order |
patchMchOrderNo | string(32) | The platform mchOrderNo associated with the replenishment order |
orderType | string(32) | API=API接口 MCH=商户后台 DESK=收银台 PATCH=补单 |
关于orderType
为PATCH
时的补充说明
If the user does not pay according to the order amount or pays repeatedly, a replenishment order will appear. At this time, the orderType
of the replenishment order is PATCH
:
orderNo
is the newly generated platform order number 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 (with serial number identification) of the associated original order. Note that a serial number identifier will be added at the end of themchOrderNo
returned by the callback to distinguish multiple partial repayment orders.
For example, your merchant order number is MCH20230088
. When the first partial payment occurs, we will add the serial number 00001
to the end of the merchant order number mchOrderNo
of the original order. , the mchOrderNo
of the callback you receive is MCH2023008800001
, and so on.
When an order replenishment 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 orderNopatchMchOrderNo
is the same as mchOrderNo
The above parameters have no additional meaning at this time.
TIP
fee
and completionTime
only have a value if the order is successfully paid.
Async Webhook Notification
HTTP Request
TIP
POST : notifyUrl
notifyUrl
is provided by the merchant
Request Headers
HeaderName | Required | Value |
---|---|---|
Content-Type | Y | application/json |
MerchantId | Y | MerchantId |
Sign | Y | Sign |
Webhook RequestBody
{
"orderStatus": "SUCCESS",
"amount": 10000.0,
"fee": 0,
"mchOrderNo": "2a6421c4-3758-4d1a-b47e-f7d0e7133f9e",
"merchantId": "100001",
"payDeskUrl": null,
"orderNo": "PAYDESKxxxxxxxxxxx",
"payUrl": "xxxxxxxxxxxx",
"patchOrderNo": "PAYIN82xxxxxxxxx",
"orderType": "PATCH",
"completionTime": "2022-08-08 08:08:08",
"nonceStr": "xxxxxxxxxx"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
Parameter | Type | Description |
---|---|---|
merchantId | int | MerchantId |
mchOrderNo | string(32) | Merchant order number |
orderNo | string(32) | Platform order number |
amount | decimal(20,2) | Amount |
fee | decimal(20,4) | fee |
payUrl | string(32) | Payment Url |
payDeskUrl | string(250) | PayDesk Payment Url |
orderStatus | string(32) | 订单状态,pls refer toPayin Order Status Enum |
completionTime | date | Complete time |
nonceStr | string(32) | Random string |
patchOrderNo | string(32) | The platform orderNo associated with the replenishment order |
patchMchOrderNo | string(32) | The platform mchOrderNo associated with the replenishment order |
orderType | string(32) | API=API接口 MCH=商户后台 DESK=收银台 PATCH=补单 |
TIP
fee
and completionTime
only have a value if the order is successfully paid.
关于orderType
为PATCH
时的补充说明
If the user does not pay according to the order amount or pays repeatedly, a replenishment order will appear. At this time, the orderType
of the replenishment order is PATCH
:
orderNo
is the newly generated platform order number 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 (with serial number identification) of the associated original order. Note that a serial number identifier will be added at the end of themchOrderNo
returned by the callback to distinguish multiple partial repayment orders.
For example, your merchant order number is MCH20230088
. When the first partial payment occurs, we will add the serial number 00001
to the end of the merchant order number mchOrderNo
of the original order. , the mchOrderNo
of the callback you receive is MCH2023008800001
, and so on.
When an order replenishment 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 orderNopatchMchOrderNo
is the same as mchOrderNo
The above parameters have no additional meaning at this time.
TIP
Please respond with SUCCESS
if the process is successful. For other responses, we will consider the callback to have failed. After the callback fails, it will be retried in 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 minutes
, and the callback will be retried 10 times in total.