POST
/
customers
/
external_customer_id
/
{external_customer_id}
/
credits
/
ledger_entry

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Path Parameters

external_customer_id
string | null
required

Body

application/json
amount
number
required

The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations.

entry_type
enum<string>
required
Available options:
increment
currency
string | null

The currency or custom pricing unit to use for this ledger entry. If this is a real-world currency, it must match the customer's invoicing currency.

description
string | null

Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc.

effective_date

An ISO 8601 format date that denotes when this credit balance should become available for use.

expiry_date

An ISO 8601 format date that denotes when this credit balance should expire.

invoice_settings
object | null

Passing invoice_settings automatically generates an invoice for the newly added credits. If invoice_settings is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis.

metadata
object | null

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

per_unit_cost_basis
string | null

Can only be specified when entry_type=increment. How much, in the customer's currency, a customer paid for a single credit in this block

Response

201 - application/json

The Credit Ledger Entry resource models prepaid credits within Orb.

amount
number
required
created_at
string
required
credit_block
object
required
currency
string
required
customer
object
required
description
string | null
required
ending_balance
number
required
entry_status
enum<string>
required
Available options:
committed,
pending
entry_type
enum<string>
required
Available options:
increment
id
string
required
ledger_sequence_number
integer
required
metadata
object
required

User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

starting_balance
number
required