# Billing API reference

> Your organization's balance, ledger, charges, top-ups, auto top-up and promo codes, and a provider's earnings and payouts.

Source: https://legion.ambient.xyz/docs/api/billing

- [Get what a rental has cost](https://legion.ambient.xyz/docs/api/billing/get-rental-charges): `GET /v1/rentals/{rental_id}/charges`. Billed time and the total charged for one of the organization's rentals.
- [Get the organization's balance](https://legion.ambient.xyz/docs/api/billing/get-billing-account): `GET /v1/billing/account`. The prepaid balance of the caller's organization.
- [List the organization's ledger entries](https://legion.ambient.xyz/docs/api/billing/list-ledger-entries): `GET /v1/billing/ledger`. Every change to the organization's balance and provider earnings, newest first.
- [List what happened to the organization's balance or earnings](https://legion.ambient.xyz/docs/api/billing/list-billing-activity): `GET /v1/billing/activity`. The organization's activity on one side of its ledger, newest first, folded for people to read.
- [List what the organization's rentals have cost](https://legion.ambient.xyz/docs/api/billing/list-rental-charges): `GET /v1/billing/charges`. getRentalCharges for every rental the organization rented that has been billed, newest rental first, in one paginated call.
- [Get the organization's provider earnings](https://legion.ambient.xyz/docs/api/billing/get-provider-earnings): `GET /v1/billing/earnings`. What the organization's hosts have earned from usage, what Ambient took back from those earnings (earnings_recovery, after payment fraud the provider was…
- [Get what a rental on one of the organization's hosts has earned](https://legion.ambient.xyz/docs/api/billing/get-rental-earnings): `GET /v1/billing/earnings/rentals/{rental_id}`. Billed time, the renter's charge, the provider's earnings and the platform commission for a rental on one of the organization's hosts.
- [The organization's earnings over a period, with the previous period](https://legion.ambient.xyz/docs/api/billing/get-provider-earnings-overview): `GET /v1/provider/earnings/overview`. What the organization's hosts earned in the UTC days from to to (both included) and in the period of the same length just before it, for the Earnings…
- [The organization's earnings over time](https://legion.ambient.xyz/docs/api/billing/get-provider-earnings-series): `GET /v1/provider/earnings/series`. The period in day, week (Monday to Sunday) or month buckets, each clipped to the period: gross, fee, net earnings, GPU-hours, utilization (against…
- [The organization's earnings by one dimension](https://legion.ambient.xyz/docs/api/billing/get-provider-earnings-breakdown): `GET /v1/provider/earnings/breakdown`. The period's charges on the organization's hosts grouped by dimension, largest net earnings first, the first limit groups in rows, the rest added up in…
- [What each of the organization's hosts earned and how it performed](https://legion.ambient.xyz/docs/api/billing/list-provider-earnings-hosts): `GET /v1/provider/earnings/hosts`. Every host of the organization that is not removed, and every removed one that earned in the period, largest net earnings first: net and gross earnings…
- [One host's earnings, utilization, uptime and price against the market](https://legion.ambient.xyz/docs/api/billing/get-provider-earnings-host): `GET /v1/provider/earnings/hosts/{host_id}`. The host's row of listProviderEarningsHosts, its earnings in day or week buckets, its uptime per UTC day over the last 30 days, its price against the…
- [The rentals on the organization's hosts that were billed in a period](https://legion.ambient.xyz/docs/api/billing/list-provider-earnings-rentals): `GET /v1/provider/earnings/rentals`. The rentals with charges in the period, ordered by sort, at most limit (1000 at most, so the list can be exported whole): the rental's name and host, the…
- [Hosts that are earning less than they could, with what to do](https://legion.ambient.xyz/docs/api/billing/list-provider-earnings-attention): `GET /v1/provider/earnings/attention`. What is holding the organization's hosts back in the period, most important first, each with plain words, the figures behind it and one suggested action.
- [What is payable, when the next payout runs and the history of payouts](https://legion.ambient.xyz/docs/api/billing/list-provider-earnings-payouts): `GET /v1/provider/earnings/payouts`. What is payable now (the rollup's balance as at today), whether the next payout can run and an estimate of it, and the money movements of the period…
- [The organization's spend over a period, with the previous period](https://legion.ambient.xyz/docs/api/billing/get-renter-spend-overview): `GET /v1/renter/spend/overview`. What the organization's prepaid balance was charged in the UTC days from to to (both included) and in the period of the same length just before it, for…
- [The organization's spend over time](https://legion.ambient.xyz/docs/api/billing/get-renter-spend-series): `GET /v1/renter/spend/series`. The period in day, week (Monday to Sunday) or month buckets, each clipped to the period: spent, paid with promo credit, GPU-hours and the effective price…
- [The organization's spend by one dimension](https://legion.ambient.xyz/docs/api/billing/get-renter-spend-breakdown): `GET /v1/renter/spend/breakdown`. The period's charges to the organization's balance grouped by dimension, largest spend first, the first limit groups in rows, the rest added up in others…
- [The organization's rentals that were charged in a period](https://legion.ambient.xyz/docs/api/billing/list-renter-spend-rentals): `GET /v1/renter/spend/rentals`. The rentals with charges in the period, ordered by sort, at most limit (1000 at most, so the list can be exported whole): the rental's ID, name and…
- [Get the organization's payout setup](https://legion.ambient.xyz/docs/api/billing/get-payout-status): `GET /v1/billing/payouts`. Where the organization stands with payout setup: no payout account yet, onboarding started but not finished, Stripe asking for more information, Stripe…
- [List the organization's top-ups](https://legion.ambient.xyz/docs/api/billing/list-top-ups): `GET /v1/billing/top-ups`. The caller's organization's top-ups with their status, newest first: the ones in progress (open, which includes an ACH debit that has not settled), the…
- [Top up the organization's balance](https://legion.ambient.xyz/docs/api/billing/create-top-up): `POST /v1/billing/top-ups`. Starts a top-up of the prepaid balance through Stripe Checkout and returns the Checkout page to send the person to.
- [See the organization's auto top-up](https://legion.ambient.xyz/docs/api/billing/get-auto-top-up): `GET /v1/billing/auto-top-up`. .
- [Turn auto top-up on or off and set its amounts](https://legion.ambient.xyz/docs/api/billing/put-auto-top-up): `PUT /v1/billing/auto-top-up`. .
- [Save or replace the card auto top-up charges](https://legion.ambient.xyz/docs/api/billing/create-auto-top-up-card): `POST /v1/billing/auto-top-up/card`. .
- [Remove the saved card and turn auto top-up off](https://legion.ambient.xyz/docs/api/billing/delete-auto-top-up-card): `DELETE /v1/billing/auto-top-up/card`. .
- [See how much unused credit can be refunded, and the fee kept](https://legion.ambient.xyz/docs/api/billing/get-credit-refund-quote): `GET /v1/billing/credit-refund-quote`. .
- [Refund unused credit to the cards and bank accounts it came from](https://legion.ambient.xyz/docs/api/billing/create-credit-refund): `POST /v1/billing/credit-refunds`. .
- [Check what a promo code gives the organization](https://legion.ambient.xyz/docs/api/billing/preview-promo-code): `POST /v1/billing/promo-codes/preview`. .
- [Redeem a promo code](https://legion.ambient.xyz/docs/api/billing/redeem-promo-code): `POST /v1/billing/promo-codes/redeem`. .
- [List the organization's promo code redemptions](https://legion.ambient.xyz/docs/api/billing/list-promo-redemptions): `GET /v1/billing/promo-redemptions`. .
- [Get the organization's promo credit and discounts](https://legion.ambient.xyz/docs/api/billing/get-promo-credit): `GET /v1/billing/promo-credit`. .
