---
title: "Bans a domain, an address or a pattern from every store of the business. Access already given stays."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › organization

`POST /v1/stores/{store}/business_bans`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `organization:write`

## Path parameters

- `store` (`createBusinessBan.path.store`; string, required) — The store's id.

## Request body

_Required._

- `kind` (`createBusinessBan.kind`; string, required) — What the ban names: `domain` (an address's domain and its subdomains), `email` (one exact address) or `pattern` (matched whole on the lowercased address).
  - one of `"email"`, `"domain"`, `"pattern"`
- `value` (`createBusinessBan.value`; string, required) — The domain (a leading `@` dropped), the address, or the pattern: literals, `.`, classes, `\d \w \s`, groups, `|` and repeats up to 100, in lowercase, refused when it can't be matched safely.
  - minLength 1; maxLength 254
- `note` (`createBusinessBan.note`; any of, optional) — Why the address is banned, for staff alone; trimmed.
  - any of: `string`, `null`

## Example request

```json
{
  "kind": "email",
  "value": "string",
  "note": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/business_bans' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "kind": "email",
  "value": "string",
  "note": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/business_bans';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({kind: 'email', value: 'string', note: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/business_bans"

payload = {
    "kind": "email",
    "value": "string",
    "note": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Bans a domain, an address or a pattern from every store of the business. Access already given stays.

#### Example

```json
{
  "id": "string",
  "kind": "string",
  "value": "string",
  "note": "string",
  "created_at": "string",
  "updated_at": "string"
}
```

- `id` (`createBusinessBan.response.201.id`; string, required)
- `kind` (`createBusinessBan.response.201.kind`; string, required) — `domain` (with its subdomains), `email` (exact) or `pattern` (matched whole on the lowercased address).
- `value` (`createBusinessBan.response.201.value`; string, required) — The domain or address in lowercase, a domain in ASCII; the pattern as written.
- `note` (`createBusinessBan.response.201.note`; any of, required) — Why the address is banned, for staff alone; null for none.
  - any of: `string`, `null`
- `created_at` (`createBusinessBan.response.201.created_at`; string, required)
- `updated_at` (`createBusinessBan.response.201.updated_at`; string, required)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`createBusinessBan.response.default.type`; string, required)
  - format `uri`
- `title` (`createBusinessBan.response.default.title`; string, required)
- `status` (`createBusinessBan.response.default.status`; integer, required)
- `detail` (`createBusinessBan.response.default.detail`; string, required)
- `code` (`createBusinessBan.response.default.code`; string, optional)
- `context` (`createBusinessBan.response.default.context`; object, optional)
- `reached_core` (`createBusinessBan.response.default.reached_core`; boolean, optional)
- `core_answer` (`createBusinessBan.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/create-business-ban/index.md
