# Register a party

Source: https://amanucci.com/nl/docs/developers/api/parties/createParty

## POST /v1/entities/{entityId}/parties

Register a party

Register a counterparty — the identity ladder's VAT-id rung. A normalised VAT number that already names a live party in this entity RESOLVES to it (200, `alreadyExisted: true`, the existing facts returned unchanged); no hit CREATES (201). An explicit `vatNumber: null` asserts there is none and creates a row off the rung. Only the name and that assertion are required: endpoint, address and establishment facts are what an INVOICE needs, and finalize refuses `party_incomplete` for the ones it lacks. A new party is at seq 1 with its first revision; its facts are edited by `updateParty`.

Operation ID: `createParty`

### Parameters

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

### Request body

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

### Responses

#### 200 Duplicate-ok: this id, or this VAT number, already named a party here — returned unchanged.

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

#### 201 A new party.

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

#### 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"
    }
  }
}
```
