跳转至

Boleto

Boleto 支付

创建一个boleto收款记录

HTTP请求

POST /v1/payments/charges/boleto

请求头

Request Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer {{access_token}}",
    "x-api-key": "{{api_key}}"
}
Key Value
Authorization "bearer {{access_token}}"
x-api-key {{api_key}}

请求体

Request Body
{
    "idempotencyKey": "0bd88f8a-2c7e-4b95-903f-8da45d0e6129",
    "amount": 10000,
    "currency": "BRL",
    "country": "BR",
    "paymentMethod": "BOLETO",
    "paymentFlow": "DIRECT",
    "payer": {
        "name": "Cliente - Isabela",
        "document": {
            "documentId": "51364124025",
            "type": "CPF"
        },
        "email": "testeemail@gmail.com",
        "phone": "+55 81987654321",
        "billingAddress": {  
            "zipCode": "04849333",
            "state": "SP",
            "city": "sao paulo",
            "district": "Jardim Gaivotas",
            "street": "Rua 9 de setembro",
            "number": "15",
            "complement": "casa",
            "country": "BR"
        }
    },
    "orderInfo": {  
        "orderId": "test-order-id",  
        "shippingInfo": { 
            "name": "shipping test name",  
            "phone": "+55 81987654321",  
            "email": "thiago@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": "BR"
            }
        }
    },
    "paymentTerm": {
        "paymentDeadline": 1671194415
    },
    "description": "this is a test pay",
    "callbackUrl": "https://api.client.com/callback/",
    "subMerchantId": "UUID"
}
参数 必填 类型 描述
idempotencyKey String 商户系统创建的唯一ID, 长度不大于128个字节。
amount Long 收款金额,单位是货币最小粒度。如 1 = 0.01BRL
country String 国家编号国际缩写码,遵循ISO 3166-1 alpha-2 code标准, 如巴西BR
currency String 货币代码,如巴西BRL
paymentMethod String 交易方式,枚举值BOLETO
paymentFlow String 交易流程, 如DIRECT 或 REDIRECT
payer JSON 买家个人信息。
payerAddress JSON 账单邮寄地址. 弃用,请使用payer中的billingAddress替代
paymentTerm JSON 支付期限信息
orderInfo JSON 订单信息
description String 描述
callbackUrl String 接收交易状态变更通知的地址。接收post请求。
subMerchantId String 子商户ID。商户类型为PSP时必填。
riskData JSON 支付的风险信息。MERCHANT_APP_NAMEMERCHANT_WEBSITE 在riskData中必须填一个。 请参考这里查看更多详情。

创建一个带风控信息的支付

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

响应

Content-Type: application/json
{
    "transferStatusCode": 200,
    "transferErrorMsg": "",
    "idempotencyKey": "0bd88f8a-2c7e-4b95-903f-8da45d0e6129",
    "referenceId": "0bd88f8a-2c7e-4b95-903f-8da45d0e6129",
    "paymentMethod": "BOLETO",
    "amount": 10000,
    "currency": "BRL",
    "finalAmount": 10000,
    "finalCurrency": "BRL",
    "country": "BR",
    "createTime": "2022-12-08 08:02:14 UTC",
    "scheduledTime": "2022-12-08 08:02:15 UTC",
    "payer": {
        "name": "Cliente - Isabela",
        "document": {
            "documentId": "51364124025",
            "type": "CPF"
        },
        "email": "testeemail@gmail.com",
        "phone": "+55 81987654321",
        "billingAddress": {
            "street": "Rua 9 de setembro",
            "number": "15",
            "complement": "casa",
            "district": "Jardim Gaivotas",
            "city": "sao paulo",
            "state": "SP",
            "zipCode": "04849333",
            "country": "BR"
        }
    },
    "transferStatus": "IN_PROGRESS",
    "description": "this is a test",
    "callbackUrl": "https://api.liquido.com/v1/cashier/callback/",
    "transferDetails": {
        "boleto": {
            "barcode": "33299919800000100000001110725354807300286435",
            "digitalLine": "33290001151072535480673002864350991980000010000",
            "paymentTerm": {
                "paymentDeadline": 1671194415
            }
        }
    },
    "subMerchantId": "UUID"
}
参数 类型 描述
transferStatus String 汇款状态,枚举值,"SETTLED", "FAILED", "IN_PROGRESS"
transferStatusCode Integer 此次交易的状态码, 200表示交易成功或者进行中, 其他代表失败
transferErrorMsg String 此次交易失败原因
referenceId String 此次交易的ID
idempotencyKey String 此参数用于幂等目的,交易的唯一标识ID 长度不大于128个字节。
amount Long 收款金额
country String 国家编码 BR
currency String 收款货币代码,长度为3个字节,BRL
finalAmount Long 用于创建收款订单的最终金额。对于需要转换汇率的收款订单,这个字段的值表示源请求金额被转换后的金额。
finalCurrency String finalAmount的收款货币代码
paymentMethod String 支付方式. 枚举值, BOLETO
paymentFlow String 支付流程. 枚举值, DIRECT
payer JSON 付款人信息
transferDetails JSON 交易其他详细信息
description String 描述信息
callbackUrl String 商户接收通知的回调地址. 接收http的get请求.
createdTime String 创建时间
scheduledTime String 执行时间
finalStatusTime String 最终状态更新时间. 最终状态,包括"REFUNDED", "FAILED"
amountDetails JSON 金额详细信息
subMerchantId String 子商户ID。

通知 / 回调

Content-Type: application/json
{
    "eventType": "CHARGE_SUCCEEDED",
    "data":  {
        "chargeDetails": {
            "transferStatusCode": 200,
            "transferErrorMsg": "",
            "idempotencyKey": "0bd88f8a-2c7e-4b95-903f-8da45d0e6129",
            "referenceId": "0bd88f8a-2c7e-4b95-903f-8da45d0e6129",
            "paymentMethod": "BOLETO",
            "amount": 10000,
            "currency": "BRL",
            "finalAmount": 10000,
            "finalCurrency": "BRL",
            "country": "BR",
            "createTime": "2022-12-08 08:02:14 UTC",
            "scheduledTime": "2022-12-08 08:02:15 UTC",
            "finalStatusTime": "2022-12-08 08:47:02 UTC",
            "payer": {
                "name": "Cliente - Isabela",
                "document": {
                    "documentId": "51364124025",
                    "type": "CPF"
                },
                "email": "testeemail@gmail.com",
                "phone": "+55 81987654321",
                "billingAddress": {
                    "street": "Rua 9 de setembro",
                    "number": "15",
                    "complement": "casa",
                    "district": "Jardim Gaivotas",
                    "city": "sao paulo",
                    "state": "SP",
                    "zipCode": "04849333",
                    "country": "BR"
                }
            },
            "transferStatus": "SETTLED",
            "description": "this is a test",
            "callbackUrl": "https://api.liquido.com/v1/cashier/callback/",
            "transferDetails": {
                "boleto": {
                    "barcode": "33299919800000100000001110725354807300286435",
                    "digitalLine": "33290001151072535480673002864350991980000010000",
                    "paymentTerm": {
                        "paymentDeadline": 1671194415
                    }
                }
            },
            "subMerchantId": "UUID"
        }
    }
}

对象字段说明

Payer

参数 必填 类型 描述
name String 名字,全称(入参名字规范:只允许大小写字母,数字和空格的组合。请勿包含西班牙语和葡萄牙语字母,以及其他特殊字符。)
email String 邮箱。
phone String 电话号码,需包含“+55”的前缀。
document JSON 可确认身份的证件,例如巴西居民的CPF.
billingAddress JSON 账单邮寄地址.

Document

参数 必填 类型 描述
documentId String 证件号码
type String 证件类型,暂时支持CPF或者CNPJ

OrderInfo

参数 必填 类型 描述
orderId String 订单号
shippingInfo JSON 运输信息

ShippingInfo

参数 必填 类型 描述
name String 名称
phone String 电话号码,需包含“+55”的前缀。
email String 邮箱地址
address JSON 地址信息,结构和billingAddress一致

Address

参数 必填 类型 描述
zipCode String 邮政编码,如巴西的CEP
state String 州,缩写,如圣保罗是SP
city String 城市.
district String 区县.
street String 街道.
number String 门牌号.
complement String 补充信息.
country String 国家代码.

PaymentTerm

参数 必填 类型 描述
paymentDeadline Long 支付期限,不能大于当前时间5年,秒级时间戳

TransferDetails

参数 类型 描述
boleto JSON boleto 相关信息

Boleto

参数 类型 描述
barcode String 条形码
digitalLine String 数字线
paymentTerm JSON 支付期限

Paymentterm(响应)

参数 类型 描述
paymentDeadline Long 支付期限,不能大于当前时间5年,秒级时间戳

Transfer Status

参数 描述
IN_PROGRESS 交易处理中
SETTLED 交易完成
REFUNDING 退款中
REFUNDED 已退款
FAILED 交易失败,异常

Notification Event Type

CHARGE_SUCCEEDED,
CHARGE_FAILED,
CHARGE_CHARGED_BACK,
CHARGE_REFUND_SUCCEEDED,
CHARGE_REFUND_FAILED;

Boleto 回执 PDF

回执PDF在支付创建结束后即可下载。

HTTP Request

GET /v1/payments/files/boleto/pdf/{{idempotencyKey}}

请求参数

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

响应参数

参数 必填 类型 描述
path String 回执PDF链接

PDF 例子

voucher

回到页面顶部