---
title: "Discards the staged body, keeping the published one."
---

> 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 › file

`POST /v1/stores/{store}/{kind}/{id}/body/discard`

## Authentication

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

## Path parameters

- `store` (`discardStaged.path.store`; string, required) — The store's id.
- `kind` (`discardStaged.path.kind`; string, required) — The target's kind, in the plural.
  - minLength 1
- `id` (`discardStaged.path.id`; string, required)
  - minLength 1

## Header parameters

- `Idempotency-Key` (`discardStaged.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Required._

- `from` (`discardStaged.from`; object, required) — The staged body's `asset.id` the caller saw, never its `attachment.id`.
  - `id` (`discardStaged.from.id`; string, required)
    - minLength 1; maxLength 512

## Example request

```json
{
  "from": {
    "id": "string"
  }
}
```

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/body/discard';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({from: {id: '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>/<kind>/<id>/body/discard"

payload = { "from": { "id": "string" } }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Discards the staged body, keeping the published one.

#### Example

```json
{
  "id": "string",
  "deleted": true
}
```

- `id` (`discardStaged.response.200.id`; string, required)
- `deleted` (`discardStaged.response.200.deleted`; boolean, 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` (`discardStaged.response.default.type`; string, required)
  - format `uri`
- `title` (`discardStaged.response.default.title`; string, required)
- `status` (`discardStaged.response.default.status`; integer, required)
- `detail` (`discardStaged.response.default.detail`; string, required)
- `code` (`discardStaged.response.default.code`; string, optional)
- `context` (`discardStaged.response.default.context`; object, optional)
- `reached_core` (`discardStaged.response.default.reached_core`; boolean, optional)
- `core_answer` (`discardStaged.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/discard-staged/index.md
