# My Store

> Your B7R store at <handle>.b7r.sa: its text and look, its address and state, the banner categories, the visits and the sales.

Source: https://docs.b7r.app/my-store

> Ids, names, prices and times in the examples are samples. Read the real values from the API.

Your B7R store has three pages here: [My Store](https://docs.b7r.app/my-store) (the store itself, its address and state, its visits and sales), [Store products](https://docs.b7r.app/store-products) (what it sells) and [Store promotions](https://docs.b7r.app/store-promotions) (its discount codes and free shipping).

Reading needs the key area `my_store:read`, and changing needs `my_store:write` beside it. When B7R stores are not open to your account, or the account is not active, each answers `409 feature_not_available`; when B7R cannot tell, `503 service_unavailable`, which you can send again. A key reads the store even while your email or phone is not verified; the app shows its verify card instead of the store until they are.

A store is opened in the B7R app, where you accept the store agreement; the API then manages it. Before you open one, `GET /v1/my-store` answers `store: null` and the candidates on [Store products](https://docs.b7r.app/store-products) list your products; every other call answers `404 not_found` with the error code `store_missing`.

## Read your store

`GET /v1/my-store`

The store’s address, text, contacts, look, home sections, banner, announcement, search text and state. A suspended store says why in `suspended_reason`. `rename_available` is true until the one rename of the handle is used. The logo and each banner image come with their storage `path`, which a later change sends back to keep them.

Key: A key with the `my_store:read` area.

Answer:

- `store` (object or null, required)
  - `id` (string (uuid), required)
  - `handle` (string, required)
  - `url` (string, required)
  - `previous_handle` (string or null, required)
  - `rename_available` (boolean, required)
  - `name` (string, required)
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `logo` (object or null, required)
    - `path` (string, required)
    - `url` (string, required)
  - `look` (object, required)
    - `theme` (string, required)
    - `color` (string or null, required)
    - `font` (string or null, required)
    - `saved_at` (string or null, required)
  - `socials` (object, required)
  - `home_sections` (array of object, required)
    - `key` (string, required): One of `banner`, `pinned`, `all`.
    - `on` (boolean, required)
  - `banner` (object, required)
    - `mode` (string, required): One of `none`, `single`, `slider`.
    - `autoplay` (boolean, required)
    - `slides` (array of object, required)
      - `path` (string, required)
      - `image_url` (string, required)
      - `focus_x` (number, required)
      - `focus_y` (number, required)
      - `link` (any or null, required)
  - `announcement` (object, required)
    - `on` (boolean, required)
    - `text` (string or null, required)
    - `link` (string or null, required)
  - `status` (string, required): One of `open`, `closed`, `suspended`.
  - `suspended_reason` (string or null, required)
  - `link_shared_at` (string or null, required)
  - `free_shipping_threshold` (string or null, required)
  - `seo` (object, required)
    - `title` (string or null, required)
    - `description` (string or null, required)
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/my-store \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

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

Answer (200 OK):

```json
{
  "store": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "handle": "shop-one",
    "url": "https://shop-one.b7r.sa",
    "previous_handle": null,
    "rename_available": true,
    "name": "Shop One",
    "bio": "Prints made by hand",
    "contact_whatsapp": "+966512345678",
    "contact_email": "creator@example.com",
    "logo": {
      "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/logo/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.png",
      "url": "https://media.b7r.sa/store-media/logo.png"
    },
    "look": {
      "theme": "night",
      "color": null,
      "font": null,
      "saved_at": "2026-11-20T10:00:00.000Z"
    },
    "socials": {
      "instagram": "@shop.one"
    },
    "home_sections": [
      {
        "key": "banner",
        "on": true
      },
      {
        "key": "pinned",
        "on": false
      },
      {
        "key": "all",
        "on": true
      }
    ],
    "banner": {
      "mode": "single",
      "autoplay": false,
      "slides": [
        {
          "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/banner/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.jpg",
          "image_url": "https://media.b7r.sa/store-media/banner.jpg",
          "focus_x": 50,
          "focus_y": 40,
          "link": {
            "kind": "category",
            "category_id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b"
          }
        }
      ]
    },
    "announcement": {
      "on": true,
      "text": "Free gift this week",
      "link": null
    },
    "status": "open",
    "suspended_reason": null,
    "link_shared_at": "2026-11-21T09:30:00.000Z",
    "free_shipping_threshold": "250.00",
    "seo": {
      "title": null,
      "description": null
    },
    "created_at": "2026-11-20T09:00:00.000Z"
  }
}
```

## List the banner categories

`GET /v1/my-store/categories`

The categories of the products on the store, shown or hidden: what a banner slide may link to. At most 1,000; `truncated: true` says the list reached that many and more may exist.

Key: A key with the `my_store:read` area.

Answer:

- `data` (array of object, required): At most 1000 items.
  - `id` (string (uuid), required)
  - `name` (object, required)
    - `ar` (string, required)
    - `en` (string, required)
- `truncated` (boolean, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/my-store/categories \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/categories", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

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

Answer (200 OK):

```json
{
  "data": [
    {
      "id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b",
      "name": {
        "ar": "تيشيرتات",
        "en": "T-shirts"
      }
    }
  ],
  "truncated": false
}
```

## Read the visits

`GET /v1/my-store/visits`

`period`: `today`, `7d` or `30d` (the default), Riyadh days, today included. The visits per source and the views per product, largest first. Today’s figures trail the store until B7R next counts its visits, a few times an hour.

Key: A key with the `my_store:read` area.

Query:

- `period` (string): One of `today`, `7d`, `30d`.

Answer:

- `period` (string, required): One of `today`, `7d`, `30d`.
- `visits` (integer, required)
- `by_source` (array of object, required)
  - `source` (string, required)
  - `visits` (integer, required)
- `product_views` (array of object, required)
  - `product_id` (string (uuid), required)
  - `views` (integer, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/my-store/visits \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/visits", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

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

Answer (200 OK):

```json
{
  "period": "30d",
  "visits": 412,
  "by_source": [
    {
      "source": "instagram",
      "visits": 260
    },
    {
      "source": "direct",
      "visits": 152
    }
  ],
  "product_views": [
    {
      "product_id": "4d5e6f7a-8b9c-4d0e-9f2a-3b4c5d6e7f8a",
      "views": 188
    }
  ]
}
```

## Read the numbers

`GET /v1/my-store/numbers`

`period` as for the visits. Paid store orders in live mode, cancelled ones included, and in test mode on their own line, never in `sales`. `conversion` is live orders over visits, null without visits. The top five products by units, and the five newest orders with no shopper details; read an order’s details with the orders area.

Key: A key with the `my_store:read` area.

Query:

- `period` (string): One of `today`, `7d`, `30d`.

Answer:

- `period` (string, required): One of `today`, `7d`, `30d`.
- `live_orders` (integer, required)
- `test_orders` (integer, required)
- `sales` (string, required)
- `conversion` (number or null, required)
- `top_products` (array of object, required)
  - `product_id` (string (uuid), required)
  - `name` (object, required)
    - `ar` (string, required)
    - `en` (string, required)
  - `units` (integer, required)
- `latest_orders` (array of object, required)
  - `order_id` (string, required)
  - `created_at` (string, required)
  - `status` (string, required)
  - `total` (string or null, required)
  - `test` (boolean or null, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/my-store/numbers \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/numbers", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

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

Answer (200 OK):

```json
{
  "period": "30d",
  "live_orders": 12,
  "test_orders": 1,
  "sales": "1440.00",
  "conversion": 0.029,
  "top_products": [
    {
      "product_id": "4d5e6f7a-8b9c-4d0e-9f2a-3b4c5d6e7f8a",
      "name": {
        "ar": "قميص الخط العربي",
        "en": "Calligraphy shirt"
      },
      "units": 7
    }
  ],
  "latest_orders": [
    {
      "order_id": "B00000001042",
      "created_at": "2026-11-25T18:12:00.000Z",
      "status": "in_production",
      "total": "120.00",
      "test": false
    }
  ]
}
```

The calls below change the store and need `my_store:write` beside `my_store:read`. Each counts against `store_writes_per_minute` (`GET /v1/me?include=limits`), takes an `Idempotency-Key` and answers the whole store, as `GET /v1/my-store` does; a call sent again with the same key answers what the first answered. A change goes through the same rules as in the app, and new text goes to B7R’s review as it does there.

## Change one section of your store

`PATCH /v1/my-store`

Send exactly one of `profile`, `look`, `sections`, `banner`, `announcement`, `seo`, `logo_upload_id` or `link_shared`; the section is replaced whole, as the app saves it. Every field of the section is required, a field left out answers `400 invalid_request` and changes nothing; send `null` (or an empty text) to clear a field that may be cleared. The profile’s `socials` takes all five of `instagram`, `tiktok`, `snapchat`, `x` and `youtube`, and the announcement takes `on`, `text` and `link`. The profile needs a WhatsApp number or an email.

Images come from a staged upload (`POST /v1/uploads` with the purpose `my_store_image`): `logo_upload_id` sets the logo, or `null` removes it; each banner slide takes the `path` of an image the store shows now, exactly as `GET /v1/my-store` gives it in `banner.slides[].path`, or the `upload_id` of a new one, exactly one of the two. An upload is used only when the change succeeds. If an image change answers `upload_not_found`, read `GET /v1/my-store` before you upload again: the change may already have been made with that upload. A logo is at most 2 MB and 2048 by 2048 pixels, a banner image 5 MB and 4000 by 4000 (`too_large`, `too_many_pixels`, or `unreadable` for a file that is not a readable image), and the store takes 20 images a minute, as the app does. Images need the account’s email and phone verified: without them the call answers `403 verification_required` naming the missing one.

A colour that does not read on the theme is refused at `/body/look/color` (`colour_unreadable`); a banner link must lead to a product on the store or one of their categories (`banner_link_invalid`), and a kept image must be one the banner shows now (`banner_path_invalid` at that slide’s `path`), checked before any new image is stored.

Key: A key with the `my_store:write` area. Send `Content-Type: application/json`, and `If-Match` with the `ETag` of your last read; `Idempotency-Key` is optional.

Body:

- `profile` (object)
  - `name` (string, required): At most 60.
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `socials` (object, required)
    - `instagram` (string or null, required)
    - `tiktok` (string or null, required)
    - `snapchat` (string or null, required)
    - `x` (string or null, required)
    - `youtube` (string or null, required)
- `look` (object)
  - `theme` (string, required): At most 40.
  - `color` (string or null, required)
  - `font` (string or null, required)
- `sections` (array of object): 3 to 3 items.
  - `key` (string, required): One of `banner`, `pinned`, `all`.
  - `on` (boolean, required)
- `banner` (object)
  - `mode` (string, required): One of `none`, `single`, `slider`.
  - `autoplay` (boolean, required)
  - `slides` (array of object, required): At most 5 items.
    - `path` (string): At most 200.
    - `upload_id` (string (uuid))
    - `focus_x` (number, required): 0 to 100.
    - `focus_y` (number, required): 0 to 100.
    - `link` (any or null, required)
- `announcement` (object)
  - `on` (boolean, required)
  - `text` (string or null, required)
  - `link` (string or null, required)
- `seo` (object)
  - `title` (string, required): At most 60.
  - `description` (string, required): At most 160.
- `logo_upload_id` (string (uuid) or null)
- `link_shared` (constant): Always `true`.

Answer:

- `store` (object or null, required)
  - `id` (string (uuid), required)
  - `handle` (string, required)
  - `url` (string, required)
  - `previous_handle` (string or null, required)
  - `rename_available` (boolean, required)
  - `name` (string, required)
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `logo` (object or null, required)
    - `path` (string, required)
    - `url` (string, required)
  - `look` (object, required)
    - `theme` (string, required)
    - `color` (string or null, required)
    - `font` (string or null, required)
    - `saved_at` (string or null, required)
  - `socials` (object, required)
  - `home_sections` (array of object, required)
    - `key` (string, required): One of `banner`, `pinned`, `all`.
    - `on` (boolean, required)
  - `banner` (object, required)
    - `mode` (string, required): One of `none`, `single`, `slider`.
    - `autoplay` (boolean, required)
    - `slides` (array of object, required)
      - `path` (string, required)
      - `image_url` (string, required)
      - `focus_x` (number, required)
      - `focus_y` (number, required)
      - `link` (any or null, required)
  - `announcement` (object, required)
    - `on` (boolean, required)
    - `text` (string or null, required)
    - `link` (string or null, required)
  - `status` (string, required): One of `open`, `closed`, `suspended`.
  - `suspended_reason` (string or null, required)
  - `link_shared_at` (string or null, required)
  - `free_shipping_threshold` (string or null, required)
  - `seo` (object, required)
    - `title` (string or null, required)
    - `description` (string or null, required)
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `idempotency_key_required` (400), `request_too_large` (413), `unsupported_media_type` (415), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `idempotency_mismatch` (409), `idempotency_in_flight` (409), `verification_required` (403), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X PATCH https://api.b7r.app/v1/my-store \
  -H "Authorization: Bearer $B7R_API_KEY" \
  -H "If-Match: $ETAG" \
  -H "Content-Type: application/json" \
  -d '{
    "seo": {
      "title": "Calligraphy prints",
      "description": ""
    }
  }'
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "If-Match": etag, // the ETag header of your last read
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "seo": {
      "title": "Calligraphy prints",
      "description": ""
    }
  }),
});
const data = await res.json();
```

```python
import os, requests

res = requests.patch(
    "https://api.b7r.app/v1/my-store",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "If-Match": etag,  # the ETag header of your last read
    },
    json={
        "seo": {
            "title": "Calligraphy prints",
            "description": ""
        }
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "store": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "handle": "shop-one",
    "url": "https://shop-one.b7r.sa",
    "previous_handle": null,
    "rename_available": true,
    "name": "Shop One",
    "bio": "Prints made by hand",
    "contact_whatsapp": "+966512345678",
    "contact_email": "creator@example.com",
    "logo": {
      "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/logo/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.png",
      "url": "https://media.b7r.sa/store-media/logo.png"
    },
    "look": {
      "theme": "night",
      "color": null,
      "font": null,
      "saved_at": "2026-11-20T10:00:00.000Z"
    },
    "socials": {
      "instagram": "@shop.one"
    },
    "home_sections": [
      {
        "key": "banner",
        "on": true
      },
      {
        "key": "pinned",
        "on": false
      },
      {
        "key": "all",
        "on": true
      }
    ],
    "banner": {
      "mode": "single",
      "autoplay": false,
      "slides": [
        {
          "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/banner/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.jpg",
          "image_url": "https://media.b7r.sa/store-media/banner.jpg",
          "focus_x": 50,
          "focus_y": 40,
          "link": {
            "kind": "category",
            "category_id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b"
          }
        }
      ]
    },
    "announcement": {
      "on": true,
      "text": "Free gift this week",
      "link": null
    },
    "status": "open",
    "suspended_reason": null,
    "link_shared_at": "2026-11-21T09:30:00.000Z",
    "free_shipping_threshold": "250.00",
    "seo": {
      "title": null,
      "description": null
    },
    "created_at": "2026-11-20T09:00:00.000Z"
  }
}
```

## Check a store address

`GET /v1/my-store/handle-check`

Says whether an address can be used before you rename the store, as the app’s check does; it changes nothing and needs only `my_store:read`. `reason` says why not: the address’s shape (`length`, 3 to 30 characters; `characters`, lower-case letters, digits and hyphens; `edge_hyphen`; `double_hyphen`; `punycode`), `reserved`, or `taken` by a store now or before, which includes your store’s own address. `suggestions` lists free addresses like it. The checks share the app’s 30 a minute for your account (`429 rate_limited`).

Key: A key with the `my_store:read` area.

Query:

- `handle` (string, required): At most 100.

Answer:



Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `feature_not_available` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl "https://api.b7r.app/v1/my-store/handle-check?handle=calligraphy-shop" \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/handle-check?handle=calligraphy-shop", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/my-store/handle-check?handle=calligraphy-shop",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "available": false,
  "reason": "taken",
  "suggestions": [
    "calligraphy-shop-store",
    "calligraphy-shop-sa"
  ]
}
```

## Change your store address

`POST /v1/my-store/rename`

Once per store: the old address keeps leading to the store and is never given to anyone else. A second change is refused with `409 my_store_rejected` and the error `handle_rename_used`; a taken or reserved address with `handle_unavailable`. Sending the address the store already has changes nothing.

Key: A key with the `my_store:write` area. Send `Idempotency-Key` and `Content-Type: application/json`.

Body:

- `handle` (string, required): At most 100.

Answer:

- `store` (object or null, required)
  - `id` (string (uuid), required)
  - `handle` (string, required)
  - `url` (string, required)
  - `previous_handle` (string or null, required)
  - `rename_available` (boolean, required)
  - `name` (string, required)
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `logo` (object or null, required)
    - `path` (string, required)
    - `url` (string, required)
  - `look` (object, required)
    - `theme` (string, required)
    - `color` (string or null, required)
    - `font` (string or null, required)
    - `saved_at` (string or null, required)
  - `socials` (object, required)
  - `home_sections` (array of object, required)
    - `key` (string, required): One of `banner`, `pinned`, `all`.
    - `on` (boolean, required)
  - `banner` (object, required)
    - `mode` (string, required): One of `none`, `single`, `slider`.
    - `autoplay` (boolean, required)
    - `slides` (array of object, required)
      - `path` (string, required)
      - `image_url` (string, required)
      - `focus_x` (number, required)
      - `focus_y` (number, required)
      - `link` (any or null, required)
  - `announcement` (object, required)
    - `on` (boolean, required)
    - `text` (string or null, required)
    - `link` (string or null, required)
  - `status` (string, required): One of `open`, `closed`, `suspended`.
  - `suspended_reason` (string or null, required)
  - `link_shared_at` (string or null, required)
  - `free_shipping_threshold` (string or null, required)
  - `seo` (object, required)
    - `title` (string or null, required)
    - `description` (string or null, required)
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `idempotency_key_required` (400), `request_too_large` (413), `unsupported_media_type` (415), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `idempotency_mismatch` (409), `idempotency_in_flight` (409), `feature_not_available` (409), `my_store_rejected` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/my-store/rename \
  -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 '{
    "handle": "calligraphy-shop"
  }'
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/rename", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "handle": "calligraphy-shop"
  }),
});
const data = await res.json();
```

```python
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/my-store/rename",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "handle": "calligraphy-shop"
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "store": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "handle": "shop-one",
    "url": "https://shop-one.b7r.sa",
    "previous_handle": null,
    "rename_available": true,
    "name": "Shop One",
    "bio": "Prints made by hand",
    "contact_whatsapp": "+966512345678",
    "contact_email": "creator@example.com",
    "logo": {
      "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/logo/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.png",
      "url": "https://media.b7r.sa/store-media/logo.png"
    },
    "look": {
      "theme": "night",
      "color": null,
      "font": null,
      "saved_at": "2026-11-20T10:00:00.000Z"
    },
    "socials": {
      "instagram": "@shop.one"
    },
    "home_sections": [
      {
        "key": "banner",
        "on": true
      },
      {
        "key": "pinned",
        "on": false
      },
      {
        "key": "all",
        "on": true
      }
    ],
    "banner": {
      "mode": "single",
      "autoplay": false,
      "slides": [
        {
          "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/banner/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.jpg",
          "image_url": "https://media.b7r.sa/store-media/banner.jpg",
          "focus_x": 50,
          "focus_y": 40,
          "link": {
            "kind": "category",
            "category_id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b"
          }
        }
      ]
    },
    "announcement": {
      "on": true,
      "text": "Free gift this week",
      "link": null
    },
    "status": "open",
    "suspended_reason": null,
    "link_shared_at": "2026-11-21T09:30:00.000Z",
    "free_shipping_threshold": "250.00",
    "seo": {
      "title": null,
      "description": null
    },
    "created_at": "2026-11-20T09:00:00.000Z"
  }
}
```

## Open your store

`POST /v1/my-store/open`

Reopens your existing store to shoppers after it was closed; an open store stays open. A store is first opened in the B7R app. A store B7R suspended is refused with `409 my_store_rejected` and the error `store_suspended`.

Key: A key with the `my_store:write` area. Send `Idempotency-Key`.

Answer:

- `store` (object or null, required)
  - `id` (string (uuid), required)
  - `handle` (string, required)
  - `url` (string, required)
  - `previous_handle` (string or null, required)
  - `rename_available` (boolean, required)
  - `name` (string, required)
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `logo` (object or null, required)
    - `path` (string, required)
    - `url` (string, required)
  - `look` (object, required)
    - `theme` (string, required)
    - `color` (string or null, required)
    - `font` (string or null, required)
    - `saved_at` (string or null, required)
  - `socials` (object, required)
  - `home_sections` (array of object, required)
    - `key` (string, required): One of `banner`, `pinned`, `all`.
    - `on` (boolean, required)
  - `banner` (object, required)
    - `mode` (string, required): One of `none`, `single`, `slider`.
    - `autoplay` (boolean, required)
    - `slides` (array of object, required)
      - `path` (string, required)
      - `image_url` (string, required)
      - `focus_x` (number, required)
      - `focus_y` (number, required)
      - `link` (any or null, required)
  - `announcement` (object, required)
    - `on` (boolean, required)
    - `text` (string or null, required)
    - `link` (string or null, required)
  - `status` (string, required): One of `open`, `closed`, `suspended`.
  - `suspended_reason` (string or null, required)
  - `link_shared_at` (string or null, required)
  - `free_shipping_threshold` (string or null, required)
  - `seo` (object, required)
    - `title` (string or null, required)
    - `description` (string or null, required)
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `idempotency_key_required` (400), `request_too_large` (413), `unsupported_media_type` (415), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `idempotency_mismatch` (409), `idempotency_in_flight` (409), `feature_not_available` (409), `my_store_rejected` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/my-store/open \
  -H "Authorization: Bearer $B7R_API_KEY" \
  -H "Idempotency-Key: $(uuidgen 2>/dev/null || node -e 'console.log(crypto.randomUUID())')"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/open", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
const data = await res.json();
```

```python
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/my-store/open",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "store": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "handle": "shop-one",
    "url": "https://shop-one.b7r.sa",
    "previous_handle": null,
    "rename_available": true,
    "name": "Shop One",
    "bio": "Prints made by hand",
    "contact_whatsapp": "+966512345678",
    "contact_email": "creator@example.com",
    "logo": {
      "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/logo/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.png",
      "url": "https://media.b7r.sa/store-media/logo.png"
    },
    "look": {
      "theme": "night",
      "color": null,
      "font": null,
      "saved_at": "2026-11-20T10:00:00.000Z"
    },
    "socials": {
      "instagram": "@shop.one"
    },
    "home_sections": [
      {
        "key": "banner",
        "on": true
      },
      {
        "key": "pinned",
        "on": false
      },
      {
        "key": "all",
        "on": true
      }
    ],
    "banner": {
      "mode": "single",
      "autoplay": false,
      "slides": [
        {
          "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/banner/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.jpg",
          "image_url": "https://media.b7r.sa/store-media/banner.jpg",
          "focus_x": 50,
          "focus_y": 40,
          "link": {
            "kind": "category",
            "category_id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b"
          }
        }
      ]
    },
    "announcement": {
      "on": true,
      "text": "Free gift this week",
      "link": null
    },
    "status": "open",
    "suspended_reason": null,
    "link_shared_at": "2026-11-21T09:30:00.000Z",
    "free_shipping_threshold": "250.00",
    "seo": {
      "title": null,
      "description": null
    },
    "created_at": "2026-11-20T09:00:00.000Z"
  }
}
```

## Close your store

`POST /v1/my-store/close`

Type the store’s current address in `confirm_handle` to close it; another value is refused at `/body/confirm_handle` (`confirm_handle_mismatch`). Shoppers then see the store as closed. A suspended store is refused as for opening.

Key: A key with the `my_store:write` area. Send `Idempotency-Key` and `Content-Type: application/json`.

Body:

- `confirm_handle` (string, required): At most 100.

Answer:

- `store` (object or null, required)
  - `id` (string (uuid), required)
  - `handle` (string, required)
  - `url` (string, required)
  - `previous_handle` (string or null, required)
  - `rename_available` (boolean, required)
  - `name` (string, required)
  - `bio` (string or null, required)
  - `contact_whatsapp` (string or null, required)
  - `contact_email` (string or null, required)
  - `logo` (object or null, required)
    - `path` (string, required)
    - `url` (string, required)
  - `look` (object, required)
    - `theme` (string, required)
    - `color` (string or null, required)
    - `font` (string or null, required)
    - `saved_at` (string or null, required)
  - `socials` (object, required)
  - `home_sections` (array of object, required)
    - `key` (string, required): One of `banner`, `pinned`, `all`.
    - `on` (boolean, required)
  - `banner` (object, required)
    - `mode` (string, required): One of `none`, `single`, `slider`.
    - `autoplay` (boolean, required)
    - `slides` (array of object, required)
      - `path` (string, required)
      - `image_url` (string, required)
      - `focus_x` (number, required)
      - `focus_y` (number, required)
      - `link` (any or null, required)
  - `announcement` (object, required)
    - `on` (boolean, required)
    - `text` (string or null, required)
    - `link` (string or null, required)
  - `status` (string, required): One of `open`, `closed`, `suspended`.
  - `suspended_reason` (string or null, required)
  - `link_shared_at` (string or null, required)
  - `free_shipping_threshold` (string or null, required)
  - `seo` (object, required)
    - `title` (string or null, required)
    - `description` (string or null, required)
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `idempotency_key_required` (400), `request_too_large` (413), `unsupported_media_type` (415), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `idempotency_mismatch` (409), `idempotency_in_flight` (409), `feature_not_available` (409), `my_store_rejected` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/my-store/close \
  -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 '{
    "confirm_handle": "shop-one"
  }'
```

```javascript
const res = await fetch("https://api.b7r.app/v1/my-store/close", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "confirm_handle": "shop-one"
  }),
});
const data = await res.json();
```

```python
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/my-store/close",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "confirm_handle": "shop-one"
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "store": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "handle": "shop-one",
    "url": "https://shop-one.b7r.sa",
    "previous_handle": null,
    "rename_available": true,
    "name": "Shop One",
    "bio": "Prints made by hand",
    "contact_whatsapp": "+966512345678",
    "contact_email": "creator@example.com",
    "logo": {
      "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/logo/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.png",
      "url": "https://media.b7r.sa/store-media/logo.png"
    },
    "look": {
      "theme": "night",
      "color": null,
      "font": null,
      "saved_at": "2026-11-20T10:00:00.000Z"
    },
    "socials": {
      "instagram": "@shop.one"
    },
    "home_sections": [
      {
        "key": "banner",
        "on": true
      },
      {
        "key": "pinned",
        "on": false
      },
      {
        "key": "all",
        "on": true
      }
    ],
    "banner": {
      "mode": "single",
      "autoplay": false,
      "slides": [
        {
          "path": "stores/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e/banner/7a8b9c0d-1e2f-4a3b-8c5d-6e7f8a9b0c1d.jpg",
          "image_url": "https://media.b7r.sa/store-media/banner.jpg",
          "focus_x": 50,
          "focus_y": 40,
          "link": {
            "kind": "category",
            "category_id": "5e6f7a8b-9c0d-4e1f-8a3b-4c5d6e7f8a9b"
          }
        }
      ]
    },
    "announcement": {
      "on": true,
      "text": "Free gift this week",
      "link": null
    },
    "status": "open",
    "suspended_reason": null,
    "link_shared_at": "2026-11-21T09:30:00.000Z",
    "free_shipping_threshold": "250.00",
    "seo": {
      "title": null,
      "description": null
    },
    "created_at": "2026-11-20T09:00:00.000Z"
  }
}
```
