# Cancel an unpaid order through its link

`POST /public/shop/orders/{id}/cancel` · Rivier · shop

Cancel an unpaid order through its link.

- Scope: shop:read
- Sdk: shop.publicOrder.cancel
- Cli: shop public order cancel
- Publishable: yes

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "minLength": 10,
      "maxLength": 4000
    },
    "reason": {
      "type": "string",
      "maxLength": 300,
      "default": ""
    }
  },
  "required": [
    "token"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/public/shop/orders/{id}/cancel' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "string"
}'
```
