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
entry_type
enum<string>
required
Available options:
increment
amount
number
required

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

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.

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.

expiry_date

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

effective_date

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

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

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.

Response

201
application/json
Created

The Credit Ledger Entry resource models prepaid credits within Orb.

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.

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