# idempotency_key_invalid

> Invalid Idempotency-Key

- Status: 400 Bad Request
- Returned by: /api/public
- Operations: [cancelOrder](https://developers.rivr.io/reference/api-public/cancelOrder.md), [refundOrder](https://developers.rivr.io/reference/api-public/refundOrder.md), [sendOrderToDevice](https://developers.rivr.io/reference/api-public/sendOrderToDevice.md), [createSubscription](https://developers.rivr.io/reference/api-public/createSubscription.md)
- Retry (`retryWhen`): `after_fix`
- Did anything happen? (`outcome`): `none` (It did not happen)
- Idempotency-Key in /api/public
- Page in the portal: https://developers.rivr.io/errors/idempotency_key_invalid
- Try it: `GET https://developers.rivr.io/errors/simulate/idempotency_key_invalid` answers with the code's exact wire form; `?succeedAfter=N&attempt=K` gives a 200 once `attempt` passes `N`

## What it means

The `Idempotency-Key` header is not a single value of 1 to 255 printable ASCII characters, or the token can't be tied to an API client or a clinic. Nothing was done. On send-to-device and `POST /api/public/subscriptions` the code comes only in the sandbox until the platform's next release; production ignores the header there.

## What your system does

Send a new UUID as the key, one per request: per refund, cancellation, send to a device or request that creates or extends a subscription.

## Is it worth retrying?

No, not without changing the call.

`retryWhen`: `after_fix`. Change the request first, as the code's page says: a value, the token, a header or a new key. Then send it.

## Did anything happen?

`outcome`: `none`. **It did not happen.** This call did not do what you asked for and changed nothing else that you can see or that concerns money. Where the code has an `outcomeNote`, it takes precedence.

## Example: /api/public

```http
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "propertyName": "Idempotency-Key",
  "message": "The Idempotency-Key header must be a single value of 1 to 255 printable ASCII characters. Nothing was done.",
  "errorCode": "idempotency_key_invalid",
  "code": "idempotency_key_invalid",
  "type": "https://developers.rivr.io/errors/idempotency_key_invalid"
}
```

The `title`, `detail`, `message` and `error_description` texts are exactly as the API writes them today.
