Skip to content

单次支付

PayCash单次支付所生成的交易号(reference number)仅可被支付一次。

支付者在秘鲁的线下支付网点进行支付时,需要同时提供本接口生成的交易号(reference number/referencia)以及一个网点对应的协议号(agreement code/convenio)给收银员以完成交易。 交易号能在接口返回的“referenceNumber”字段获取。而协议号则需以线下支付网点对应,具体请参考协议号对照表

HTTP请求

POST /v1/payments/charges/paycash

Request Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer {{access_token}}",
    "x-api-key": "{{api_key}}"
}
Request Body
{
    "idempotencyKey": "d5cd70af-6e64-4f2b-b4ce-fca206b31422",
    "amount": 1000,
    "currency": "PEN",
    "country": "PE",
    "paymentMethod": "PAY_CASH",
    "paymentFlow": "DIRECT",
    "payer": {
        "name": "username",
        "email": "username@liquido.com",
        "billingAddress": { 
                "street": "street name",
                "number": "building number",
                "complement": "unit, apt, etc.",
                "district": "district, neighborhood, etc.",
                "city": "city name",
                "state": "state, state code",
                "zipCode": "zip code, postal code",
                "country": "PE"
            }
    },
    "orderInfo": {  
        "orderId": "test-order-id",  
        "shippingInfo": { 
            "name": "shipping test name",   
            "email": "shipping@example.com",
            "address": { 
                "street": "street name",
                "number": "building number",
                "complement": "unit, apt, etc.",
                "district": "district, neighborhood, etc.",
                "city": "city name",
                "state": "state, state code",
                "zipCode": "zip code, postal code",
                "country": "PE"
            }
        }
    },
    "callbackUrl":"https://api.client.com/callback/",
    "description": "this is a test pay",
    "expirationDate": "2025-02-03",
    "recurring": false,
    "subMerchantId": "UUID"
}
Content-Type: application/json
{
    "transferStatusCode": 200,
    "transferErrorMsg": null,
    "idempotencyKey": "d5cd70af-6e64-4f2b-b4ce-fca206b31422",
    "referenceId": "d5cd70af-6e64-4f2b-b4ce-fca206b31422",
    "paymentMethod": "PAY_CASH",
    "amount": 1000,
    "currency": "PEN",
    "country": "PE",
    "finalAmount": 100,
    "finalCurrency": "PEN",
    "createTime": "2025-02-01 01:13:01 UTC",
    "scheduledTime": "2025-02-01 01:13:18 UTC",
    "finalStatusTime": null,
    "payer": {
        "name": "username",
        "email": "username@liquido.com",
        "billingAddress": { 
                "street": "street name",
                "number": "building number",
                "complement": "unit, apt, etc.",
                "district": "district, neighborhood, etc.",
                "city": "city name",
                "state": "state, state code",
                "zipCode": "zip code, postal code",
                "country": "PE"
            }
    },
    "transferStatus": "IN_PROGRESS",
    "description": "this is a test pay",
    "callbackUrl": "https://api.client.com/callback/",
    "transferDetails": {
        "payCash": {
            "referenceNumber": "7041739762691026",
            "expirationDate": "2025-02-03",
            "recurring": false
        }
    },
    "subMerchantId": "UUID"
}

通知 / 回调

Content-Type: application/json
{
    "eventType":"CHARGE_SUCCEEDED",
    "data":{
        "chargeDetails":{
            "transferStatusCode":200,
            "transferErrorMsg":null,
            "idempotencyKey":"d5cd70af-6e64-4f2b-b4ce-fca206b31422",
            "referenceId":"d5cd70af-6e64-4f2b-b4ce-fca206b31422",
            "paymentMethod":"PAY_CASH",
            "amount":1000,
            "currency":"PEN",
            "country":"PE",
            "finalAmount": 1000,
            "finalCurrency": "PEN",
            "createTime": "2025-02-01 01:13:01 UTC",
            "scheduledTime": "2025-02-01 01:13:18 UTC",
            "finalStatusTime":"2025-02-02 00:30:55 UTC",
            "payer":{
                "name":"username",
                "email":"username@example.com",
                "billingAddress": { 
                    "street": "street name",
                    "number": "building number",
                    "complement": "unit, apt, etc.",
                    "district": "district, neighborhood, etc.",
                    "city": "city name",
                    "state": "state, state code",
                    "zipCode": "zip code, postal code",
                    "country": "PE"
                }
            },
            "transferStatus":"SETTLED",
            "description":"this is a test pay",
            "callbackUrl":"https://api.client.com/callback/",
            "transferDetails":{
                "payCash":{
                    "referenceNumber":"7041739762691026",
                    "expirationDate":"2025-02-03",
                    "recurring":false,
                    "paymentTime": "2025-02-01 19:29:20"
                }
            },
            "subMerchantId": "UUID"
        }
    }
}

HTTP Headers 字段说明

Key Value
Authorization "Bearer" + " " + {{access_token}}
x-api-key {{api_key}}

Request Body 字段说明

参数 必填 类型 描述
idempotencyKey String 商户系统创建的唯一ID, 长度不大于128个字节。
amount Long 收款金额,单位是货币最小粒度。 如 1 = 0.01PEN
country String 国家编号国际缩写码,遵循ISO 3166-1 alpha-2 code标准, 如秘鲁PE
currency String 货币代码,如秘鲁新索尔PEN
paymentMethod String 支付方式,枚举值 PAY_CASH
paymentFlow String 交易流程, 如DIRECT 或 REDIRECT
payer JSON 买家个人信息
orderInfo JSON 订单信息
description String 描述
callbackUrl String 接收交易状态变更通知的地址。接收post请求。
expirationDate String 交易过期时间,格式:yyyy-MM-dd
recurring Boolean 交易分单次或多次付清,目前仅支持单次,值固定为:false
subMerchantId String 子商户ID。商户类型为PSP时必填。
riskData JSON 支付的风险信息。MERCHANT_APP_NAME 或 *
MERCHANT_WEBSITE* 在riskData中必须填一个。 请参考这里查看更多详情。
创建一个带风控信息的支付

请参考这里查看更多详情。

Response Body 字段说明

参数 类型 描述
transferStatus String 汇款状态,枚举值,"SETTLED", "FAILED", "IN_PROGRESS"
transferStatusCode Integer 此次交易的状态码, 200表示交易成功或者进行中, 其他代表失败
transferErrorMsg String 此次交易失败原因
referenceId String 此次交易的ID
idempotencyKey String 此参数用于幂等目的,交易的唯一标识ID,长度不大于128个字节。
amount Long 收款金额
country String 国家编码 PE
currency String 收款货币代码,长度为3个字节,PEN
finalAmount Long 用于创建收款订单的最终金额。对于需要转换汇率的收款订单,这个字段的值表示源请求金额被转换后的金额。
finalCurrency String finalAmount的收款货币代码
paymentMethod String 支付方式。 枚举值如PAY_CASH
payer JSON 付款人信息
transferDetails JSON 交易类型的详细信息
description String 描述信息
callbackUrl String 商户接收通知的回调地址,接收http的post请求
createTime String 创建时间
scheduledTime String 执行时间
finalStatusTime String 最终状态更新时间. 最终状态,包括"SETTLED", "FAILED"
subMerchantId String 子商户ID。

对象字段说明

Payer
参数 必填 类型 描述
name String 名字,全称(入参名字规范:只允许大小写字母,数字和空格的组合。请勿包含西班牙语和葡萄牙语字母,以及其他特殊字符。)
email String 邮箱
phone String 电话号码,需包含“+51”的前缀。
billingAddress JSON 账单邮寄地址
BillingAddress
参数 必填 类型 描述
zipCode String 邮政编码
state String
city String 城市
street String 街道
number String 门牌号
OrderInfo
参数 必填 类型 描述
orderId String 订单号
shippingInfo JSON 运输信息
ShippingInfo
参数 必填 类型 描述
name String 名称
phone String 电话号码,需包含“+51”的前缀。
email String 邮箱地址
address JSON 地址信息,结构和billingAddress一致
TransferDetails
参数 类型 描述
payCash JSON PayCash支付的详细信息
PayCash
参数 类型 描述
referenceNumber String 支付者在支付时,需要提供的交易号(reference number/referencia)。需要注意的是除此之外,用户还需根据其支付网点,提交对应的协议号
expirationDate String 过期日期 秘鲁时间 "yyyy-MM-dd"
recurring Boolean 是否可以多次付款
paymentTime String 实际支付时间 秘鲁时间 "yyyy-MM-dd HH:mm:ss"

支付状态

参数 描述
IN_PROGRESS 交易处理中
SETTLED 交易完成
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
Back to top