> For the complete documentation index, see [llms.txt](/llms.txt).

# Move sandbox customer into a state

**PATCH** `https://stage.iwoca-dev.co.uk/api/lending/v2.2/sandbox/customers/{customer_id}/`

Sandbox only. Moves one of your sandbox customers into the requested state, running any intermediate steps for you. The customer must already have an application. `state` must be one of the values a GET to this endpoint lists in `reachable_states`, or the customer's current state, which does nothing.

## Path parameters
- `customer_id` (string, required) — The unique customer_id used to represent a customer.

## Body
```json
{
  "data": {
    "state": "missing_application"
  }
}
```

### Body fields
- `data` (object, required)
- `data.state` (string, required)

## Responses
### 200 — OK
```json
{
  "data": {
    "application_id": "7b2f0a56-9c31-4f7e-8d20-5e6a1b4c3d2e",
    "customer_id": "1c1d4e1e-4f38-4d1a-9e5f-3a2b0c9d8e7f",
    "reachable_states": [
      "missing_application"
    ],
    "state": "missing_application"
  }
}
```

### 400 — Bad Request
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 401 — Unauthorized
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 403 — Forbidden
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 404 — Not Found
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 409 — Conflict
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 422 — Unprocessable Entity
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

### 500 — Internal Server Error
```json
{
  "errors": [
    {
      "code": "string",
      "detail": "string"
    }
  ]
}
```

## Example (curl)
```bash
curl 'https://stage.iwoca-dev.co.uk/api/lending/v2.2/sandbox/customers/<customer_id>/' \
  --request PATCH \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data": {
    "state": "missing_application"
  }
}'
```