> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Quote a tip and tax


`POST /v1/checkout_sessions/{checkout_session_id}/quote`

Prices the amount the session was opened with (`amount`, minor units, on **Create checkout session**) plus a tip and the account's tax. The body carries modifiers only; a base amount or currency here is refused. Each modifier is minor units, or `{ preset }` / `{ bps }` / `{ amountMinor }`.

Returns `{ base, tax?, tip?, total, estimated? }` in minor units. **A preview, not a reservation:** the charge amount is whatever your server sends to `POST /v1/payments`, never the session amount. A surcharge is never priced here: sending one is refused (`SURCHARGE_UNAVAILABLE`), and when the account has one enabled the answer carries `estimated: { surcharge: true }` so your page can say the total may change.

A session opened without an amount answers `SESSION_AMOUNT_REQUIRED`.

Auth: a publishable key. Returns `200` with Quote.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `checkoutSessionId` | path | string | Yes | The checkout session id in the request path. |
| `modifiers` | body | string | No | The modifiers value. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/checkout_sessions/{checkout_session_id}/quote" \
  -H "Authorization: Bearer $MYELA_PUBLISHABLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "modifiers": {
    "tip": 390
  }
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/checkout_sessions/{checkout_session_id}/quote", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_PUBLISHABLE_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "modifiers": {
      "tip": 390
    }
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/checkout_sessions/{checkout_session_id}/quote",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_PUBLISHABLE_KEY']}",
    },
    json={
        "modifiers": {
            "tip": 390
        }
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `base` | integer | The amount the session was opened with, in minor units. |
| `tax` | integer | Tax in minor units. Omitted when none applies. |
| `tip` | integer | Tip in minor units. Omitted when none applies. |
| `total` | integer | Base plus the parts, in minor units. A preview: the charge amount is what your server sends to POST /v1/payments. |
| `estimated` | object | Present as { surcharge: true } when the account has a surcharge this total leaves out. |

```json
{
  "base": 2599,
  "tax": 200,
  "tip": 390,
  "total": 3189,
  "estimated": {
    "surcharge": true
  }
}
```

Source: https://docs.merchantservicedepot.com/api-reference/quote-a-tip-and-tax/
