---
title: "Starts paying a frozen cart, answering what the buyer's page confirms with the processor, or the order when nothing is due."
---

> 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

`POST /v1/stores/{store}/checkouts/{checkout}/pay`

## Authentication

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

## Path parameters

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

## Request body

_Optional._

- `instrument` (`payCheckout.instrument`; object, optional) — One of the buyer's saved payment methods to pay with, as `getBillingProfile` lists it; only when the payment starts.
  - `id` (`payCheckout.instrument.id`; string, required)
    - minLength 1; maxLength 512
- `attribution` (`payCheckout.attribution`; object, optional) — What the buyer's browser tells the store's Meta pixel, kept for its purchase event only while the store sends them.
  - `fbp` (`payCheckout.attribution.fbp`; string, optional) — The `_fbp` cookie.
    - minLength 1; maxLength 500
  - `fbc` (`payCheckout.attribution.fbc`; string, optional) — The `_fbc` cookie.
    - minLength 1; maxLength 500
  - `client_ip_address` (`payCheckout.attribution.client_ip_address`; string, optional) — The buyer's IP address.
    - minLength 1; maxLength 64
  - `client_user_agent` (`payCheckout.attribution.client_user_agent`; string, optional)
    - minLength 1; maxLength 512
  - `country` (`payCheckout.attribution.country`; string, optional) — ISO 3166-1 alpha-2.
    - minLength 2; maxLength 2; pattern `^[A-Za-z]{2}$`
  - `city` (`payCheckout.attribution.city`; string, optional)
    - minLength 1; maxLength 128
  - `region` (`payCheckout.attribution.region`; string, optional) — The region's code.
    - minLength 1; maxLength 16
  - `postal_code` (`payCheckout.attribution.postal_code`; string, optional)
    - minLength 1; maxLength 32
  - `source_url` (`payCheckout.attribution.source_url`; string, optional) — The http(s) page the payment started from; its query and fragment are dropped.
    - minLength 1; maxLength 2048

## Example request

```json
{
  "instrument": {
    "id": "string"
  },
  "attribution": {
    "fbp": "string",
    "fbc": "string",
    "client_ip_address": "string",
    "client_user_agent": "string",
    "country": "st",
    "city": "string",
    "region": "string",
    "postal_code": "string",
    "source_url": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/checkouts/<checkout>/pay' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instrument": {
    "id": "string"
  },
  "attribution": {
    "fbp": "string",
    "fbc": "string",
    "client_ip_address": "string",
    "client_user_agent": "string",
    "country": "st",
    "city": "string",
    "region": "string",
    "postal_code": "string",
    "source_url": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/checkouts/<checkout>/pay';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    instrument: {id: 'string'},
    attribution: {
      fbp: 'string',
      fbc: 'string',
      client_ip_address: 'string',
      client_user_agent: 'string',
      country: 'st',
      city: 'string',
      region: 'string',
      postal_code: 'string',
      source_url: '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>/pay"

payload = {
    "instrument": { "id": "string" },
    "attribution": {
        "fbp": "string",
        "fbc": "string",
        "client_ip_address": "string",
        "client_user_agent": "string",
        "country": "st",
        "city": "string",
        "region": "string",
        "postal_code": "string",
        "source_url": "string"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Starts paying a frozen cart, answering what the buyer's page confirms with the processor, or the order when nothing is due.

#### Example

```json
{
  "status": "paid",
  "order": {
    "id": "string",
    "number": 0
  }
}
```

Any of:

- `object`
- `object`
- `object`
- `object`

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


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