# Create a checkout monitor session

`POST https://app.shuttleglobal.com/c/api/instances/{instance_key}/checkout_monitor`

Create a new checkout monitor session. The session ID returned can be used with
the Shuttle.checkout_monitor() JavaScript function to receive real-time updates
about the checkout process.

The nonce parameter must match the one passed in your checkout options.
This ensures that only authorized sessions can monitor the checkout progress.

## Authentication

- basicAuth: Basic Authentication using secret key
- bearerAuth: OAuth 2.0 Bearer Token Authentication

## Request body (`application/json`), required

- `nonce` (string): The nonce passed in the checkout options

## Responses

### 200: Created checkout monitor session

```json
{
  "id": "eyJob3N0IjoiYXBwLnNodXR0bGVnbG9iYWwuY29tIiwic2Vzc2lvbiI6IjhiODU0YzY4MWQxNDBiYTEyNjNhMzU2NTQxMzkwYmFjIiwibm9uY2UiOiJUSEVfTk9OQ0VfWU9VX1BBU1NFRF9UT19DSEVDS09VVCJ9"
}
```

### 400: Bad request

```json
{
  "code": "string",
  "message": "string"
}
```

### 401: Unauthorised: the API key is missing or not valid

```json
{
  "code": "UNAUTHORIZED",
  "message": "Unauthorised"
}
```

## Example request

```sh
curl --request POST \
  --url https://app.shuttleglobal.com/c/api/instances/YOUR_INSTANCE_KEY/checkout_monitor \
  --header 'Authorization: Basic <base64 of SECRET_KEY:>' \
  --header 'Content-Type: application/json' \
  --data '{
  "nonce": "THE_NONCE_YOU_PASSED_TO_CHECKOUT"
}'
```

Reference page: https://docs.shuttleglobal.com/platforms/reference/operations/createcheckoutmonitor/