---
title: "Prices each of a product's prices as the checkout would charge a customer, or a new one, with an optional coupon, quantity and later time, writing nothing; naming a customer needs `customer:read`, and a coupon `discount:read`."
---

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

`GET /v1/stores/{store}/products/{product}/checkout/simulate`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `price:read`

## Path parameters

- `store` (`simulateCheckout.path.store`; string, required) — The store's id.
- `product` (`simulateCheckout.path.product`; string, required)
  - minLength 1

## Query parameters

- `customer` (`simulateCheckout.query.customer`; string, optional) — An id. `null` clears it.
  - minLength 1
- `coupon` (`simulateCheckout.query.coupon`; string, optional) — A discount's code, or its id, as the checkout reads a coupon.
  - minLength 1; maxLength 64
- `at` (`simulateCheckout.query.at`; string, optional) — When to price at; now when absent, never earlier, and a date alone is that day's start in UTC.
  - pattern `^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$`
- `quantity` (`simulateCheckout.query.quantity`; integer, optional) — How many of a one-time price; one when absent.
  - min 1; max 99

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/checkout/simulate' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/checkout/simulate';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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>/products/<product>/checkout/simulate"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Prices each of a product's prices as the checkout would charge a customer, or a new one, with an optional coupon, quantity and later time, writing nothing; naming a customer needs `customer:read`, and a coupon `discount:read`.

#### Example

```json
{
  "at": "string",
  "customer": {
    "id": "string"
  },
  "product": {
    "id": "string"
  },
  "coupon": "string",
  "quantity": 0,
  "owned": {
    "tier_rank": 0,
    "source": "string",
    "tier_expires_at": "string",
    "expires_at": "string"
  },
  "prices": [
    {
      "price": {
        "id": "string",
        "tier": {
          "id": "string",
          "rank": 0,
          "name": "string"
        },
        "kind": "string",
        "period": {
          "unit": "string",
          "multiplier": 0
        },
        "title": "string",
        "currency": "string",
        "exponent": 0,
        "amount": 0
      },
      "verdict": {
        "status": "refused",
        "reason": "string"
      },
      "mode": "string",
      "list": 0,
      "discounted": 0,
      "discount": {
        "applied": "string",
        "automatic": {
          "id": "string",
          "name": "string",
          "code": "string",
          "discounted": 0
        },
        "coupon": {
          "id": "string",
          "name": "string",
          "code": "string",
          "discounted": 0
        }
      },
      "coupon": {
        "status": "string"
      },
      "upgrade": {
        "source": "string",
        "from_rank": 0,
        "paid": {
          "gross": 0,
          "refunded": 0
        },
        "held": {
          "id": "string",
          "amount": 0,
          "discounted": 0
        },
        "credit": 0,
        "effective_credit": 0,
        "base": 0,
        "multiplier": 0,
        "multiplied": 0,
        "cap": 0,
        "capped": true,
        "free": true
      },
      "minimum": {
        "amount": 0,
        "approximate": true,
        "waived": 0
      },
      "recurring": {
        "period": {
          "unit": "string",
          "multiplier": 0
        },
        "first": 0,
        "renewal": 0,
        "renewal_waived": 0,
        "autorenew": true
      }
    }
  ]
}
```

- `at` (`simulateCheckout.response.200.at`; string, required) — When the prices were read at.
- `customer` (`simulateCheckout.response.200.customer`; any of, required)
  - any of: `object`, `null`
- `product` (`simulateCheckout.response.200.product`; object, required)
  - `id` (`simulateCheckout.response.200.product.id`; string, required)
- `coupon` (`simulateCheckout.response.200.coupon`; any of, required)
  - any of: `string`, `null`
- `quantity` (`simulateCheckout.response.200.quantity`; number, required)
- `owned` (`simulateCheckout.response.200.owned`; any of, required) — What the customer already holds of the product, or null.
  - any of: `object`, `null`
- `prices` (`simulateCheckout.response.200.prices`; array<object>, required) — Every live price, and an archived one the customer's plan still renews on, in the checkout's order.
  - `price` (`simulateCheckout.response.200.prices.price`; object, required) — The price as the product lists it.
    - `id` (`simulateCheckout.response.200.prices.price.id`; string, required)
    - `tier` (`simulateCheckout.response.200.prices.price.tier`; any of, required)
      - any of: `object`, `null`
    - `kind` (`simulateCheckout.response.200.prices.price.kind`; string, required)
    - `period` (`simulateCheckout.response.200.prices.price.period`; any of, required)
      - any of: `object`, `null`
    - `title` (`simulateCheckout.response.200.prices.price.title`; any of, required)
      - any of: `string`, `null`
    - `currency` (`simulateCheckout.response.200.prices.price.currency`; string, required)
    - `exponent` (`simulateCheckout.response.200.prices.price.exponent`; any of, required)
      - any of: `number`, `null`
    - `amount` (`simulateCheckout.response.200.prices.price.amount`; number, required)
  - `verdict` (`simulateCheckout.response.200.prices.verdict`; any of, required) — What the checkout would charge for `quantity`, or why it would refuse the price.
    - any of: `object`, `object`
  - `mode` (`simulateCheckout.response.200.prices.mode`; any of, required) — How the checkout offers it, whatever the verdict: a purchase, an upgrade, a renewal, or null when it doesn't.
    - any of: `string`, `null`
  - `list` (`simulateCheckout.response.200.prices.list`; number, required) — The amount before any discount or credit.
  - `discounted` (`simulateCheckout.response.200.prices.discounted`; any of, required) — The amount after the discount that applied, coupon over automatic.
    - any of: `number`, `null`
  - `discount` (`simulateCheckout.response.200.prices.discount`; object, required) — The automatic discount and the coupon that reach the price, and which one applied; their `id`, `name` and `code` are null without `discount:read`.
    - `applied` (`simulateCheckout.response.200.prices.discount.applied`; any of, required)
      - any of: `string`, `null`
    - `automatic` (`simulateCheckout.response.200.prices.discount.automatic`; any of, required)
      - any of: `object`, `null`
    - `coupon` (`simulateCheckout.response.200.prices.discount.coupon`; any of, required)
      - any of: `object`, `null`
  - `coupon` (`simulateCheckout.response.200.prices.coupon`; any of, required) — The coupon's verdict on this price, or null when none was named.
    - any of: `object`, `null`
  - `upgrade` (`simulateCheckout.response.200.prices.upgrade`; any of, required) — The credit for what the customer already holds of the product, or null when the price isn't an upgrade.
    - any of: `object`, `null`
  - `minimum` (`simulateCheckout.response.200.prices.minimum`; object, required) — The payment processor's minimum charge, and the total under it the checkout grants free.
    - `amount` (`simulateCheckout.response.200.prices.minimum.amount`; number, required)
    - `approximate` (`simulateCheckout.response.200.prices.minimum.approximate`; boolean, required)
    - `waived` (`simulateCheckout.response.200.prices.minimum.waived`; any of, required)
      - any of: `number`, `null`
  - `recurring` (`simulateCheckout.response.200.prices.recurring`; any of, required) — For a plan, its first charge and what it renews at, or null for a one-time price.
    - any of: `object`, `null`

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


Source: https://docs.sherpo.io/merchant-api/reference/simulate-checkout/index.md
