Skip to main content
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.
Read it with Get billing.

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:
  • 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.

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 takes an amount for usage, priced as your app sees fit:
  • 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.
  • 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 pages through every move of the wallet (see Pagination): 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.