## Get a payer type

`GET /v1/person-types/:id`

Retrieves details of a payer type selected for an order or its properties.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Payer type ID. List: [`GET /v1/person-types`](/docs/entities/person-types/list) |
| `select` (query) | string | no | Comma-separated fields, for example `?select=id,name,active`. Field list: [`GET /v1/person-types/fields`](/docs/entities/person-types/fields). Only selected fields remain in `data` |

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | Payer type |
| `data.id` | number | Payer type ID, RO. List: [`GET /v1/person-types`](/docs/entities/person-types/list) |
| `data.name` | string | Name |
| `data.code` | string \| null | Unique code |
| `data.sort` | number | Sort order |
| `data.active` | boolean | Whether the type is active |
| `data.xmlId` | string \| null | External ID |
| `meta.warnings` | array | Warnings about unknown names in `select`, with `code`, `message`, and `field`. Only included when warnings exist |

## Response example

```json
{
  "success": true,
  "data": {
    "active": false,
    "code": "DOCS_PERSON_397F55D8FB1D",
    "id": 21,
    "name": "Documentation payer type",
    "sort": 900,
    "xmlId": "DOCS_PERSON_397F55D8FB1D"
  }
}
```

## Error response example

404 — the payer type was not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "person type is not exists"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | The `id` is not a non-negative integer |
| 404 | `ENTITY_NOT_FOUND` | No type exists with this `id`. Message: `person type is not exists` |
| 404 | `ENTITY_NOT_FOUND` | The request completed, but the response contains no object. Message: `personType <id> not found` |
| 403 | `SCOPE_DENIED` | The API key lacks the `sale` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | No Bitrix24 access tokens are configured |

For the full list of common API errors, see [Error codes](/docs/errors).

## See also

- [List payer types](/docs/entities/person-types/list)
- [Search payer types](/docs/entities/person-types/search)
- [Update a payer type](/docs/entities/person-types/update)
- [Payer type fields](/docs/entities/person-types/fields)
- [Payer types](/docs/entities/person-types)
