Skip to main content
GET
/
customers
/
{customer_id}
/
costs
Fetch customer costs
curl --request GET \  --url https://api.withorb.com/v1/customers/{customer_id}/costs \  --header 'Authorization: Bearer <token>'
{  "data": [  {  "subtotal": "<string>",  "total": "<string>",  "timeframe_start": "2023-11-07T05:31:56Z",  "timeframe_end": "2023-11-07T05:31:56Z",  "per_price_costs": [  {  "quantity": 123,  "subtotal": "<string>",  "total": "<string>",  "price": {  "model_type": "unit",  "unit_config": {  "unit_amount": "<string>",  "prorated": false  },  "metadata": {},  "id": "<string>",  "name": "<string>",  "external_price_id": "<string>",  "replaces_price_id": "<string>",  "price_type": "usage_price",  "created_at": "2023-11-07T05:31:56Z",  "cadence": "one_time",  "billing_mode": "in_advance",  "billing_cycle_configuration": {  "duration": 123,  "duration_unit": "day"  },  "invoicing_cycle_configuration": {  "duration": 123,  "duration_unit": "day"  },  "billable_metric": {  "id": "<string>"  },  "dimensional_price_configuration": {  "dimensional_price_group_id": "<string>",  "dimension_values": [  "<any>"  ]  },  "fixed_price_quantity": 123,  "plan_phase_order": 123,  "currency": "<string>",  "conversion_rate": 123,  "conversion_rate_config": {  "conversion_rate_type": "unit",  "unit_config": {}  },  "item": {  "id": "<string>",  "name": "<string>"  },  "credit_allocation": {  "currency": "<string>",  "allows_rollover": true,  "custom_expiration": {  "duration": "<any>",  "duration_unit": "<any>"  },  "filters": [  "<any>"  ]  },  "composite_price_filters": [  {  "field": "<any>",  "operator": "<any>",  "values": "<any>"  }  ],  "discount": {  "discount_type": "percentage",  "applies_to_price_ids": [  "h74gfhdjvn7ujokd",  "7hfgtgjnbvc3ujkl"  ],  "filters": [  "<any>"  ],  "reason": "<string>",  "percentage_discount": 0.15  },  "minimum": {  "minimum_amount": "<string>",  "filters": [  "<any>"  ],  "applies_to_price_ids": [  "<any>"  ]  },  "minimum_amount": "<string>",  "maximum": {  "maximum_amount": "<string>",  "filters": [  "<any>"  ],  "applies_to_price_ids": [  "<any>"  ]  },  "maximum_amount": "<string>"  },  "price_id": "<string>"  }  ]  }  ] }

Authorizations

Authorization
string
header
required

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

Path Parameters

customer_id
string | null
required

Query Parameters

timeframe_start
string<date-time> | null

Costs returned are inclusive of timeframe_start.

Examples:

"2022-02-01T05:00:00Z"

timeframe_end
string<date-time> | null

Costs returned are exclusive of timeframe_end.

Examples:

"2022-03-01T05:00:00Z"

view_mode
enum<string> | null

Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

Available options:
periodic,
cumulative
currency
string | null

The currency or custom pricing unit to use.

Response

OK

data
AggregatedCost · object[]
required