# Creating clients and mandates

This guide walks you through registering a client and creating mandates covering the four supported directory entry types.

## Prerequisites

- A valid API token (`Authorization: <token>` header)
- Base URL: `https://pdp.seqino.dev/api`


## Step 1: Create a client

A **client** represents a company you manage invoicing for. Each client gets a unique `client_id` that you'll pass as the `X-PDP-Client-Id` header in subsequent calls.


```bash cURL
curl -X POST https://pdp.seqino.dev/api/clients \
  -H "Authorization: <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_name": "Dupont & Fils SAS",
    "contact_email": "facturation@dupont-fils.fr",
    "external_ref": "CLIENT-001"
  }'
```


```python Python
import httpx

client = httpx.Client(base_url="https://pdp.seqino.dev/api", headers={"Authorization": "<your-token>"})

response = client.post("/clients", json={
    "organization_name": "Dupont & Fils SAS",
    "contact_email": "facturation@dupont-fils.fr",
    "external_ref": "CLIENT-001",
})
response.raise_for_status()
client_id = response.json()["id"]
print(f"Client ID: {client_id}")
```


```typescript TypeScript
const response = await fetch("https://pdp.seqino.dev/api/clients", {
  method: "POST",
  headers: {
    "Authorization": "<your-token>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    organization_name: "Dupont & Fils SAS",
    contact_email: "facturation@dupont-fils.fr",
    external_ref: "CLIENT-001",
  }),
});
const { id: clientId } = await response.json();
console.log("Client ID:", clientId);
```

The response returns the created client object including its `id`. Save this value — you'll use it as `X-PDP-Client-Id` for all mandate operations below.

## Step 2: Create mandates

A **mandate** authorizes your client to send or receive invoices on behalf of a specific directory entry. The scope of the mandate is determined by which identifier fields you provide.

All mandate requests require the `X-PDP-Client-Id` header set to the client ID from Step 1.

### SIREN mandate

Covers all establishments under a company. Use when the counterpart hasn't specified a more granular routing.


```bash cURL
curl -X POST https://pdp.seqino.dev/api/mandates \
  -H "Authorization: <your-token>" \
  -H "X-PDP-Client-Id: <client-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2026-01-01T00:00:00Z",
    "directory_entry": {
      "siren": "123456789",
      "name": "Dupont & Fils SAS"
    }
  }'
```


```python Python
response = client.post("/mandates",
    headers={"X-PDP-Client-Id": client_id},
    json={
        "start_date": "2026-01-01T00:00:00Z",
        "directory_entry": {
            "siren": "123456789",
            "name": "Dupont & Fils SAS",
        },
    },
)
response.raise_for_status()
```


```typescript TypeScript
await fetch("https://pdp.seqino.dev/api/mandates", {
  method: "POST",
  headers: {
    "Authorization": "<your-token>",
    "X-PDP-Client-Id": clientId,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    start_date: "2026-01-01T00:00:00Z",
    directory_entry: {
      siren: "123456789",
      name: "Dupont & Fils SAS",
    },
  }),
});
```

### SIREN + suffix mandate

Targets a specific service or department within a company, identified by a free-form suffix. Use this when the counterpart routes invoices by department (e.g. `Achats`, `DAF`).


```bash cURL
curl -X POST https://pdp.seqino.dev/api/mandates \
  -H "Authorization: <your-token>" \
  -H "X-PDP-Client-Id: <client-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2026-01-01T00:00:00Z",
    "directory_entry": {
      "siren": "123456789",
      "name": "Dupont & Fils SAS",
      "suffix": "Achats"
    }
  }'
```


```python Python
response = client.post("/mandates",
    headers={"X-PDP-Client-Id": client_id},
    json={
        "start_date": "2026-01-01T00:00:00Z",
        "directory_entry": {
            "siren": "123456789",
            "name": "Dupont & Fils SAS",
            "suffix": "Achats",
        },
    },
)
response.raise_for_status()
```


```typescript TypeScript
await fetch("https://pdp.seqino.dev/api/mandates", {
  method: "POST",
  headers: {
    "Authorization": "<your-token>",
    "X-PDP-Client-Id": clientId,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    start_date: "2026-01-01T00:00:00Z",
    directory_entry: {
      siren: "123456789",
      name: "Dupont & Fils SAS",
      suffix: "Achats",
    },
  }),
});
```

### SIRET mandate

Targets a specific establishment (site) within a company. Use when the counterpart routes invoices by establishment.


```bash cURL
curl -X POST https://pdp.seqino.dev/api/mandates \
  -H "Authorization: <your-token>" \
  -H "X-PDP-Client-Id: <client-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2026-01-01T00:00:00Z",
    "directory_entry": {
      "siren": "123456789",
      "name": "Dupont & Fils SAS — Siège social",
      "siret": "12345678900012"
    }
  }'
```


```python Python
response = client.post("/mandates",
    headers={"X-PDP-Client-Id": client_id},
    json={
        "start_date": "2026-01-01T00:00:00Z",
        "directory_entry": {
            "siren": "123456789",
            "name": "Dupont & Fils SAS — Siège social",
            "siret": "12345678900012",
        },
    },
)
response.raise_for_status()
```


```typescript TypeScript
await fetch("https://pdp.seqino.dev/api/mandates", {
  method: "POST",
  headers: {
    "Authorization": "<your-token>",
    "X-PDP-Client-Id": clientId,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    start_date: "2026-01-01T00:00:00Z",
    directory_entry: {
      siren: "123456789",
      name: "Dupont & Fils SAS — Siège social",
      siret: "12345678900012",
    },
  }),
});
```

### SIRET + routing code mandate

Targets a specific establishment with an additional routing identifier (e.g. GLN, ODETTE). Use this when the counterpart's PDP requires structured routing beyond SIRET.


```bash cURL
curl -X POST https://pdp.seqino.dev/api/mandates \
  -H "Authorization: <your-token>" \
  -H "X-PDP-Client-Id: <client-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2026-01-01T00:00:00Z",
    "directory_entry": {
      "siren": "123456789",
      "name": "Dupont & Fils SAS — Siège social",
      "siret": "12345678900012",
      "routing_identifier": "3012345678906",
      "routing_identifier_type": "0088"
    }
  }'
```


```python Python
response = client.post("/mandates",
    headers={"X-PDP-Client-Id": client_id},
    json={
        "start_date": "2026-01-01T00:00:00Z",
        "directory_entry": {
            "siren": "123456789",
            "name": "Dupont & Fils SAS — Siège social",
            "siret": "12345678900012",
            "routing_identifier": "3012345678906",
            "routing_identifier_type": "0088",
        },
    },
)
response.raise_for_status()
```


```typescript TypeScript
await fetch("https://pdp.seqino.dev/api/mandates", {
  method: "POST",
  headers: {
    "Authorization": "<your-token>",
    "X-PDP-Client-Id": clientId,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    start_date: "2026-01-01T00:00:00Z",
    directory_entry: {
      siren: "123456789",
      name: "Dupont & Fils SAS — Siège social",
      siret: "12345678900012",
      routing_identifier: "3012345678906",
      routing_identifier_type: "0088",
    },
  }),
});
```

The supported `routing_identifier_type` values are:

| Value | Standard | Description |
|  --- | --- | --- |
| `0088` | GS1 | GLN (Global Location Number) |
| `0060` | DUNS | Dun & Bradstreet number |
| `0224` | SIREN/SIRET | French national identifier |
| `Internal` | — | Internal routing code defined by the counterpart's PDP |


## Next steps

Once your mandates are active, you can start submitting invoices. See the [API reference](/openapi) for the full invoicing endpoints.