Skip to main content

kobana billing payment-methods

Commands of kobana billing payment-methods. Every global option (Global options) applies here.

CommandHTTPDescription
payment-methods listGET /v1/payment_methodsList payment methods
payment-methods createPOST /v1/payment_methodsCreate payment method
payment-methods updatePUT /v1/payment_methodsUpsert payment method
payment-methods getGET /v1/payment_methods/{id}Get payment method
payment-methods deleteDELETE /v1/payment_methods/{id}Delete payment method
payment-methods set-defaultPOST /v1/payment_methods/{id}/set-defaultSet payment method as default

payment-methods list​

List payment methods

kobana billing payment-methods list [OPTIONS]

GET /v1/payment_methods

Returns a paginated list of the current organization's payment methods. Optional filters: billing_account_id, type, status.

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.
billing_account_idstringnoFilter by billing account UUID.
typestringnoFilter by type: card, bank_slip, pix or bank_transfer. Values: card, bank_slip, pix, bank_transfer.
statusstringnoFilter by status: active, expired or failed. Values: active, expired, failed.

Responses

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

payment-methods create​

Create payment method

kobana billing payment-methods create [OPTIONS]

POST /v1/payment_methods

Creates a payment method tied to a billing account. For type=card, send the card block with the card_token produced by client-side tokenization. For type=bank_transfer, send the bank_account block. For bank_slip and pix, only the type is required — the default gateway is resolved from the organization.

Request body

NameTypeRequiredDescription
billing_account_idstring (uuid)yesUUID of the billing account that owns the payment method.
typestringyesMethod type: card, bank_slip, pix or bank_transfer. Values: card, bank_slip, pix, bank_transfer.
is_defaultbooleannoWhen true, marks this method as the account default (unsets previous defaults). The first method created for an account also becomes the default automatically.
cardobjectno
bank_accountobjectno
billing_detailsobjectno
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoFree-form custom metadata (object).

More fields and nested objects: kobana schema billing.payment-methods.create.

Responses

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

payment-methods update​

Upsert payment method

kobana billing payment-methods update [OPTIONS]

PUT /v1/payment_methods

Takes the same body as POST, plus id and public_id, and dedups on id, public_id, external_id and the resource's natural keys, in that order, stopping at the first key that finds a record. A match is updated and returns 200; otherwise the record is created and returns 201. The POST's required fields are required only when no record is found, and updates are partial: absent fields keep their stored value.

Request body

NameTypeRequiredDescription
billing_account_idstring (uuid)noUUID of the billing account that owns the payment method.
typestringnoMethod type: card, bank_slip, pix or bank_transfer. Values: card, bank_slip, pix, bank_transfer.
is_defaultbooleannoWhen true, marks this method as the account default (unsets previous defaults). The first method created for an account also becomes the default automatically.
cardobjectno
bank_accountobjectno
billing_detailsobjectno
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoFree-form custom metadata (object).
idstring (uuid)noRecord UUID. Used only to locate it — never written.
public_idstring (uuid)noPublic UUID of the record, used to locate it.

More fields and nested objects: kobana schema billing.payment-methods.update.

Responses

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

payment-methods get​

Get payment method

kobana billing payment-methods get [ID] [OPTIONS]

GET /v1/payment_methods/{id}

Path arguments: id

Responses

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

payment-methods delete​

Delete payment method

kobana billing payment-methods delete [ID] [OPTIONS]

DELETE /v1/payment_methods/{id}

Deletes the payment method (soft delete: deleted_at, and the status becomes removed wherever it still shows through a relation — on the payments it paid). Requires the delete access level. Fails while payments are pending or processing. If it was the default, another active method is promoted automatically.

Path arguments: id

Responses

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

payment-methods set-default​

Set payment method as default

kobana billing payment-methods set-default [ID] [OPTIONS]

POST /v1/payment_methods/{id}/set-default

Marks the method as the billing account's default and unsets previous defaults. Fails when the method is not active.

Path arguments: id

Responses

HTTPDescription
200Payment method set as default.
404Resource not found in the current organization.
422Request body failed validation.