Skip to content

Create Payin Order

HTTP Request

TIP

POST baseUrl + /api/payIn

Request Headers

HeaderNameRequiredValue
Content-TypeYapplication/json
MerchantIdYMerchantId
SignYSign

RequestBody

ParameterRequiredTypeExampleDescription
currencyYstring(32)CLPCurrency code
payTypeYint200pls refer to Payin PayType Enum
amountYdecimal(20,0)100-10000000Amount
reusableStatusYbooleanfalseCurrently it can only be false
mchOrderNoYstring(32)mch12345Merchant order number (should be unique in the merchant system)
expireTimeYlong3600Expiration time, default 3600 seconds
notifyUrlYstring(250)https://acb.com/webhooks (callback) address
nonceStrYstring(32)162838128Random string
remarkYstring(32)remarkOrder remarks
realNameYstring(32)JackPayer Name
phoneYstring(32)569NNNNNNNNPayer phonenumber
emailYstring(32)xyz@gamil.comPayer email
idTypeYstring(32)Payer ID Type pls refer toPayin Payer ID Type
idCardYstring(32)Payer ID number
goodsSubjectNstring(32)appleProduct subject
goodsBodyNstring(32)appleProduct 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 示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "100001",
    "mchOrderNo": "M1656908719283",
    "orderNo": "PAYIN8232154612109344768",
    "payCode": "646012000000015942",
    "payUrl": null,
    "amount": 100
  }
}
ParameterTypeDescription
merchantIdlongMerchantId
mchOrderNostring(32)Merchant order number
orderNostring(32)Platform order number
amountdecimal(20,0)Amount
orderFeedecimal(20,0)fee
payCodestring(32)Payment Code
payUrlstring(250)Payment Url

TestCase

For payin transactions, please use the following cards for testing.

CardTypeCard InfoResult
VISA4051 8856 0044 6623
CVV 123
payment successful
AMEX3700 0000 0002 032
CVV 1234
payment successful
MASTERCARD5186 0595 5959 0568
CVV 123
payment failed
Redcompra4051 8842 3993 7763payment successful
Redcompra5186 0085 4123 3829payment failed
Prepago VISA4051 8860 0005 6590
CVV 123
payment successful
Prepago MASTERCARD5186 1741 1062 9480
CVV 123
payment failed

When authenticating with RUT and key, you must use RUT 11.111.111-1, clave 123.

Query Payin Order

HTTP Request

TIP

POST baseUrl + /api/payInQuery

Request Headers

HeaderNameRequiredValue
Content-TypeYapplication/json
MerchantIdYMerchantId
SignYSign

RequestBody

ParameterRequiredTypeExampleDescription
mchOrderNoNstring(32)P123456Merchant order number
orderNoNstring(32)PAYIN12345Platform order number
nonceStrYstring(32)1628381288000Random 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.

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "100001",
    "mchOrderNo": "M1656752128806",
    "orderNo": "PAYIN8231497473279467520",
    "payType": "1",
    "payCode": "646012000000015887",
    "payUrl": null,
    "amount": 100.0,
    "fee": null,
    "orderStatus": "PAYING",
    "completionTime": null
  }
}
ParameterTypeDescription
merchantIdintMerchantId
mchOrderNostring(32)Merchant order number
orderNostring(32)Platform order number
channelOrderNostring(32)Channel order number
payTypestring(32)pls refer to Payin PayType Enum
payCodestring(32)支付码
payUrlstring(250)Payment QR Code
amountdecimal(20,0)Amount
feedecimal(20,4)fee
orderStatusstring(32)Order StatusPayin Order Status Enum
completionTimedateComplete time

TIP

fee and completionTime only have a value if the order is successfully paid.

Async Webhook Notification

HTTP Request

TIP

POST : notifyUrlnotifyUrlis provided by the merchant

Request Headers

HeaderNameRequiredValue
Content-TypeYapplication/json
MerchantIdYMerchantId
SignYSign

Webhook RequestBody

json
{
  "orderStatus": "SUCCESS",
  "amount": 10000.0,
  "fee": 0,
  "mchOrderNo": "2a6421c4-3758-4d1a-b47e-f7d0e7133f9e",
  "merchantId": "100001",
  "orderNo": "PAYDESKxxxxxxxxxxx",
  "payUrl": "xxxxxxxxxxxx",
  "completionTime": "2022-08-08 08:08:08",
  "nonceStr": "xxxxxxxxxx"
}
ParameterTypeDescription
merchantIdintMerchantId
mchOrderNostring(32)Merchant order number (should be unique in the merchant system)
orderNostring(32)Platform order number
amountdecimal(20,2)Amount
feedecimal(20,4)fee (fee only after successful payment)
payUrlstring(32)Payment Url
orderStatusstring(32)Order Status
completionTimedateCompletion time yyyy-MM-dd HH:mm:ss
nonceStrstring(32)Random string

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.

Released under the MIT License.