# Allocate a park to an item

Source: https://amanucci.com/nl/docs/developers/api/bank/allocateSuspense

## POST /v1/entities/{entityId}/open-items/{suspenseItemId}/allocate

Allocate a park to an item

Say which open item a parked bank line pays. The park's 499 item and the item become one `manual` group, confirmed by you in the same transaction, and its settlement is enqueued: the netting then posts in the miscellaneous daybook, each item cleared on its own shelf, the bank account untouched (the money moved once, when the line parked). The park's aging case resolves when the netting clears it in full. 201 with the group; a replay with the same `groupId` and body is 200 with the stored group, any other body 409 `allocation_conflict`. Refused, with nothing written: a park or item that is not a live one of the entity → 404; two items on one side, two currencies, a park for an item, or an amount above what either has left → 422 `allocation_invalid`. Not a signed act: no step-up.

Operation ID: `allocateSuspense`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "suspenseItemId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AllocateSuspense"
      }
    }
  }
}
```

### Responses

#### 200 The same allocation, already made.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/MatchDecision"
    }
  }
}
```

#### 201 The group, confirmed.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/MatchDecision"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
