Skip to main content

kobana banking payments

Payments (unified)

Commands of kobana banking payments. Every global option (Global options) applies here.

CommandHTTPDescription
payments listGET /v2/paymentsList Payments
payments createPOST /v2/paymentsCreate a Payment
payments barcodePOST /v2/payments/barcodeCreate a Payment by barcode
payments getGET /v2/payments/{uid}View a Payment
payments approvePUT /v2/payments/{uid}/approveRelease (approve) a Payment
payments cancelPUT /v2/payments/{uid}/cancelCancel a Payment

payments list​

List Payments

kobana banking payments list [OPTIONS]

GET /v2/payments

Lists all payments of any type (PIX, Bank Billet, DARF, Taxes, Utilities). Supports filters and pagination. This is a unified endpoint that returns payments of all types through a single query.

Query parameters

NameTypeRequiredDescription
pageintegernoPage Number
per_pageintegernoNumber of records per page
kindstringnoFilter by payment type Values: bank_billet, darf, utility, gru, pix, tax.
statusstringnoFilter by status Values: pending, scheduled, confirmed, rejected, canceled.
created_fromstringnoFilter by initial creation date (format: YYYY-MM-DD, inclusive)
created_tostringnoFilter by final creation date (format: YYYY-MM-DD, includes the entire day)
updated_fromstringnoFilter by initial update date (format: YYYY-MM-DD, inclusive)
updated_tostringnoFilter by final update date (format: YYYY-MM-DD, includes the entire day)
scheduled_fromstringnoFilter by initial scheduled date (format: YYYY-MM-DD)
scheduled_tostringnoFilter by final scheduled date (format: YYYY-MM-DD)
scheduledbooleannoFilter only scheduled (true) or non-scheduled (false) payments
identifierstringnoSearch by identifier (partial search)
external_idstringnoFilter by external ID

Responses

HTTPDescription
200Payments Found

payments create​

Create a Payment

kobana banking payments create [OPTIONS]

POST /v2/payments

Generic endpoint for creating payments of any type. The type must be specified in the kind field.

Prerequisites

To issue a payment, you must have a Financial Account, informed in financial_account_uid. The payment account that records the operation is defined in payment_account_uid; if omitted, the oldest linked to the financial account is used; if informed, it must belong to financial_account_uid.

Supported Types

PIX Use kind: "pix" and provide the pix key:

{
"kind": "pix",
"financial_account_uid": "...",
"amount": 100.0,
"pix": {
"qrcode": "00020126330014br.gov.bcb.pix..."
}
}

Bank Billet Use kind: "bank_billet" and provide the bank_billet key:

{
"kind": "bank_billet",
"financial_account_uid": "...",
"amount": 200.0,
"bank_billet": {
"code": "81770000001-8 00005659970-7 41131079703-9 0014334-8"
}
}

DARF Use kind: "darf" and provide the darf key:

{
"kind": "darf",
"financial_account_uid": "...",
"amount": 300.0,
"darf": {
"tax_code": "0107",
"calculation_date": "2024-12-31",
"expire_at": "2025-01-10"
}
}

Taxes Use kind: "tax" and provide the tax key with bar code:

{
"kind": "tax",
"financial_account_uid": "...",
"amount": 400.0,
"tax": {
"kind": "iptu",
"code": "81770000001-8 00005659970-7..."
}
}

Utility Bills Use kind: "utility" and provide the utility key:

{
"kind": "utility",
"financial_account_uid": "...",
"amount": 500.0,
"utility": {
"code": "81770000001-8 00005659970-7..."
}
}

Webhook Events

The payment.db.created event is triggered in this operation.

Unified Endpoint: This endpoint unifies the creation of all types of payments. To create payments of a specific type, you can also use the dedicated endpoints in /api/v2/payment/{type}.

Request body

The body is not a plain object (or has variants). See kobana schema banking.payments.create.

Responses

HTTPDescription
201Utility Bill Payment created
422Tax with format=code and missing code

payments barcode​

Create a Payment by barcode

kobana banking payments barcode [OPTIONS]

POST /v2/payments/barcode

Creates a payment from just the barcode or the typable line. The payment type is resolved from the code itself, following the FEBRABAN v08 layout, and returned in the kind field of the response:

Codekind
47 positions, or 44 not starting with 8bank_billet
starts with 8, segment 2, 3, 4, 6 or 7utility
starts with 8, segment 1 or 5tax, with tax.kind = "unknown" and tax.format = "code"

The code is rejected with 422 when a check digit does not match (the general one, in boleto and collection codes, and the field or block ones of the typable line), when it uses segment 9, 0 or 8, when the length does not match the first digit (47 positions starting with 8, 48 not starting with 8), or when it is an FGTS slip (segment 5 with agreement 0181 or 0182 in positions 16 to 19).

Prerequisites

payment_account_uid is required and defines the source financial account. financial_account_uid is not accepted in this endpoint.

amount is optional when the code carries the amount to pay: collection codes with value identifier 6 or 8 (3rd position) and boletos with a non-zero amount. Without amount, the payment uses the code's amount; for a boleto, it is the face value, without interest, fine or discount. It is required for collection codes with identifier 7 or 9, where the code's amount is only a reference, and when the code comes with a zero amount.

Webhook Events

The payment.db.created event is triggered by this operation.

Request body

NameTypeRequiredDescription
codestringyesBarcode (44 positions) or typable line (47 or 48 positions). Spaces, periods, hyphens and slashes are discarded.
payment_account_uidstring (uuid)yesUID of the source Payment Account. Required: there is no automatic selection.
amountnumbernoAmount. Optional when the code carries the amount to pay (collection code with value identifier 6 or 8, or boleto with a non-zero amount): without it, the code's amount applies, which for a boleto is the face value, without interest, fine or discount. Required for collection codes with identifier 7 or 9 and when the code comes with a zero amount. When sent, it always prevails over the code's amount: to pay an overdue boleto with charges, send the amount including them.
scheduled_tostring (date)noScheduling Date
beneficiaryobjectnoBeneficiary information. Required when the code is a boleto and the financial account is BB.
identifierstringnoPayment identification on the financial provider's receipt.
external_idstringnoID in your system. Optional for internal control.
custom_dataobjectnoHash with key and value in JSON format.
tagsarray<string>noAssociated tags

More fields and nested objects: kobana schema banking.payments.barcode.

Responses

HTTPDescription
201Boleto payment created
422Code with reference amount, without amount

payments get​

View a Payment

kobana banking payments get [UID] [OPTIONS]

GET /v2/payments/{uid}

Consults specific information about a Payment of any type. The type is identified automatically and the response is serialized appropriately.

Path arguments: uid

Responses

HTTPDescription
200GRU Tax with format=data
404Payment Not Found

payments approve​

Release (approve) a Payment

kobana banking payments approve [UID] [OPTIONS]

PUT /v2/payments/{uid}/approve

Asynchronous Processing: creates a release (approve) command for a Payment that is awaiting approval.

The release is done asynchronously: when receiving the request, we create a Command that is processed in the background. You receive the ID of the created command in the response and can consult it at any time.

⚠️ Bank support: not all providers expose individual payment release via API. When the provider does not support the operation, the response is 422.

Path arguments: uid

Responses

HTTPDescription
200Release command created successfully
422Payment is not in a state that allows release or provider does not support

payments cancel​

Cancel a Payment

kobana banking payments cancel [UID] [OPTIONS]

PUT /v2/payments/{uid}/cancel

Asynchronous Processing: This endpoint is processed asynchronously and creates a cancellation command for the Payment. The cancellation of a Payment is done asynchronously, that is, when receiving the request, our API stores the request and creates a Command. This command is processed in the background and after being confirmed, the Payment has its status changed to Canceled. You receive the ID of the created command in the response of this request and can consult it at any time.

Webhook Events

When the request is made, a payment.{type}.cancel.requested event is triggered (where {type} can be pix, bank_billet, etc). Our server then starts attempts to send the cancellation to the financial institution. Only after confirmed at the financial institution, then the payment is marked as canceled in our database. At this moment the payment.{type}.cancel.confirmed event is triggered.

⚠️ Attention to Canceled status: The Canceled status is terminal. The payment can no longer be processed after cancellation.

Path arguments: uid

Responses

HTTPDescription
200Payment cancelled without provider interaction
422Payment has already been confirmed, rejected, or canceled