Skip to main content

kobana billing credit-purchases

Commands of kobana billing credit-purchases. Every global option (Global options) applies here.

CommandHTTPDescription
credit-purchases createPOST /v1/credit_purchasesBuy credits

credit-purchases create​

Buy credits

kobana billing credit-purchases create [OPTIONS]

POST /v1/credit_purchases

Creates and finalizes a standalone invoice (billing_reason = credit_purchase) for a quantity of a credits product, independent of any subscription. The balance becomes available once the invoice is paid: the invoice.paid webhook carries line_items[].product_type and quantity.

Request body

NameTypeRequiredDescription
product_idstring (uuid)yesA credits product.
quantityintegeryesNumber of credits (integer; a multiple of the product increment).
billing_account_idstring (uuid)noBilling account ID. Send this or billing_account_public_id.
billing_account_public_idstring (uuid)noPublic identifier of the billing account.
price_idstring (uuid)noPrice to charge. Default: the product active default price.
collection_methodstringnomanual_charge (default): the customer pays the invoice. charge_automatically: charges the default card on finalization. Values: charge_automatically, manual_charge.
due_datestringnoDue date. Default: the account payment terms.

More fields and nested objects: kobana schema billing.credit-purchases.create.

Responses

HTTPDescription
201Purchase invoice, with its line items.
404Resource not found in the current organization.
422Request body failed validation.