---
title: "Puts a price in a cart at the offer the customer gets now; zero removes the line."
---

> 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 customer API › checkout

`PUT /v1/stores/{store}/checkouts/{checkout}/items`

## Authentication

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

## Path parameters

- `store` (`setCheckoutItem.path.store`; string, required) — A hostname of the store.
- `checkout` (`setCheckoutItem.path.checkout`; string, required)
  - minLength 1

## Request body

_Required._

- `price` (`setCheckoutItem.price`; object, required)
  - `id` (`setCheckoutItem.price.id`; string, required)
    - minLength 1; maxLength 512
- `quantity` (`setCheckoutItem.quantity`; integer, optional) — Zero removes the line.
  - min 0; max 99
- `display_name` (`setCheckoutItem.display_name`; any of, optional) — The name a tip or a donation is left under; null clears it, leaving it out keeps it.
  - any of: `string`, `null`
- `message` (`setCheckoutItem.message`; any of, optional) — A message left with a tip or a donation; null clears it, leaving it out keeps it.
  - any of: `string`, `null`
- `guests` (`setCheckoutItem.guests`; any of, optional) — An event ticket's guests, one per ticket past the buyer's own, or one per ticket to give them all; null clears them, leaving them out keeps them.
  - any of: `array<object>`, `null`

## Example request

```json
{
  "price": {
    "id": "string"
  },
  "quantity": 99,
  "display_name": "string",
  "message": "string",
  "guests": [
    {
      "email": "string",
      "name": "string"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/checkouts/<checkout>/items' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "price": {
    "id": "string"
  },
  "quantity": 99,
  "display_name": "string",
  "message": "string",
  "guests": [
    {
      "email": "string",
      "name": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/checkouts/<checkout>/items';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    price: {id: 'string'},
    quantity: 99,
    display_name: 'string',
    message: 'string',
    guests: [{email: 'string', name: '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/customer/v1/stores/<store>/checkouts/<checkout>/items"

payload = {
    "price": { "id": "string" },
    "quantity": 99,
    "display_name": "string",
    "message": "string",
    "guests": [
        {
            "email": "string",
            "name": "string"
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Puts a price in a cart at the offer the customer gets now; zero removes the line.

#### Example

```json
{
  "status": "string",
  "order": {
    "id": "string",
    "number": 0
  },
  "under_minimum": {
    "processor": "stripe",
    "amount": 0,
    "minimum": 0
  },
  "refund_consent": "string",
  "card_required": {
    "reason": "string"
  },
  "items": [
    {
      "product": {
        "id": "string",
        "slug": "string",
        "path": "string",
        "url": "string",
        "title": "string",
        "category": "string",
        "deleted": true
      },
      "autorenew": true,
      "first_charge_at": "string",
      "refund_policy": "string",
      "refund_until": "string",
      "id": "string",
      "product_id": "string",
      "price_id": "string",
      "quantity": 0,
      "amount": 0,
      "discount": 0,
      "discount_id": "string",
      "total": 0,
      "mode": "string",
      "display_name": "string",
      "message": "string",
      "guests": [
        {
          "email": "string",
          "name": "string"
        }
      ]
    }
  ],
  "totals": {
    "amount": 0,
    "discount": 0,
    "total": 0
  },
  "id": "string",
  "currency": "string",
  "exponent": 0,
  "coupon": "string",
  "refund_waiver": {
    "policy": "string",
    "accepted_at": "string"
  },
  "expires_at": "string",
  "created_at": "string",
  "updated_at": "string"
}
```

- `status` (`setCheckoutItem.response.200.status`; string, required)
- `order` (`setCheckoutItem.response.200.order`; any of, required)
  - any of: `object`, `null`
- `under_minimum` (`setCheckoutItem.response.200.under_minimum`; any of, required)
  - any of: `object`, `null`
- `refund_consent` (`setCheckoutItem.response.200.refund_consent`; any of, required)
  - any of: `string`, `null`
- `card_required` (`setCheckoutItem.response.200.card_required`; any of, required)
  - any of: `object`, `null`
- `items` (`setCheckoutItem.response.200.items`; array<object>, required)
  - `product` (`setCheckoutItem.response.200.items.product`; any of, required)
    - any of: `object`, `null`
  - `autorenew` (`setCheckoutItem.response.200.items.autorenew`; any of, required)
    - any of: `boolean`, `null`
  - `first_charge_at` (`setCheckoutItem.response.200.items.first_charge_at`; any of, required)
    - any of: `string`, `null`
  - `refund_policy` (`setCheckoutItem.response.200.items.refund_policy`; any of, required)
    - any of: `string`, `null`
  - `refund_until` (`setCheckoutItem.response.200.items.refund_until`; any of, required)
    - any of: `string`, `null`
  - `id` (`setCheckoutItem.response.200.items.id`; string, required)
  - `product_id` (`setCheckoutItem.response.200.items.product_id`; string, required)
  - `price_id` (`setCheckoutItem.response.200.items.price_id`; string, required)
  - `quantity` (`setCheckoutItem.response.200.items.quantity`; number, required)
  - `amount` (`setCheckoutItem.response.200.items.amount`; number, required)
  - `discount` (`setCheckoutItem.response.200.items.discount`; number, required)
  - `discount_id` (`setCheckoutItem.response.200.items.discount_id`; any of, required)
    - any of: `string`, `null`
  - `total` (`setCheckoutItem.response.200.items.total`; number, required)
  - `mode` (`setCheckoutItem.response.200.items.mode`; string, required)
  - `display_name` (`setCheckoutItem.response.200.items.display_name`; any of, required)
    - any of: `string`, `null`
  - `message` (`setCheckoutItem.response.200.items.message`; any of, required)
    - any of: `string`, `null`
  - `guests` (`setCheckoutItem.response.200.items.guests`; array<object>, required)
    - `email` (`setCheckoutItem.response.200.items.guests.email`; string, required)
    - `name` (`setCheckoutItem.response.200.items.guests.name`; any of, required)
      - any of: `string`, `null`
- `totals` (`setCheckoutItem.response.200.totals`; object, required)
  - `amount` (`setCheckoutItem.response.200.totals.amount`; number, required)
  - `discount` (`setCheckoutItem.response.200.totals.discount`; number, required)
  - `total` (`setCheckoutItem.response.200.totals.total`; number, required)
- `id` (`setCheckoutItem.response.200.id`; string, required)
- `currency` (`setCheckoutItem.response.200.currency`; string, required)
- `exponent` (`setCheckoutItem.response.200.exponent`; any of, required)
  - any of: `number`, `null`
- `coupon` (`setCheckoutItem.response.200.coupon`; any of, required)
  - any of: `string`, `null`
- `refund_waiver` (`setCheckoutItem.response.200.refund_waiver`; any of, required)
  - any of: `object`, `null`
- `expires_at` (`setCheckoutItem.response.200.expires_at`; any of, required)
  - any of: `string`, `null`
- `created_at` (`setCheckoutItem.response.200.created_at`; any of, required)
  - any of: `string`, `null`
- `updated_at` (`setCheckoutItem.response.200.updated_at`; any of, required)
  - any of: `string`, `null`

### default

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

#### Example

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

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


Source: https://docs.sherpo.io/customer-api/reference/set-checkout-item/index.md
