# credit_check_failed

> The credit check wasn't approved

- Status: 400 Bad Request
- Returned by: /api/public
- Operations: [createOrder](https://developers.rivr.io/reference/api-public/createOrder.md)
- Retry (`retryWhen`): `never`
- Did anything happen? (`outcome`): `partial` (Something else happened)
- Creating an order in /api/public
- Page in the portal: https://developers.rivr.io/errors/credit_check_failed
- Try it: `GET https://developers.rivr.io/errors/simulate/credit_check_failed` answers with the code's exact wire form; `?succeedAfter=N&attempt=K` gives a 200 once `attempt` passes `N`

## What it means

The order needed a credit check that wasn't approved or couldn't be done. `message` says why, with the same text as before, usually in Swedish. No order was created and nothing was charged, but the patient may have been looked up or created and run through the KYC screening, and a credit check may have been made with Avarda.

## What your system does

Read `message`. Let the patient pay another way, or contact Rivr if it persists.

## Is it worth retrying?

No, not without changing the call.

`retryWhen`: `never`. Don't send it again. The answer is final for this request: read the current state, the order for example, and act on that.

## Did anything happen?

`outcome`: `partial`. **Something else happened.** What you asked for did not happen, but something else had already happened, see the note.

No order was created and nothing was charged, but before the answer the patient may have been looked up or created, with details from the population register, and run through the KYC screening. If the clinic has Avarda, a credit check and an authorisation that is never captured may have been made. A retry with the same order id runs the whole check again.

Read the state (`resolveWith`):

- `createOrder` → [`GET /api/public/orders/{orderId}`](https://developers.rivr.io/reference/api-public/getOrder.md): `204`: no order exists with the id.

## Example: /api/public

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

{
  "propertyName": "creditCheck",
  "message": "Kreditkontroll ej godkänd: KYC",
  "errorCode": "credit_check_failed",
  "code": "credit_check_failed",
  "type": "https://developers.rivr.io/errors/credit_check_failed"
}
```

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