Skip to main content

kobana billing payments

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

CommandHTTPDescription
payments listGET /v1/paymentsList payments
payments createPOST /v1/paymentsProcess payment
payments bulk-update-invoicePOST /v1/payments/bulk-update-invoiceReassign payments to another invoice
payments getGET /v1/payments/{id}Get payment
payments deleteDELETE /v1/payments/{id}Delete payment
payments cancelPOST /v1/payments/{id}/cancelCancel payment
payments change-cardPOST /v1/payments/{id}/change-cardChange payment card
payments change-due-datePOST /v1/payments/{id}/change-due-dateChange bank slip due date
payments refundPOST /v1/payments/{id}/refundRefund payment
payments retryPOST /v1/payments/{id}/retryRetry payment
payments send-emailPOST /v1/payments/{id}/send-emailSend bank slip by email
payments syncPOST /v1/payments/{id}/syncSync payment with gateway

payments list​

List payments

kobana billing payments list [OPTIONS]

GET /v1/payments

Returns a paginated list of the current organization's payments.

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.
person_idstringnoFilter by associated person UUID.
person_document_numberstringnoFilter by person CPF/CNPJ (exact match).
person_name_containsstringnoFilter by person name (partial search, case-insensitive).
statusstringnoFilter by payment status. Values: pending, processing, succeeded, failed, canceled, partial, refunded, partially_refunded.
invoice_idstringnoFilter by payments of a specific invoice.
billing_account_idstringnoFilter by payments of a billing account.
company_idstringnoFilter by payments of a specific company.
gateway_idstringnoFilter by payments processed by a specific gateway.
payment_method_idstringnoFilter by payments of a specific payment method.
payment_method_typestringnoFilter by payment method: card, bank_slip, pix or bank_transfer. Values: card, bank_slip, pix, bank_transfer.
external_idstringnoFilter by external ID (free field for legacy system identifiers).
gateway_payment_idstringnoFilter by the payment identifier at the upstream gateway.
invoice_filterstringnoFilter by invoice presence: all, with_invoice or without_invoice. Values: all, with_invoice, without_invoice.
searchstringnoFree-text search.
amount_minnumber,nullnoMinimum charged amount (in BRL).
amount_maxnumber,nullnoMaximum charged amount (in BRL).
paid_amount_minnumber,nullnoMinimum amount actually received (in BRL).
paid_amount_maxnumber,nullnoMaximum amount actually received (in BRL).
created_afterstringnoStart of creation date range (YYYY-MM-DD).
created_beforestringnoEnd of creation date range (YYYY-MM-DD).
paid_afterstringnoPaid-at start date — ISO 8601 format.
paid_beforestringnoPaid-at end date — ISO 8601 format.

Responses

HTTPDescription
200Paginated list of payments.
404Resource not found in the current organization.

payments create​

Process payment

kobana billing payments create [OPTIONS]

POST /v1/payments

Processes a payment for an existing invoice. Accepts a previously registered payment_method_id or a payment_method block with card/PIX/bank-slip data. When amount is omitted, charges the invoice open balance.

Request body

NameTypeRequiredDescription
invoice_idstring (uuid)yesUUID of the invoice to be paid.
payment_method_idstring (uuid)noUUID of a payment method previously registered for the account.
payment_methodobjectno
amountnumbernoAmount to charge in BRL (float, up to 4 decimal places). Default: invoice open balance.
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoFree-form metadata defined by the client for internal correlation.

More fields and nested objects: kobana schema billing.payments.create.

Responses

HTTPDescription
201Payment created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments bulk-update-invoice​

Reassign payments to another invoice

kobana billing payments bulk-update-invoice [OPTIONS]

POST /v1/payments/bulk-update-invoice

Bulk-updates the invoice associated with the given payments. Useful for fixing links when payments arrived pointing to the wrong invoice. A payment that already settles more than one invoice is not moved: it comes back in failed (with id and error), counted by failed_count.

Request body

NameTypeRequiredDescription
payment_idsarray<string (uuid)>yesList of UUIDs of the payments to update.
invoice_idstring (uuid)yesUUID of the target invoice.

More fields and nested objects: kobana schema billing.payments.bulk-update-invoice.

Responses

HTTPDescription
200Payments reassigned.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments get​

Get payment

kobana billing payments get [ID] [OPTIONS]

GET /v1/payments/{id}

Path arguments: id

Responses

HTTPDescription
200Payment detail.
404Resource not found in the current organization.

payments delete​

Delete payment

kobana billing payments delete [ID] [OPTIONS]

DELETE /v1/payments/{id}

Removes a payment. Confirmed payments cannot be deleted — use cancel or refund instead.

Path arguments: id

Responses

HTTPDescription
200Payment removed.
404Resource not found in the current organization.

payments cancel​

Cancel payment

kobana billing payments cancel [ID] [OPTIONS]

POST /v1/payments/{id}/cancel

Cancels an open payment. When cancel_on_gateway is true (default), the cancellation is propagated to the gateway.

Path arguments: id

Request body

NameTypeRequiredDescription
reasonstringnoVoid reason (recorded in the audit log).
cancel_on_gatewaybooleannoWhen true (default), also cancels at the upstream gateway.

More fields and nested objects: kobana schema billing.payments.cancel.

Responses

HTTPDescription
200Payment canceled.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments change-card​

Change payment card

kobana billing payments change-card [ID] [OPTIONS]

POST /v1/payments/{id}/change-card

Replaces the credit card on a failed Pagar.me payment. The new card must be pre-registered in payment_methods.

Path arguments: id

Request body

NameTypeRequiredDescription
credit_card_idstring (uuid)yesUUID of the billing account's active credit card.

More fields and nested objects: kobana schema billing.payments.change-card.

Responses

HTTPDescription
200Card changed.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments change-due-date​

Change bank slip due date

kobana billing payments change-due-date [ID] [OPTIONS]

POST /v1/payments/{id}/change-due-date

Changes the due date of a pending bank-slip payment issued via the Kobana gateway. The new date must be in the future.

Path arguments: id

Request body

NameTypeRequiredDescription
due_datestringyesNew due date in YYYY-MM-DD format.

More fields and nested objects: kobana schema billing.payments.change-due-date.

Responses

HTTPDescription
200Due date updated.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments refund​

Refund payment

kobana billing payments refund [ID] [OPTIONS]

POST /v1/payments/{id}/refund

Refunds a successful payment. Without amount, refunds the full amount; with a partial amount, issues a partial refund.

Path arguments: id

Request body

NameTypeRequiredDescription
amountnumbernoAmount to refund in BRL (float, up to 4 decimal places). Default: full payment amount.
reasonstringnoRefund reason (recorded in the audit log).

More fields and nested objects: kobana schema billing.payments.refund.

Responses

HTTPDescription
200Payment refunded.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments retry​

Retry payment

kobana billing payments retry [ID] [OPTIONS]

POST /v1/payments/{id}/retry

Reprocesses a failed payment. Optionally switches to a new card (via card) or to a saved payment method (payment_method_id).

Path arguments: id

Request body

NameTypeRequiredDescription
cardobjectno
payment_method_idstring (uuid)noUUID of a saved payment method to use in the retry.

More fields and nested objects: kobana schema billing.payments.retry.

Responses

HTTPDescription
200Payment retried.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments send-email​

Send bank slip by email

kobana billing payments send-email [ID] [OPTIONS]

POST /v1/payments/{id}/send-email

Sends the bank-slip link by email to the given recipient. Only available for pending bank-slip payments.

Path arguments: id

Request body

NameTypeRequiredDescription
emailstring (email)yesRecipient's email address.
messagestringnoOptional message included in the email body.

More fields and nested objects: kobana schema billing.payments.send-email.

Responses

HTTPDescription
200Email sent.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

payments sync​

Sync payment with gateway

kobana billing payments sync [ID] [OPTIONS]

POST /v1/payments/{id}/sync

Syncs the payment status with the upstream gateway (Kobana PIX/boleto or Pagar.me refund). Returns the refreshed payment.

Path arguments: id

Responses

HTTPDescription
200Payment synced.
404Resource not found in the current organization.