重复支付
PayCash重复支付所生成的交易号(reference number)可被多次支付,并在Liquido后台中被记录为多笔收款订单。
支付者在秘鲁的线下支付网点进行支付时,需要同时提供本接口生成的交易号(reference number/referencia)以及一个网点对应的协议号(agreement code/convenio)给收银员以完成交易。 交易号能在接口返回的“referenceNumber”字段获取。而协议号则需以线下支付网点对应,具体请参考协议号对照表。
HTTP 请求
POST
/v1/payments/charges/references
Content-Type: application/json
{
"transferStatusCode": 200,
"idempotencyKey": "06c28bb9-9bbe-4e8b-9064-2a23daff914d",
"country": "PE",
"currency": "PEN",
"createTime": "2025-02-19 19:38:02 UTC",
"status": "ACTIVE",
"description": "this is a test reference",
"callbackUrl": "https://api.client.com/callback/",
"transferDetails": {
"payCash": {
"amount": 0,
"expirationDate": "2025-02-21",
"reference": "7041740022683866"
}
}
}
通知 / 回调
Content-Type: application/json
{
"eventType":"CHARGE_SUCCEEDED",
"data":{
"chargeDetails":{
"transferStatusCode":200,
"transferErrorMsg":null,
"idempotencyKey":"06c28bb9-9bbe-4e8b-9064-2a23daff914d",
"referenceId":"06c28bb9-9bbe-4e8b-9064-2a23daff914d",
"paymentMethod":"PAY_CASH",
"amount":1000,
"currency":"PEN",
"country":"PE",
"finalAmount": 1000,
"finalCurrency": "PEN",
"createTime": "2025-02-19 19:38:02 UTC",
"finalStatusTime":"2025-02-20 00:30:55 UTC",
"payer":{},
"transferStatus":"SETTLED",
"description":"this is a test pay",
"callbackUrl":"https://api.client.com/callback/",
"transferDetails":{
"payCash":{
"referenceNumber":"7041740022683866",
"expirationDate":"2025-02-21",
"recurring":true,
"paymentTime": "2025-02-19 19:29:20"
}
}
}
}
}
HTTP Headers 字段说明
Key | Value |
---|---|
Authorization | "Bearer" + " " + {{access_token}} |
x-api-key | {{api_key}} |
Request Body 字段说明
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
idempotencyKey | String | 商户系统创建的唯一ID, 长度不大于128个字节。 | |
paymentMethod | String | 支付方式. 枚举值 PAY_CASH | |
country | String | 国家编号国际缩写码,遵循ISO 3166-1 alpha-2 code标准, 如秘鲁PE | |
currency | String | 货币代码,如秘鲁PEN | |
amount | Long | 交易金额,单位是货币最小粒度,如 100 = 1PEN。默认值为0。 若金额为‘0’,消费者可以拿着交易号去线下网点支付任意金额,例如:消费者可以第一次去支付100PEN,然后第二次去支付200PEN。 若金额不为‘0’,比如此处值为‘50000’,意味着消费者去线下网点支付时,每次都只能支付固定金额500PEN。 |
|
expirationDate | String | 交易过期时间,格式:yyyy-MM-dd | |
description | String | 支付描述 | |
callbackUrl | String | 接收交易状态变更通知的地址。接收post请求。 |
Response Body 字段说明
参数 | 类型 | 描述 |
---|---|---|
transferStatusCode | Integer | 此次交易的状态码, 200表示交易成功或者进行中, 其他代表失败 |
idempotencyKey | String | 此参数用于幂等目的,交易的唯一标识ID,长度不大于128个字节。 |
country | String | 国家编码 PE |
currency | String | 收款货币代码,长度为3个字节,PEN |
createTime | String | 创建时间 |
status | String | 交易状态 |
description | String | 描述信息 |
transferDetails | JSON | 交易类型的详细信息 |
callbackUrl | String | 接收交易状态变更通知的地址。接收post请求。 |
对象字段说明
TransferDetails
参数 | 类型 | 描述 |
---|---|---|
payCash | JSON | PayCash支付的详细信息 |
PayCash
参数 | 类型 | 描述 |
---|---|---|
amount | Long | 交易金额 |
expirationDate | String | 过期日期 秘鲁时间 "yyyy-MM-dd" |
reference | String | 这是一个可以被多次重复使用的交易号。支付者在支付时,需要提供的交易号(reference number/referencia)。需要注意的是除此之外,用户还需根据其支付网点,提交对应的协议号。 |
状态
参数 | 描述 |
---|---|
ACTIVE | 交易已成功创建,是正常进行中的交易状态。 |
EXPIRED | 交易过期 |
CANCELLED | 交易取消 |
FAILED | 交易失败,异常 |
Notification 事件类型
CHARGE_SUCCEEDED,
CHARGE_FAILED,
CHARGE_CHARGED_BACK,
CHARGE_REFUND_SUCCEEDED,
CHARGE_REFUND_FAILED;
协议号对照表
支付网点 | 协议号 | 备注 |
---|---|---|
Caja Trujillo | Don't need an agreement code. | Provide a full 16-digit reference |
Caja Los Andes | Don't need an agreement code. | Provide a full 16-digit reference |
Financiera QAPAQ | Don't need an agreement code. | Provide a full 16-digit reference |
Edpyme Alternativa | Don't need an agreement code. | Provide a full 16-digit reference |
Caja Paita | Don't need an agreement code. | Provide a full 16-digit reference |
Caja Municipal Del Santa | Don't need an agreement code. | Provide a full 16-digit reference |
Western Union | Don't need an agreement code. | Provide a full 16-digit reference |
Banco Pichincha | Don't need an agreement code. | Provide a full 16-digit reference |
Kasnet | 220114 | Provide a full 16-digit reference |
Banco BCP | 24162 | Provide the last 13 digits of the reference |
Yape | Don't need an agreement code. | Provide the last 13 digits of the reference |
Agente Cash | Don't need an agreement code. | Provide a full 16-digit reference |
BBVA Perú | Don't need an agreement code. | Provide a full 16-digit reference |
Interbank | 0319901 | Provide a full 16-digit reference |
IZIPAY | Don't need an agreement code. | Provide a full 16-digit reference |
Banco del comercio | Don't need an agreement code. | Provide a full 16-digit reference |
Megapunto | Don't need an agreement code. | Provide a full 16-digit reference |
Red digital | Don't need an agreement code. | Provide a full 16-digit reference |
Niubiz | Don't need an agreement code. | Provide a full 16-digit reference |
Caja Arequipa | Don't need an agreement code. | Provide a full 16-digit reference |
Banbif | Don't need an agreement code. | Provide the last 14 digits of the reference |
FULL CARGA | Don't need an agreement code. | Provide the last 14 digits of the reference |
PREXPE | Don't need an agreement code. | Provide the last 14 digits of the reference |
ASTROPAY | Don't need an agreement code. | Provide the last 14 digits of the reference |
Floid | Don't need an agreement code. | Provide a full 16-digit reference |