> ## Documentation Index
> Fetch the complete documentation index at: https://developers-docs.easyorders.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Billing

> Read your app's plan and usage wallet on a store, and charge the merchant for usage from the wallet.

Scopes: none. Every app can call these endpoints, and sees only its own billing on the store of its token.

Merchants pay for apps from their EasyOrders credits, in US dollars, whatever the store's currency. An app can charge in two ways, alone or together:

* **A plan**: a monthly subscription the merchant picks when installing your app.
* **A usage wallet**: the merchant tops it up, and your app takes from it as it is used.

```json theme={"dark"}
{
  "billing": {
    "subscription": {
      "plan_id": "plan_pro",
      "plan_name": "Pro",
      "price": "19.00",
      "status": "active",
      "trial_ends_at": null,
      "current_period_start": "2026-11-20T10:00:00Z",
      "current_period_end": "2026-12-20T10:00:00Z",
      "pending_plan_id": null,
      "pending_plan_price": null,
      "price_change": null
    },
    "wallet": { "enabled": true, "balance": "19.95" }
  }
}
```

Read it with [Get billing](https://developers-docs.easyorders.ai/api-reference/billing/get-billing.md).

## Amounts

Every amount is a **string of US dollars** with up to **6 decimals**: `"19.00"`, `"0.05"`, `"0.000001"`. Answers show at least two decimals. Amounts you send must be more than zero; a bad one answers `422` with the rule `amount` and the param `0.000001,6`.

## The subscription

`subscription` is `null` when your app has no plans. Otherwise:

| `status` | |
| - | - |
| `trialing` | The free trial. The first charge comes at `trial_ends_at`. |
| `active` | The current month is paid, or the plan is free. `current_period_end` is the next renewal. |
| `suspended` | A renewal found too few credits. It renews by itself once the merchant's credits cover it. |

* `price` is what the merchant agreed to pay a month. It stays the same until a price change applies.
* `pending_plan_id` and `pending_plan_price`: a cheaper plan the merchant picked, which starts at the next renewal.
* `price_change`: a higher price your app set for the plan. Until the merchant accepts it, renewals charge the old price; if they neither accept it nor remove your app by `deadline`, your app is removed then.

Your app receives `app/subscription_updated` when the subscription changes.

## When the subscription is suspended

While `status` is `suspended`, every endpoint of the API answers `402 payment_required`, **except the billing endpoints**: your app can still read its billing and its wallet's transactions, to see why. A new debit is refused with `402 payment_required`; a debit sent again with its key still answers the first one.

```json theme={"dark"}
{
  "error": {
    "code": "payment_required",
    "message": "The app's subscription on this store is suspended"
  }
}
```

## The usage wallet

`wallet.enabled` says whether your app has a usage wallet. The merchant tops it up from their credits, and your app receives `app/wallet_topped_up`. Your app can never add to it.

[Debit the wallet](https://developers-docs.easyorders.ai/api-reference/billing/debit-the-wallet.md) takes an amount for usage, priced as your app sees fit:

```json theme={"dark"}
{
  "amount": "0.05",
  "description": "SMS for order 1043"
}
```

* **`Idempotency-Key` is required.** Use a key from your own record. The same key again answers `201` with the first debit and `Idempotent-Replayed: true`, and takes nothing, however long after. The same key with another amount or description answers `422 idempotency_key_reused`. See [Idempotency](https://developers-docs.easyorders.ai/concepts/idempotency.md).
* `description` is up to 200 characters, one line, no `<`. The merchant reads it in the wallet's transactions after your app's name.
* **The balance never goes below zero.** A debit the wallet does not cover answers `402 insufficient_balance`, and takes nothing. Warning the merchant when the balance runs low is your app's job.
* Refusals: `409 wallet_not_enabled` when your app has no wallet, `409 app_suspended` when your app is suspended and being removed, `402 payment_required` while the subscription is suspended.

When the merchant removes your app, what is left in the wallet goes back to their credits.

## Transactions

[List wallet transactions](https://developers-docs.easyorders.ai/api-reference/billing/list-wallet-transactions.md) pages through every move of the wallet (see [Pagination](https://developers-docs.easyorders.ai/concepts/pagination.md)):

| `type` | |
| - | - |
| `wallet_topup` | The merchant added to the wallet. |
| `wallet_debit` | Your app took from it. |
| `wallet_return` | The balance went back to the merchant when your app was removed. |

`amount` is always positive; `type` gives the direction. `balance_after` is the balance right after the move. `description` is what the merchant reads, in Arabic: it names your app, and for a debit your own description follows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.