POST
/
customers
/
external_customer_id
/
{external_customer_id}
/
credits
/
top_ups
curl --request POST \
  --url https://api.withorb.com/v1/customers/external_customer_id/{external_customer_id}/credits/top_ups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "currency": "<string>",
  "threshold": "<string>",
  "amount": "<string>",
  "per_unit_cost_basis": "<string>",
  "invoice_settings": {
    "auto_collection": true,
    "net_terms": 123,
    "memo": "<string>",
    "require_successful_payment": false
  },
  "expires_after": 123,
  "expires_after_unit": "day",
  "active_from": "2023-11-07T05:31:56Z"
}'
{
  "id": "<string>",
  "currency": "<string>",
  "threshold": "<string>",
  "amount": "<string>",
  "per_unit_cost_basis": "<string>",
  "invoice_settings": {
    "auto_collection": true,
    "net_terms": 123,
    "memo": "<string>",
    "require_successful_payment": false
  },
  "expires_after": 123,
  "expires_after_unit": "day"
}

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
currency
string
required

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

threshold
string
required

The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.

amount
string
required

The amount to increment when the threshold is reached.

per_unit_cost_basis
string
required

How much, in the customer's currency, to charge for each unit.

invoice_settings
object
required

Settings for invoices generated by triggered top-ups.

expires_after
integer | null

The number of days or months after which the top-up expires. If unspecified, it does not expire.

expires_after_unit
enum<string> | null

The unit of expires_after.

Available options:
day,
month
active_from
string | null

The date from which the top-up is active. If unspecified, the top-up is active immediately.

Response

201
application/json
Created
id
string
required
currency
string
required

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

threshold
string
required

The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.

amount
string
required

The amount to increment when the threshold is reached.

per_unit_cost_basis
string
required

How much, in the customer's currency, to charge for each unit.

invoice_settings
object
required

Settings for invoices generated by triggered top-ups.

expires_after
integer | null

The number of days or months after which the top-up expires. If unspecified, it does not expire.

expires_after_unit
enum<string> | null

The unit of expires_after.

Available options:
day,
month