支付银行票据
此端点用于支付银行票据。支付必须在查询之后进行,使用查询返回的信息以确保流程正常运行,避免支付过程中出现失败。
银行票据
这是常规银行票据(数字行不以数字8开头)。在银行间支付结算所(CIP/Núclea)注册,可在巴西中央银行授权的金融和支付机构付款。
Request
请求端点
ENDPOINT
/account/ACCOUNT_KEY/payment/bank_slipMÉTODO
POST请求路径参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
account_key * | uuid4 | 账户唯一标识键。 | 36 |
Request Body: 使用数字行支付银行票据
{
"request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
"digitable_line": "00190000090361557400500000024174396700000991000",
"payment_amount": 1156.8
}
Request Body: 使用条形码支付银行票据
{
"request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
"barcode": "00190000090361557400500000024174396700000991000",
"payment_amount": 1156.8
}
Body 参数
| 字段 | 类型 | 描述 |
|---|---|---|
request_control_key * | uuid4 | 客户请求唯一标识键。 |
barcode | string | 条形码。 |
digitable_line | string | 数字行。 |
payment_amount * | number | 待支付金额。 |
警告
若银行票据不允许部分支付,payment_amount 必须始终等于银行票据查询返回的 total_amount。对于允许部分支付的票据,客户可以任意选择 payment_amount,甚至可以超过票据面值(total_amount)。
Response
成功响应
STATUS
201Response Body: 支付已执行
{
"payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
"request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
"payer_name":"COOPERATIVA INDUSTRIAL MURILO",
"payer_document_number":"00037025000160",
"source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
"transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
"transaction_revert_key":null,
"paid_amount":1050.1,
"payment_date":"2024-04-03",
"payment_type":"bank_slip",
"bank_slip": {
"bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
"barcode":"00193967000009910000000003615574000000002417",
"digitable_line":"00190000090361557400500000024174396700000991000",
"payer_name":"COOPERATIVA TESTE",
"payer_document_number":"00037025000160",
"beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
"beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
"beneficiary_document_number":"52069937000117",
"beneficiary_bank_ispb":"00000000",
"guarantor_name":null,
"guarantor_document_number":null,
"expiration_date":"2024-03-29",
"max_payment_data": "2026-03-29",
"partial_payment_indicator":"allowed",
"registered_payment_amount":9029.0,
"nominal_amount":9910.0,
"total_amount":10129.1,
"rebate_amount":0.0,
"discount_amount":0.0,
"fine_amount":0.0,
"interest_amount":219.1
},
"collection_slip":null,
"payment_status":"executed"
}
STATUS
202Response Body: 支付待执行
{
"payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
"request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
"payer_name":"COOPERATIVA INDUSTRIAL MURILO",
"payer_document_number":"00037025000160",
"source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
"transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
"transaction_revert_key":null,
"paid_amount":1050.1,
"payment_date":"2024-04-03",
"payment_type":"bank_slip",
"bank_slip": {
"bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
"barcode":"00193967000009910000000003615574000000002417",
"digitable_line":"00190000090361557400500000024174396700000991000",
"payer_name":"COOPERATIVA TESTE",
"payer_document_number":"00037025000160",
"beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
"beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
"beneficiary_document_number":"52069937000117",
"beneficiary_bank_ispb":"00000000",
"guarantor_name":null,
"guarantor_document_number":null,
"expiration_date":"2024-03-29",
"max_payment_data": "2026-03-29",
"partial_payment_indicator":"allowed",
"registered_payment_amount":9029.0,
"nominal_amount":9910.0,
"total_amount":10129.1,
"rebate_amount":0.0,
"discount_amount":0.0,
"fine_amount":0.0,
"interest_amount":219.1
},
"collection_slip":null,
"payment_status": "pending_execution"
}
信息
若返回 HTTP Status 202 且 payment_status 字段值为 pending_execution,则不应重新尝试支付。
该支付将异步处理。需要通过支付查询核实转账状态,或等待 webhooks 页面 中描述的待执行支付 webhook。
Response Body 参数
| 字段 | 类型 | 描述 |
|---|---|---|
payment_key * | uuid4 | 支付唯一标识键。 |
request_control_key * | uuid4 | 客户请求唯一标识键。 |
payer_name * | string | 实际付款人姓名。 |
payer_document_number * | string | 实际付款人文件号码(CPF/CNPJ)。 |
source_account_key * | uuid4 | 被扣款账户的键。 |
transaction_key * | uuid4 | 支付交易键。 |
transaction_revert_key | uuid4 | 支付冲销交易键。 |
paid_amount * | number | 实际支付金额。 |
payment_date * | string | 支付日期。 |
payment_type * | enum | 支付类型。 |
bank_slip | object | 银行票据。 |
collection_slip | object | 征税发票。 |
payment_status * | enum | 支付状态。 |
payment_type 枚举值
| 枚举值 | 类型 | 描述 |
|---|---|---|
bank_slip | string | 银行票据 |
collection_slip | string | 征税发票 |
警告
collection_slip 枚举值不适用于银行票据流程,collection_slip 对象也始终为空。
payment_status 枚举值
| 枚举值 | 描述 |
|---|---|
pending_execution | 待执行 |
executed | 已执行 |
reverted | 已冲销 |
rejected | 已拒绝 |
error | 错误 |
警告
对于 QI 在两分钟内未收到 CIP 响应的支付,支付将以 pending_execution 状态返回。QI 收到 CIP 响应后,将向客户发送 webhooks 页面 中描述的待执行支付 webhook。
bank_slip 对象
| 字段 | 类型 | 描述 |
|---|---|---|
barcode * | string | 条形码。 |
digitable_line * | string | 数字行。 |
payer_name * | string | 付款人姓名。 |
payer_document_number * | string | 付款人文件号码(CPF/CNPJ)。 |
beneficiary_name * | string | 受益人姓名。 |
beneficiary_trading_name | string | 受益人商业名称。 |
beneficiary_document_number * | string | 受益人文件号码(CPF/CNPJ)。 |
beneficiary_bank_ispb * | string | 受益人银行的 ispb 代码。 |
guarantor_name | string | 担保人姓名。 |
guarantor_document_number | string | 担保人文件号码(CPF/CNPJ)。 |
expiration_date * | string | 到期日期。 |
max_payment_date * | string | 最大支付日期。 |
partial_payment_indicator * | enum | 部分支付指示器。 |
registered_payment_amount | string | 注册的总支付金额。 |
nominal_amount * | number | 原始金额。 |
total_amount * | number | 总金额。 |
rebate_amount * | number | 折扣金额。 |
discount_amount * | number | 优惠金额。 |
fine_amount * | number | 罚款金额。 |
interest_amount * | number | 利息金额。 |
partial_payment_indicator 枚举值
| 枚举值 | 类型 | 描述 |
|---|---|---|
allowed | string | 允许 |
not_allowed | string | 不允许 |
错误响应
STATUS
4XXResponse Body
{
"title": "Título",
"description": "Description in english",
"translation": "Descrição em português",
"code": "Código"
}
| HTTP 代码 | QI 代码 | 标题 | 描述(英文) | 描述(葡文) |
|---|---|---|---|---|
| 400 | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400 | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400 | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404 | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400 | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400 | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400 | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400 | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000015 | Bad Request | Payment date is greater than the maximum payment date. | A data de pagamento é maior que a data máxima de pagamento. |
| 400 | BIP000016 | Bad Request | Payment date is smaller than the calculation date. | A data de pagamento é menor que a data de cálculo. |
| 400 | BIP000017 | Bad Request | Invalid payment amount. | Valor de pagamento inválido. |
| 400 | BIP000018 | Bad Request | Partial payment is not allowed. | Pagamento parcial não é permitido. |
| 400 | BIP000019 | Bad Request | The payment amount is greater than the available amount. | O valor do pagamento é maior que o valor disponível. |
| 400 | BIP000020 | Bad Request | All partial payments for this bank slip have already been made. | Todos os pagamentos parciais deste boleto já foram realizados. |
| 400 | BIP000022 | Bad Request | Bank slip payment service is closed. | Serviço de pagamento de boleto está fechado. |
| 400 | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400 | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400 | BIP000025 | Bad Request | It was not possible to pay the bank slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar o boleto neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
Sandbox 环境
在我们的 sandbox 环境中,我们提供了模拟的数字行,用于模拟成功支付和测试错误场景。
成功场景
| 数字行 |
|---|
| 00190000090361557400500000024174396700000991000 |
| 00190000090282802601919212747174596760001294161 |
| 23793390014000000455277000249001596900000103995 |
| 75691434020137513680900001040013196770002417240 |
| 21390001171200000570700168167484796770000148206 |
| 07790001161200000039300602819070498470000182970 |
| 23792372059034189564835003432701998420000008306 |
| 03399199530490000005254172701010698420000467696 |
| 03399135012340000000830681701014198420038743888 |
| 75691324620100735471370255730478698420064900819 |
pending_execution 场景
此场景的模拟在模拟页面中有更详细的描述。
| 数字行 |
|---|
| 75691333790100505390300569460017397220000306867 |
错误场景
| 数字行 | 错误代码 |
|---|---|
| 34191090083273252027893634770007296690012513600 | BIP000007 |
| 07090010287045349010776686070590896770001160123 | BIP000007 |
| 42297048060005815702500130494123896770000239491 | BIP000006 |
| 74891123702849020818918378871083196690000050000 | BIP000009 |
| 23792374119000209350986000372408496610000122810 | BIP000008 |