B7RDevelopers
ReferenceWallet
Reference / Wallet

Wallet

View .md

Your B7R wallet is prepaid: you top it up in the app, and each order is charged from it when it is placed. The wallet and the invoices of B7R belong to your account, whichever key or seller placed the order. Through the API the wallet is read-only: no top-ups, no withdrawals. The balance is a prepayment, so it carries no VAT; each order charge shows net, VAT and gross (see Money and VAT).

Read the wallet

GET/v1/wallet

The balance, and what your unpaid orders wait for. Unpaid orders of every channel count: the wallet is one.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the wallet:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Answer

balanceobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

unpaid_totalobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

Errors

Request
curl https://api.b7r.app/v1/wallet \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/wallet", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/wallet",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "balance": {
    "amount": "2355.00",
    "currency": "SAR"
  },
  "unpaid_total": {
    "amount": "0.00",
    "currency": "SAR"
  }
}

List wallet movements

GET/v1/wallet/transactions

Every movement, newest first. Each charge and refund names its order in order_id, whatever channel the order came from: a Salla or manual order charged to your wallet appears here beside your API orders, and GET /v1/orders/{order_id} reads it with the same key. Match order_charge and order_refund to your orders to reconcile. type is topup, order_charge, order_refund, bonus, adjustment or other; treat a type you do not know as other, and order_id is null on a movement with no order. A B7R store order is paid by the shopper (paid_by: shopper), so it never charges or refunds your wallet.

Pass type to list one type only; type=other lists every movement of none of the five named types (your store earnings among them). With the reports:read area, include=details adds details to each movement: reason, what it was for, as a code (auto_clear is an unpaid order paid by a top-up; note is an adjustment B7R explained in its own words, in note; null when there is nothing to say), and earnings, how much of it moved your store earnings.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the wallet:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Query

limitstring
cursorstring

1 to 256.

typestring

Only the lines of this type. other: every line of none of the five named types (earnings among them). One of topup, order_charge, order_refund, bonus, adjustment, other.

includeconstant

details: add each line's reason and its earnings part. Needs the reports:read area. Always "details".

Answer

dataarray of objectrequired
Child fields
idstring (uuid)required
typestringrequired

One of topup, order_charge, order_refund, bonus, adjustment, other.

amountobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

balance_afterobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

order_idstring or nullrequired
created_atstringrequired
detailsobject
Child fields
reasonstring or nullrequired

What the line was for: auto_clear (an unpaid order paid by a top-up), partial_reversal, topup_approved, card_topup, order_edit, welcome_bonus, order_earnings, earnings_transfer, earnings_transfer_returned, earnings_charge, or note (an adjustment B7R explained in its own words). null when there is nothing to say.

notestring or nullrequired

The words B7R wrote on a manual adjustment; null otherwise.

earningsobjectrequired

How much of the line moved your store earnings: negative when earnings left the balance.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

next_cursorstring or nullrequired

Errors

Request
curl "https://api.b7r.app/v1/wallet/transactions?limit=50" \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/wallet/transactions?limit=50", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/wallet/transactions?limit=50",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "data": [
    {
      "id": "7d0e2f5a-6b8c-4d9e-9f0a-2b3c4d5e6f7a",
      "type": "order_charge",
      "amount": {
        "amount": "-145.00",
        "currency": "SAR"
      },
      "balance_after": {
        "amount": "2355.00",
        "currency": "SAR"
      },
      "order_id": "B26112200042",
      "created_at": "2026-11-22T12:30:11.902Z"
    }
  ],
  "next_cursor": null
}

Search wallet movements

POST/v1/wallet/transactions/search

Searches your movements as the wallet page does: search is matched within each movement's order number and reason, newest first, every movement with its details. Narrow it with type, and page it with limit and cursor in the body. The term is never kept in the call's record. Needs both the wallet:read and the reports:read areas; reports:read opens the details, so the search takes no include flag.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the wallet:read area. X-B7R-Key works too; send one, never both.

Idempotency-Keystringrequired

A new value per operation (up to 255 letters, digits, ., _, : or -; a UUID works), the same value on its retries. See Safe retries.

Content-Typestringrequired

application/json, when the request has a body.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Body

searchstringrequired

Matched within each line's order number and reason, as the wallet page searches. Not kept in the call's record. 1 to 100.

typestring

Only the lines of this type. other: every line of none of the five named types (earnings among them). One of topup, order_charge, order_refund, bonus, adjustment, other.

limitinteger

1 to 100.

cursorstring

1 to 256.

Answer

dataarray of objectrequired
Child fields
idstring (uuid)required
typestringrequired

One of topup, order_charge, order_refund, bonus, adjustment, other.

amountobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

balance_afterobjectrequired
Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

order_idstring or nullrequired
created_atstringrequired
detailsobject
Child fields
reasonstring or nullrequired

What the line was for: auto_clear (an unpaid order paid by a top-up), partial_reversal, topup_approved, card_topup, order_edit, welcome_bonus, order_earnings, earnings_transfer, earnings_transfer_returned, earnings_charge, or note (an adjustment B7R explained in its own words). null when there is nothing to say.

notestring or nullrequired

The words B7R wrote on a manual adjustment; null otherwise.

earningsobjectrequired

How much of the line moved your store earnings: negative when earnings left the balance.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

next_cursorstring or nullrequired

Errors

Request
curl -X POST https://api.b7r.app/v1/wallet/transactions/search \
  -H "Authorization: Bearer $B7R_API_KEY" \
  -H "Idempotency-Key: $(uuidgen 2>/dev/null || node -e 'console.log(crypto.randomUUID())')" \
  -H "Content-Type: application/json" \
  -d '{
    "search": "B261122",
    "type": "order_charge"
  }'
const res = await fetch("https://api.b7r.app/v1/wallet/transactions/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "search": "B261122",
    "type": "order_charge"
  }),
});
const data = await res.json();
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/wallet/transactions/search",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "search": "B261122",
        "type": "order_charge"
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "data": [
    {
      "id": "7d0e2f5a-6b8c-4d9e-9f0a-2b3c4d5e6f7a",
      "type": "order_charge",
      "amount": {
        "amount": "-145.00",
        "currency": "SAR"
      },
      "balance_after": {
        "amount": "2355.00",
        "currency": "SAR"
      },
      "order_id": "B26112200042",
      "created_at": "2026-11-22T12:30:11.902Z",
      "details": {
        "reason": "auto_clear",
        "note": null,
        "earnings": {
          "amount": "0.00",
          "currency": "SAR"
        }
      }
    }
  ],
  "next_cursor": null
}

Read the last 60 days

GET/v1/wallet/stats

What your wallet card shows for the last 60 days: what you topped up, what left the wallet on orders (refunds counted against it, never below zero) and how many orders the wallet paid for (an order refunded in full is not counted). These figures sum recent activity: bonuses, adjustments and older movements are left out, so they do not add up to your balance. Needs the reports:read area. If the figures cannot be read, the answer is 503 try_again_later, never zeros.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the reports:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Answer

window_daysintegerrequired

The days the figures cover, up to now (the last 60).

topped_upobjectrequired

Top-ups credited to the wallet inside the window.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

spent_on_ordersobjectrequired

What left the wallet on orders inside the window, refunds counted against it.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

paid_ordersintegerrequired

Orders the wallet paid for inside the window; an order refunded in full is not counted.

Errors

Request
curl https://api.b7r.app/v1/wallet/stats \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/wallet/stats", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/wallet/stats",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "window_days": 60,
  "topped_up": {
    "amount": "3000.00",
    "currency": "SAR"
  },
  "spent_on_orders": {
    "amount": "645.00",
    "currency": "SAR"
  },
  "paid_orders": 5
}

List top-up requests

GET/v1/wallet/topups

Every top-up request of your account, newest first, as your wallet page shows them: method is bank_transfer or card; status is pending (a transfer waiting for review, or a card payment not finished), approved (credited to your wallet), rejected (B7R refused the transfer and says why in rejection_note) or cancelled (the card payment window closed unpaid). Page it with limit and cursor. Top-ups are made in the app: a key reads them and never makes one.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the wallet:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Query

limitstring
cursorstring

1 to 256.

Answer

dataarray of objectrequired
Child fields
idstring (uuid)required
methodstringrequired

How it is paid: a bank transfer you sent, or a card payment. One of bank_transfer, card.

statusstringrequired

pending: a transfer waiting for review, or a card payment not finished. approved: credited to your wallet. rejected: B7R refused the transfer (see rejection_note). cancelled: the card payment window closed unpaid. One of pending, approved, rejected, cancelled.

amountobjectrequired

What the request credits to your wallet.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

rejection_notestring or nullrequired

Why B7R refused the transfer, in its own words; null otherwise.

reviewed_atstring or nullrequired

When B7R approved or refused it; null while pending.

created_atstringrequired
next_cursorstring or nullrequired

Errors

Request
curl "https://api.b7r.app/v1/wallet/topups?limit=50" \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/wallet/topups?limit=50", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/wallet/topups?limit=50",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "data": [
    {
      "id": "5d2f8a10-3c4b-4e6f-9a1b-2c3d4e5f6a7b",
      "method": "bank_transfer",
      "status": "approved",
      "amount": {
        "amount": "3000.00",
        "currency": "SAR"
      },
      "rejection_note": null,
      "reviewed_at": "2026-11-21T08:15:00.000Z",
      "created_at": "2026-11-20T19:42:10.000Z"
    }
  ],
  "next_cursor": null
}

Read a top-up request

GET/v1/wallet/topups/{id}

One request, to follow it until it is credited or closed. Another account's request answers 404 not_found, like one that does not exist.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the wallet:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Path

idstring (uuid)required

Answer

idstring (uuid)required
methodstringrequired

How it is paid: a bank transfer you sent, or a card payment. One of bank_transfer, card.

statusstringrequired

pending: a transfer waiting for review, or a card payment not finished. approved: credited to your wallet. rejected: B7R refused the transfer (see rejection_note). cancelled: the card payment window closed unpaid. One of pending, approved, rejected, cancelled.

amountobjectrequired

What the request credits to your wallet.

Child fields
amountstringrequired
currencyconstantrequired

Always "SAR".

rejection_notestring or nullrequired

Why B7R refused the transfer, in its own words; null otherwise.

reviewed_atstring or nullrequired

When B7R approved or refused it; null while pending.

created_atstringrequired

Errors

Request
curl https://api.b7r.app/v1/wallet/topups/5d2f8a10-3c4b-4e6f-9a1b-2c3d4e5f6a7b \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/wallet/topups/5d2f8a10-3c4b-4e6f-9a1b-2c3d4e5f6a7b", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/wallet/topups/5d2f8a10-3c4b-4e6f-9a1b-2c3d4e5f6a7b",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "id": "5d2f8a10-3c4b-4e6f-9a1b-2c3d4e5f6a7b",
  "method": "bank_transfer",
  "status": "approved",
  "amount": {
    "amount": "3000.00",
    "currency": "SAR"
  },
  "rejection_note": null,
  "reviewed_at": "2026-11-21T08:15:00.000Z",
  "created_at": "2026-11-20T19:42:10.000Z"
}

Titles and headings of every page. llms-full.txt holds the full text.