B7RDevelopers
Get startedCreate your API key
Get started / Create your API key

Create your API key

View .md

You make API keys yourself, in the B7R app, signed in to your own account. The app shows Arabic first: every label below is given in English, then in Arabic as the app shows it. The language button in the header (on a phone, under More) switches the app to English.

You need a verified account: the checks on Settings, then Verification (التوثيق). The key is shown once, when you create it. Have a place on your server ready to keep it.

Create the key, step by step

  1. Sign in at b7r.app.
  2. Open Settings (الإعدادات). On a computer it is in the side menu. On a phone, press More (المزيد) in the bottom bar, then Settings (الإعدادات).
  3. Open the Integrations (الربط) tab. You can also go straight to b7r.app/settings?tab=integrations.
  4. Under your stores, find the Custom API (الربط عبر API) card. It lists your keys and shows how many you have out of the most your account can hold.
  5. Press Create key (إنشاء مفتاح). The New API key (مفتاح API جديد) form opens (a sheet from the bottom on a phone).
  6. Type the Key name (اسم المفتاح), up to 60 characters. It starts empty and a key needs one: use the site or server that will hold it, so you can tell your keys apart.
  7. Under Areas (الأقسام), tick what the key may do. Nothing is ticked at first, and at least one is needed. Each area has a line saying what it allows; the next section lists them all. Tick only what one program needs.
  8. If you tick Manage orders (إدارة الطلبات), the form also asks for the Daily spend cap (SAR) (حد الإنفاق اليومي (ريال)). It starts at your account's cap and you can only lower it: orders sent with this key can never spend more than it in a day (Riyadh time).
  9. Under Expiry (انتهاء المفتاح), pick Never (بلا انتهاء), 30 days (30 يومًا), 90 days (90 يومًا), 1 year (سنة). It starts on Never. A key that expires stops working on that date.
  10. Tick I accept the Custom API terms (أوافق على شروط الربط عبر API). Press the terms' name to read them first; they open in place.
  11. Press Create key (إنشاء المفتاح). Go back (تراجع) closes the form without making a key.
  12. Your new key (مفتاحك الجديد) opens with your key. Press Copy key (نسخ المفتاح), store the key on your server now, then press Close (إغلاق).

The areas you can tick

Under Areas (الأقسام) the app lists the areas below, each with the line it shows under it. Each endpoint needs one area (see Areas), and a key reaches the whole account: every product and every order, whichever channel it came from.

In the appThe line under itAreaEndpoints
Catalog (الكتالوج)Browse the base products B7R prints, their prices and carriers. With Read products, also see what each of your products costs you. (تصفّح المنتجات الأساسية التي يطبعها B7R وأسعارها وشركات الشحن. ومع قراءة المنتجات، عرض تكلفة كل منتج من منتجاتك.)catalogBase products, carriers, quote.
Read products (قراءة المنتجات)See your products and their photos. (عرض منتجاتك وصورها.)products:readList and read products.
Edit products (تعديل المنتجات)Create, change and archive your products. (إنشاء منتجاتك وتعديلها وأرشفتها.)products:writeCheck, create, change and archive products.
Read orders (قراءة الطلبات)See your orders and their status. (عرض طلباتك وحالتها.)orders:readList and read orders.
Manage orders (إدارة الطلبات)Place and cancel orders. Each order is charged to your wallet. (إنشاء الطلبات وإلغاؤها، وتُخصم تكلفة كل طلب من محفظتك.)orders:writeCheck, place and cancel orders.
Read wallet (قراءة المحفظة)See your wallet balance, its movements and your top-up requests. (عرض رصيد محفظتك وحركاتها وطلبات تعبئة الرصيد.)wallet:readRead the wallet, its movements and your top-up requests. With reports:read too: search the movements.
Read designs (قراءة التصاميم)See your design files and their review, and print a design again. With Read products, also see why B7R restricted a product. (عرض ملفات تصاميمك ومراجعتها، وإعادة طباعة تصميم. ومع قراءة المنتجات، عرض سبب تقييد منتج.)designs:readList and read your designs and their files; print a design again with design_id.
Shopper details (بيانات العملاء)The key reads the shopper's name, phone, email, gender and address on an order. B7R records every read in the activity log. (يقرأ المفتاح اسم العميل وجواله وبريده الإلكتروني وجنسه وعنوانه في الطلب، ويسجّل B7R كل قراءة في سجل النشاط.)customers:readThe full shopper on an order read, with include=customer. Needs orders:read.
Order details (تفاصيل الطلبات)See each order's lines with their names and photos, and its details. (عرض بنود كل طلب بأسمائها وصورها، وتفاصيل الطلب.)order_details:readAn order's details, and each order's lines on the list with include=items. Needs orders:read.
Shopper list (قائمة العملاء)The key searches your saved customers by name or phone and reads a customer's last address. B7R records every read in the activity log. (يبحث المفتاح في عملائك المحفوظين بالاسم أو الجوال ويقرأ آخر عنوان للعميل، ويسجّل B7R كل قراءة في سجل النشاط.)customer_list:readSearch your saved customers and read one's last address; place an order for one with customer_id. Needs orders:read and customers:read.
Read invoices (قراءة الفواتير)See and download your order invoices. (عرض فواتير طلباتك وتحميلها.)invoices:readAn order's invoice and its PDF. Needs orders:read.
Read stores (قراءة المتاجر)See your connected stores, where your products are published and the changes a store did not take. (عرض متاجرك المربوطة، وأين نُشرت منتجاتك، والتغييرات التي لم يأخذها المتجر.)stores:readRead your connected stores, where each product is published, the changes a store did not take, and your store jobs. Needed by stores:publish and stores:manage.
Publish products (نشر المنتجات)Publish, sync, hide and show your products on your connected stores, and send a change a store did not take again. (نشر منتجاتك في متاجرك المربوطة ومزامنتها وإخفاؤها وإظهارها، وإعادة إرسال تغيير لم يأخذه المتجر.)stores:publishStart store jobs: publish, sync, unpublish and republish a product, and send a change again. Needs stores:read.
Manage stores (إدارة المتاجر)Pause, resume and disconnect your stores, and decline a store waiting for approval. This key can resume a store you paused. Connecting a store is done in the app only. (إيقاف متاجرك مؤقتًا واستئنافها وفصلها، ورفض متجر ينتظر الموافقة. يستطيع هذا المفتاح استئناف متجر أوقفته. ربط المتاجر من التطبيق فقط.)stores:managePause, resume or disconnect a store, and decline the store that waits for approval. Needs stores:read. A key never connects a store: that is done in the app only.
Read reports (قراءة التقارير)See your dashboard figures, your profit by store and product, your wallet statistics and transactions, and your setup steps. Transaction details and search also need “Read wallet”. (الاطلاع على أرقام لوحة التحكم وأرباحك حسب المتجر والمنتج وإحصاءات محفظتك وحركاتها وخطوات البداية. ويتطلب عرض تفاصيل الحركات والبحث فيها قراءة المحفظة أيضًا.)reports:readThe dashboard, the profit, the first steps, the wallet’s last 60 days and each movement’s details. The wallet search also needs wallet:read.
Read earnings (قراءة الأرباح)See your store earnings, their transfers and any amounts owed, with your bank account masked. (عرض أرباح متجرك وتحويلاتها والمبالغ المستحقة عليك، مع إخفاء حسابك البنكي.)earnings:readYour store earnings, transfers, payout account and amounts owed, read only.
Read My Store (قراءة متجري)See your B7R store: its text, look, products and each product's profit, discount codes, visits and sales. (عرض متجرك على B7R: نصوصه ومظهره ومنتجاته وربح كل منتج وأكواد الخصم والزيارات والمبيعات.)my_store:readRead your B7R store, its products, categories, promotions, codes, visits and numbers, and check a new address.
Edit My Store (تعديل متجري)Change your B7R store: its text, look, banner, logo and address, open or close it, and its products, discount codes and free shipping. Needs Read My Store. (تعديل متجرك على B7R: نصوصه ومظهره والبانر والشعار والعنوان، وفتحه وإغلاقه، ومنتجاته ورموز الخصم والشحن المجاني. يلزم معه قراءة متجري.)my_store:writeChange your B7R store one section at a time, rename, open or close it, and change its products, codes and free shipping. Needs my_store:read.
Read settings (قراءة الإعدادات)See your account settings and your verification state. (عرض إعدادات حسابك وحالة التوثيق.)settings:readRead your account settings and your verification.
Edit settings (تعديل الإعدادات)Change your names, language, email subscriptions and default carrier, and send an update that did not arrive again. A new default carrier changes the shipping fee of the orders that follow. (تعديل الأسماء واللغة واشتراكات البريد وشركة الشحن الافتراضية، وإعادة إرسال تحديث لم يصل. تغيير شركة الشحن الافتراضية يغيّر رسوم شحن الطلبات التالية.)settings:writeChange your account settings, and send an update again. Needs settings:read.
Notifications (الإشعارات)See your notifications, mark them read, and get an update when a new one arrives. (عرض إشعاراتك وتعليمها كمقروءة، وتلقّي تحديث عند وصول إشعار جديد.)notificationsRead your notifications and mark them read.
Read support tickets (قراءة تذاكر الدعم)See your support tickets, their messages and images, the help articles, legal texts and how to reach support. (عرض تذاكر الدعم ورسائلها وصورها، ومقالات مركز المساعدة والنصوص القانونية وطرق التواصل مع الدعم.)tickets:readRead your support tickets and their images, the Help Center, the support contact, the legal texts and the feedback form.
Manage support tickets (إدارة تذاكر الدعم)Open support tickets, reply, rate a closed one, answer the feedback form and say whether an article helped. (فتح تذاكر الدعم والرد عليها وتقييم التذكرة المغلقة، والإجابة عن نموذج الملاحظة، وتقييم فائدة المقالة.)tickets:writeOpen, reply to, rate and mark read your tickets, vote on an article and answer the feedback form. Needs tickets:read.

There are no ready-made sets: you tick the areas yourself. Some examples:

The key is forAreas to tick
Your website or platform: it lists products, takes orders and tracks them.catalog, products:read, products:write, orders:read, orders:write, wallet:read.
An AI agent that only looks things up.catalog, products:read, orders:read, wallet:read. It reads and never changes anything.
A tool that ships your orders itself.orders:read and customers:read, to read each order with its shopper and address.

The shopper details box

Shopper details (بيانات العملاء) has a box of its own under the other areas. It is off by default: tick it by hand, beside Read orders (قراءة الطلبات) (the app refuses it alone). The box says what it gives: "The key reads the shopper's name, phone, email, gender and address on an order. B7R records every read in the activity log." (يقرأ المفتاح اسم العميل وجواله وبريده الإلكتروني وجنسه وعنوانه في الطلب، ويسجّل B7R كل قراءة في سجل النشاط.).

  • B7R records every read with include=customer, naming your account and the key prefix.
  • Creating and cancelling an order always answer with the shopper masked, even with this area: a retry with the same Idempotency-Key replays the stored answer to any key of your account, so B7R never stores a shopper's details in one.
  • A key's areas never change. To add this area to a key, create a new key with it ticked, move your system to it, then revoke the old one.

The calls that read a shopper are in Shopper details.

The key is shown once

Your new key (مفتاحك الجديد) warns: "Copy the key now. It will not be shown again." (انسخ المفتاح الآن، فلن يظهر مرة أخرى.). B7R keeps only a fingerprint of the key and can never show it again. This screen does not close when you tap outside it or press Escape: only Close (إغلاق) or its close button leaves it.

  • Press Copy key (نسخ المفتاح) and put the key in an environment variable or a secret store on the server that calls the API.
  • Never put it in browser code, a mobile app, a repository, a chat or a URL. Anyone who holds the key can call the API as you.
  • Test the key (تجربة المفتاح) shows a curl command with your key in it, and Copy command (نسخ الأمر) copies it. Run it on your server: it calls GET /v1/me, which answers your account and the key's areas.
  • After you close the screen, the card lists the key by its name, its prefix (the first 17 characters, b7r_live_ and 8 more), its areas, when it was last used and when it expires. Never the whole key.
  • Lost the key before you stored it? Revoke it and create another.
On your server
export B7R_API_KEY="b7r_live_..."  # paste your whole key
curl https://api.b7r.app/v1/me \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/me", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/me",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()

The email B7R sends

After a key is made, B7R emails your account's address a security notice titled New API key. It names the key, the characters it starts with and when it was made, and has a Manage API keys button that opens Settings, then Integrations. If the key holds the shopper details area, the email adds a line saying it reads shoppers' details. It never contains the key itself.

Did not make that key? The email says what to do: revoke it at once, change your password and open a ticket from the Help Center in the B7R app.

Revoke a key

  1. In the Custom API (الربط عبر API) card, press Revoke key (إلغاء المفتاح) on the key's row.
  2. The question Revoke this key? (إلغاء هذا المفتاح؟) names the key and its prefix. Press Revoke key (إلغاء المفتاح) again to confirm, or Go back (تراجع).

Every call with the key stops at once and gets the same 401 as an unknown key. Revoking cancels nothing by itself, and a revoked key cannot be turned back on.

The question also says: "To replace this key, create the new key first: updates are not recorded while your account has no active key." (لاستبدال المفتاح، أنشئ المفتاح الجديد أولًا: لا نسجّل التحديثات ما دام حسابك بلا مفتاح فعّال.).

Replace a key

There is no rotate button: you replace a key in three steps, so your integration never goes without one.

  1. Create a new key, with the same areas ticked, as above.
  2. Put the new key on your server and check that calls work with it.
  3. Revoke the old key.

At your account's key limit, Create key (إنشاء مفتاح) is greyed out: revoke a key you no longer use first. Think a key leaked? Revoke it first, then create the new one.

When the app stops you

What you seeWhat to do
No Custom API (الربط عبر API) card on the Integrations (الربط) tab.The Custom API is not open on your account yet. Open a ticket from the Help Center in the B7R app.
Complete verification to continue (أكمل التحقق للمتابعة)Your account is not verified yet. The window lists what is missing; Open verification (فتح صفحة التوثيق) takes you there.
Keys cannot be created right now. (إنشاء المفاتيح غير متاح الآن.)B7R cannot make keys right now. Try again later.
You have reached the key limit. (وصلت إلى الحد الأعلى للمفاتيح.)Revoke a key you no longer use, then create the new one.
The terms have changed. Accept them again. (تغيّرت الشروط، يرجى قبولها من جديد.)The API terms changed while the form was open. Tick the box again and press Create key (إنشاء المفتاح).

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