# Stores

> Your connected stores: pause, resume and disconnect them, decline a store waiting for approval, and see where a product is published.

Source: https://docs.b7r.app/stores

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

> Connecting a store is done in the app only, in Settings: no key connects a store, by a link, a pairing code or an approval. A key with `stores:manage` pauses, resumes and disconnects your stores and declines a store waiting for approval.

> Declining a waiting store, pause, resume and disconnect each count one against `store_actions_per_minute` (`GET /v1/me?include=limits`), which your keys share. Over it they answer `rate_limited` with the limit and when it resets, and change nothing.

> A connect link, declining a waiting store, pause, resume and disconnect each count one against `store_actions_per_minute` (`GET /v1/me?include=limits`), which your keys share. Over it they answer `rate_limited` with the limit and when it resets, and change nothing.

## List your stores

`GET /v1/stores`

Every store connected to your account, oldest first. `paused`: its orders stop while the connection stays. `needs_reconnect`: the store no longer gives B7R access; reinstall the app on the store.

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

Answer:

- `stores` (array of object, required)
  - `id` (string (uuid), required)
  - `platform` (string, required)
  - `name` (string or null, required)
  - `url` (string or null, required)
  - `status` (string, required): One of `connected`, `disconnected`, `expired`.
  - `paused` (boolean, required)
  - `subscription_status` (string, required)
  - `needs_reconnect` (boolean, 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). See [Errors](https://docs.b7r.app/errors).

Request:

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

```javascript
const res = await fetch("https://api.b7r.app/v1/stores", {
  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/stores",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "stores": [
    {
      "id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
      "platform": "salla",
      "name": "My shop",
      "url": "https://my-shop.example",
      "status": "connected",
      "paused": false,
      "subscription_status": "active",
      "needs_reconnect": false
    }
  ]
}
```

## Read the store that waits for approval

`GET /v1/stores/waiting`

A store installed with an email that matches your account waits for your approval: `null` when none waits. Approve it in the app; a key can only decline it.

Key: A key with the `stores:manage` area.

Answer:

- `store` (object or null, required)
  - `platform` (string, required)
  - `platform_store_id` (string, required)
  - `name` (string or null, required)
  - `moves_from_another_account` (boolean, 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). See [Errors](https://docs.b7r.app/errors).

Request:

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

```javascript
const res = await fetch("https://api.b7r.app/v1/stores/waiting", {
  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/stores/waiting",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "store": {
    "platform": "salla",
    "platform_store_id": "1877089798",
    "name": "My shop",
    "moves_from_another_account": false
  }
}
```

## Decline the store that waits

`POST /v1/stores/waiting/decline`

Drops the store that waits; it does not come back. Its pairing code still works.

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

Body:

- `platform` (string, required): 1 to 32.
- `platform_store_id` (string, required): 1 to 200.

Answer:

- `declined` (constant, required): Always `true`.

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `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), `store_rejected` (422). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/stores/waiting/decline \
  -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 '{
    "platform": "salla",
    "platform_store_id": "1877089798"
  }'
```

```javascript
const res = await fetch("https://api.b7r.app/v1/stores/waiting/decline", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "platform": "salla",
    "platform_store_id": "1877089798"
  }),
});
const data = await res.json();
```

```python
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/stores/waiting/decline",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "platform": "salla",
        "platform_store_id": "1877089798"
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "declined": true
}
```

## Pause a store

`POST /v1/stores/{id}/pause`

Its orders stop reaching B7R; the connection stays. A store of another account answers `not_found`, the same as one that does not exist.

Key: A key with the `stores:manage` area. Send `Idempotency-Key`.

Path:

- `id` (string (uuid), required)

Answer:

- `id` (string (uuid), required)
- `paused` (boolean, 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). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/pause \
  -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/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/pause", {
  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/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/pause",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
  "paused": true
}
```

## Resume a store

`POST /v1/stores/{id}/resume`

Its orders reach B7R again.

Key: A key with the `stores:manage` area. Send `Idempotency-Key`.

Path:

- `id` (string (uuid), required)

Answer:

- `id` (string (uuid), required)
- `paused` (boolean, 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). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/resume \
  -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/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/resume", {
  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/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/resume",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
  "paused": false
}
```

## Disconnect a store

`POST /v1/stores/{id}/disconnect`

`confirm_name` is the store’s name as the list answers it (its id when it has no name). Refused while the store has open orders or money held for them (`store_open_orders`). Your products stay on sale in the store, and their new orders do not reach B7R: hide or delete them in the store’s dashboard first.

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

Path:

- `id` (string (uuid), required)

Body:

- `confirm_name` (string, required): 1 to 200.

Answer:

- `id` (string (uuid), required)
- `disconnected` (constant, required): Always `true`.

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), `store_open_orders` (409). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl -X POST https://api.b7r.app/v1/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/disconnect \
  -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_name": "My shop"
  }'
```

```javascript
const res = await fetch("https://api.b7r.app/v1/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/disconnect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "confirm_name": "My shop"
  }),
});
const data = await res.json();
```

```python
import os, requests, uuid

res = requests.post(
    "https://api.b7r.app/v1/stores/3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c/disconnect",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "confirm_name": "My shop"
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
  "disconnected": true
}
```

## Where a product is published

`GET /v1/products/{id}/stores`

The product’s state on each of your connected stores: `published`, `hidden`, `removed` (unpublished) or `not_published`, its last push that went through, and the code of its last failed push. Only connected stores are listed: a store whose access ended (`status` `expired` in `GET /v1/stores`) is not. Also in `GET /v1/products` and `GET /v1/products/{id}` with `include=stores`.

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

Path:

- `id` (string (uuid), required)

Answer:

- `stores` (array of object, required)
  - `store_id` (string (uuid), required)
  - `platform` (string, required)
  - `name` (string or null, required)
  - `state` (string, required): One of `published`, `hidden`, `removed`, `not_published`.
  - `last_pushed_at` (string or null, required)
  - `last_error` (string 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). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/products/5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b/stores \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/products/5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b/stores", {
  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/products/5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b/stores",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "stores": [
    {
      "store_id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
      "platform": "salla",
      "name": "My shop",
      "state": "published",
      "last_pushed_at": "2026-11-26T10:00:00.000Z",
      "last_error": null
    }
  ]
}
```

## Changes a store did not take

`GET /v1/store-issues`

A store refused a change (`refused`, with its own words) or said yes and did not apply it (`not_applied`): an order status, a shipment, a product’s visibility, details or stock. Each stays here until the store takes it or the change is sent again, which closes it. At most 500, oldest first. `can_send_again` is false for the carrier switch, which only B7R sends again, and for a product taken down or archived, which a resend would refuse; hiding a product B7R holds hidden can always be sent again.

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

Answer:

- `data` (array of object, required)
  - `id` (string (uuid), required)
  - `store_id` (string (uuid), required)
  - `store_name` (string or null, required)
  - `target` (object, required)
    - `type` (string, required): One of `order`, `product`.
    - `id` (string, required)
  - `change` (string, required): One of `order_status`, `shipment`, `order_carrier`, `product_visibility`, `product_details`, `product_quality`, `stock`.
  - `reason` (string, required): One of `refused`, `not_applied`.
  - `store_message` (string or null, required)
  - `attempts` (integer, required)
  - `first_seen_at` (string, required)
  - `last_seen_at` (string, required)
  - `can_send_again` (boolean, 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). See [Errors](https://docs.b7r.app/errors).

Request:

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

```javascript
const res = await fetch("https://api.b7r.app/v1/store-issues", {
  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/store-issues",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "data": [
    {
      "id": "6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d",
      "store_id": "3f2a6b1c-8d4e-4f5a-9b6c-7d8e9f0a1b2c",
      "store_name": "My shop",
      "target": {
        "type": "product",
        "id": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b"
      },
      "change": "product_details",
      "reason": "refused",
      "store_message": "The price is below the store minimum.",
      "attempts": 2,
      "first_seen_at": "2026-11-25T10:00:00.000Z",
      "last_seen_at": "2026-11-26T10:00:00.000Z",
      "can_send_again": true
    }
  ]
}
```
