# Returns

> Withdrawals and voluntary returns (D153): approved, declined and received as the returns page does them.

| Operation | Method and path | Scope |
|---|---|---|
| [List returns](https://docs.kaizenaflow.com/reference/admin-api/returns#returns-list) | `GET /returns` | [`orders:read`](https://docs.kaizenaflow.com/reference/scopes#orders-read) |
| [Get a return](https://docs.kaizenaflow.com/reference/admin-api/returns#returns-get) | `GET /returns/{id}` | [`orders:read`](https://docs.kaizenaflow.com/reference/scopes#orders-read) |
| [Approve a return](https://docs.kaizenaflow.com/reference/admin-api/returns#returns-approve) | `POST /returns/{id}/approve` | [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send) |
| [Decline a return](https://docs.kaizenaflow.com/reference/admin-api/returns#returns-decline) | `POST /returns/{id}/decline` | [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send) |
| [Mark a return received](https://docs.kaizenaflow.com/reference/admin-api/returns#returns-receive) | `POST /returns/{id}/receive` | [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send) |

## List returns {#returns-list}

`GET https://kaizenaflow.com/api/admin/v1/returns`

Withdrawals and voluntary returns, newest first.

- **Operation:** `returns.list`
- **Scope:** [`orders:read`](https://docs.kaizenaflow.com/reference/scopes#orders-read), or [`orders:write`](https://docs.kaizenaflow.com/reference/scopes#orders-write), which reads too
- **Answers:** `200`, a page: the rows under `data`, and `next` for the page after.
- **Pages:** at most 100 rows, 50 when `limit` is left out; give an answer's `next` as `?after=` for the page after.

### Query parameters {#returns-list-query}

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer, 1 to 100 | no | Rows a page holds, at most 100; 50 when left out. A larger number gives 100. |
| `after` | string, at most 200 characters | no | The `next` cursor of the page before; the first page when left out. |
| `updated_after` | string (date-time) | no | Only what was made or changed after this time (ISO 8601 with its offset), for incremental sync. |
| `status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` | no | Only returns in this state. |
| `kind` | one of `withdrawal`, `return` | no | Only withdrawals, or only voluntary returns. |

### Answer {#returns-list-answer}

| Field | Type | Description |
|---|---|---|
| `data` | list of objects |   |
| `data[].id` | string (uuid) |   |
| `data[].number` | string |   |
| `data[].kind` | one of `withdrawal`, `return` | withdrawal (the right of withdrawal) or return (a voluntary return). |
| `data[].status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` |   |
| `data[].order_id` | string (uuid) |   |
| `data[].order_number` | string |   |
| `data[].currency` | string, matching `^[A-Z]{3}$` | An ISO 4217 code, such as NOK or EUR. |
| `data[].reason` | string or null | Why, as the shopper chose it. |
| `data[].lines` | list of objects |   |
| `data[].lines[].order_line_id` | string (uuid) |   |
| `data[].lines[].sku` | string |   |
| `data[].lines[].title` | string |   |
| `data[].lines[].quantity` | integer |   |
| `data[].lines[].decision` | one of `accept`, `decline` |   |
| `data[].lines[].condition` | one of `as_new`, `opened`, `used`, `damaged` or null |   |
| `data[].lines[].restock` | boolean |   |
| `data[].refund` | object |   |
| `data[].refund.recorded` | boolean |   |
| `data[].refund.amount_minor` | integer or null | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
| `data[].refund.at` | string (date-time) or null |   |
| `data[].created_at` | string (date-time) |   |
| `data[].approved_at` | string (date-time) or null |   |
| `data[].received_at` | string (date-time) or null |   |
| `data[].closed_at` | string (date-time) or null |   |
| `data[].updated_at` | string (date-time) |   |
| `next` | string or null | The cursor of the next page, given as `?after=`; null on the last page. |

### Errors {#returns-list-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#returns-list-example}

**curl**

```shell
curl 'https://kaizenaflow.com/api/admin/v1/returns' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/returns", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/returns",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Get a return {#returns-get}

`GET https://kaizenaflow.com/api/admin/v1/returns/{id}`

One return with its lines, its refund and its steps' times.

- **Operation:** `returns.get`
- **Scope:** [`orders:read`](https://docs.kaizenaflow.com/reference/scopes#orders-read), or [`orders:write`](https://docs.kaizenaflow.com/reference/scopes#orders-write), which reads too
- **Answers:** `200`, the answer under `data`.

### Path parameters {#returns-get-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Answer {#returns-get-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.number` | string |   |
| `data.kind` | one of `withdrawal`, `return` | withdrawal (the right of withdrawal) or return (a voluntary return). |
| `data.status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` |   |
| `data.order_id` | string (uuid) |   |
| `data.order_number` | string |   |
| `data.currency` | string, matching `^[A-Z]{3}$` | An ISO 4217 code, such as NOK or EUR. |
| `data.reason` | string or null | Why, as the shopper chose it. |
| `data.lines` | list of objects |   |
| `data.lines[].order_line_id` | string (uuid) |   |
| `data.lines[].sku` | string |   |
| `data.lines[].title` | string |   |
| `data.lines[].quantity` | integer |   |
| `data.lines[].decision` | one of `accept`, `decline` |   |
| `data.lines[].condition` | one of `as_new`, `opened`, `used`, `damaged` or null |   |
| `data.lines[].restock` | boolean |   |
| `data.refund` | object |   |
| `data.refund.recorded` | boolean |   |
| `data.refund.amount_minor` | integer or null | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
| `data.refund.at` | string (date-time) or null |   |
| `data.created_at` | string (date-time) |   |
| `data.approved_at` | string (date-time) or null |   |
| `data.received_at` | string (date-time) or null |   |
| `data.closed_at` | string (date-time) or null |   |
| `data.updated_at` | string (date-time) |   |

### Errors {#returns-get-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#returns-get-example}

**curl**

```shell
curl 'https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Approve a return {#returns-approve}

`POST https://kaizenaflow.com/api/admin/v1/returns/{id}/approve`

Approves a voluntary return through the returns page's own step; the shopper is emailed how to send the goods back.

- **Operation:** `returns.approve`
- **Scope:** [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send)
- **Answers:** `200`, the answer under `data`.
- **Once only:** with an [`Idempotency-Key`](https://docs.kaizenaflow.com/reference/admin-api#idempotency) header.

### Path parameters {#returns-approve-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Body {#returns-approve-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `instructions` | string, at most 2,000 characters or null | no | How to send the goods back; the store's own when left out. |
| `label_url` | `""` or string (uri) or null | no | A return label's address (https). |
| `note` | string, at most 1,000 characters or null | no | A note for staff. |

### Answer {#returns-approve-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.number` | string |   |
| `data.kind` | one of `withdrawal`, `return` | withdrawal (the right of withdrawal) or return (a voluntary return). |
| `data.status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` |   |
| `data.order_id` | string (uuid) |   |
| `data.order_number` | string |   |
| `data.currency` | string, matching `^[A-Z]{3}$` | An ISO 4217 code, such as NOK or EUR. |
| `data.reason` | string or null | Why, as the shopper chose it. |
| `data.lines` | list of objects |   |
| `data.lines[].order_line_id` | string (uuid) |   |
| `data.lines[].sku` | string |   |
| `data.lines[].title` | string |   |
| `data.lines[].quantity` | integer |   |
| `data.lines[].decision` | one of `accept`, `decline` |   |
| `data.lines[].condition` | one of `as_new`, `opened`, `used`, `damaged` or null |   |
| `data.lines[].restock` | boolean |   |
| `data.refund` | object |   |
| `data.refund.recorded` | boolean |   |
| `data.refund.amount_minor` | integer or null | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
| `data.refund.at` | string (date-time) or null |   |
| `data.created_at` | string (date-time) |   |
| `data.approved_at` | string (date-time) or null |   |
| `data.received_at` | string (date-time) or null |   |
| `data.closed_at` | string (date-time) or null |   |
| `data.updated_at` | string (date-time) |   |

### Errors {#returns-approve-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | [`conflict`](https://docs.kaizenaflow.com/reference/errors#conflict) | Nothing was done: it clashes with how things are now (nothing left to send), or an `Idempotency-Key` is in use or was used for another request. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#returns-approve-example}

**curl**

```shell
curl -X POST 'https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/approve' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"instructions":"example"}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/approve", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "instructions": "example"
  }),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/approve",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "instructions": "example",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Decline a return {#returns-decline}

`POST https://kaizenaflow.com/api/admin/v1/returns/{id}/decline`

Declines a voluntary return with the reason the shopper is emailed. A withdrawal is never declined.

- **Operation:** `returns.decline`
- **Scope:** [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send)
- **Answers:** `200`, the answer under `data`.
- **Once only:** with an [`Idempotency-Key`](https://docs.kaizenaflow.com/reference/admin-api#idempotency) header.

### Path parameters {#returns-decline-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Body {#returns-decline-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `reason` | string, 1 to 1,000 characters | yes | Why, as the shopper is emailed. |

### Answer {#returns-decline-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.number` | string |   |
| `data.kind` | one of `withdrawal`, `return` | withdrawal (the right of withdrawal) or return (a voluntary return). |
| `data.status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` |   |
| `data.order_id` | string (uuid) |   |
| `data.order_number` | string |   |
| `data.currency` | string, matching `^[A-Z]{3}$` | An ISO 4217 code, such as NOK or EUR. |
| `data.reason` | string or null | Why, as the shopper chose it. |
| `data.lines` | list of objects |   |
| `data.lines[].order_line_id` | string (uuid) |   |
| `data.lines[].sku` | string |   |
| `data.lines[].title` | string |   |
| `data.lines[].quantity` | integer |   |
| `data.lines[].decision` | one of `accept`, `decline` |   |
| `data.lines[].condition` | one of `as_new`, `opened`, `used`, `damaged` or null |   |
| `data.lines[].restock` | boolean |   |
| `data.refund` | object |   |
| `data.refund.recorded` | boolean |   |
| `data.refund.amount_minor` | integer or null | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
| `data.refund.at` | string (date-time) or null |   |
| `data.created_at` | string (date-time) |   |
| `data.approved_at` | string (date-time) or null |   |
| `data.received_at` | string (date-time) or null |   |
| `data.closed_at` | string (date-time) or null |   |
| `data.updated_at` | string (date-time) |   |

### Errors {#returns-decline-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | [`conflict`](https://docs.kaizenaflow.com/reference/errors#conflict) | Nothing was done: it clashes with how things are now (nothing left to send), or an `Idempotency-Key` is in use or was used for another request. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#returns-decline-example}

**curl**

```shell
curl -X POST 'https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/decline' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"reason":"example"}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/decline", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "reason": "example"
  }),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/decline",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "reason": "example",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

## Mark a return received {#returns-receive}

`POST https://kaizenaflow.com/api/admin/v1/returns/{id}/receive`

Records that the goods arrived, on a day or today; the shopper is emailed. Inspecting and refunding stay in the admin.

- **Operation:** `returns.receive`
- **Scope:** [`orders:send`](https://docs.kaizenaflow.com/reference/scopes#orders-send)
- **Answers:** `200`, the answer under `data`.
- **Once only:** with an [`Idempotency-Key`](https://docs.kaizenaflow.com/reference/admin-api#idempotency) header.

### Path parameters {#returns-receive-path}

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | yes | The thing's id in this store. |

### Body {#returns-receive-body}

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `on` | string (date) or null | no | The day the goods arrived (the store's day); today when left out. |

### Answer {#returns-receive-answer}

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string (uuid) |   |
| `data.number` | string |   |
| `data.kind` | one of `withdrawal`, `return` | withdrawal (the right of withdrawal) or return (a voluntary return). |
| `data.status` | one of `requested`, `approved`, `in_transit`, `received`, `inspected`, `closed`, `declined`, `cancelled` |   |
| `data.order_id` | string (uuid) |   |
| `data.order_number` | string |   |
| `data.currency` | string, matching `^[A-Z]{3}$` | An ISO 4217 code, such as NOK or EUR. |
| `data.reason` | string or null | Why, as the shopper chose it. |
| `data.lines` | list of objects |   |
| `data.lines[].order_line_id` | string (uuid) |   |
| `data.lines[].sku` | string |   |
| `data.lines[].title` | string |   |
| `data.lines[].quantity` | integer |   |
| `data.lines[].decision` | one of `accept`, `decline` |   |
| `data.lines[].condition` | one of `as_new`, `opened`, `used`, `damaged` or null |   |
| `data.lines[].restock` | boolean |   |
| `data.refund` | object |   |
| `data.refund.recorded` | boolean |   |
| `data.refund.amount_minor` | integer or null | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
| `data.refund.at` | string (date-time) or null |   |
| `data.created_at` | string (date-time) |   |
| `data.approved_at` | string (date-time) or null |   |
| `data.received_at` | string (date-time) or null |   |
| `data.closed_at` | string (date-time) or null |   |
| `data.updated_at` | string (date-time) |   |

### Errors {#returns-receive-errors}

| Status | Code | When |
|---|---|---|
| 401 | [`unauthorized`](https://docs.kaizenaflow.com/reference/errors#unauthorized) | No valid token in `Authorization: Bearer kf_…`, or one that was revoked. |
| 403 | [`forbidden`](https://docs.kaizenaflow.com/reference/errors#forbidden) | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | [`not_found`](https://docs.kaizenaflow.com/reference/errors#not-found) | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | [`conflict`](https://docs.kaizenaflow.com/reference/errors#conflict) | Nothing was done: it clashes with how things are now (nothing left to send), or an `Idempotency-Key` is in use or was used for another request. |
| 422 | [`invalid`](https://docs.kaizenaflow.com/reference/errors#invalid) | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | [`rate_limited`](https://docs.kaizenaflow.com/reference/errors#rate-limited) | More calls than the budget allows; `Retry-After` says how many seconds to wait. |
| 500 | [`failed`](https://docs.kaizenaflow.com/reference/errors#failed) | Something went wrong on our side; nothing more was done. It is safe to try again. |

### Example request {#returns-receive-example}

**curl**

```shell
curl -X POST 'https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/receive' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"on":"2026-11-03"}'
```

**JavaScript**

```javascript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/receive", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "on": "2026-11-03"
  }),
});
const answer = await response.json();
```

**Python**

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/returns/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/receive",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "on": "2026-11-03",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)
```

---

https://docs.kaizenaflow.com/reference/admin-api/returns · made from the API contract 1.57
