# User Tax Identifiers

## The GovernmentIdentifier object

An identifier a government issued to a user, such as their tax identifier. Government identifiers are only available in select projects.

<!-- theme: info -->
> #### Preview
>
> This schema is currently in preview and might change in the future.
>
> We’re excited to hear your feedback and ideas. Please send an email
> to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `governmentIdentifier`. |
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Only present when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

---

## Retrieve a user's tax identifier

`GET /projects/{project}/users/{user}/taxIdentifier`

Retrieves the tax identifier of the given user. Responds with a 404 error when the
user has no tax identifier.

Tax identifiers are only available in select projects.

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |
| `user` | string | Yes | The unique identifier for the user. |

### Responses

#### 200 — Returns the user's tax identifier.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `governmentIdentifier`. |
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Only present when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

#### 404 — The requested resource doesn't exist.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---

## Create or replace a user's tax identifier

`PUT /projects/{project}/users/{user}/taxIdentifier`

Sets the tax identifier of the given user. A user has one tax identifier at a time,
so this replaces the one they have and responds with a 200. If they have none, it
creates one and responds with a 201. If the new one is invalid, the user keeps their
current one.

Tax identifiers are only available in select projects.

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Required when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |
| `user` | string | Yes | The unique identifier for the user. |

### Responses

#### 200 — Returns the user's tax identifier, when they already had one.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `governmentIdentifier`. |
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Only present when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

#### 201 — Returns the user's new tax identifier, when they had none before.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `governmentIdentifier`. |
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Only present when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

#### 404 — The requested resource doesn't exist.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 422 — The request can't be processed, for example because the tax identifier isn't valid.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---

## Delete a user's tax identifier

`DELETE /projects/{project}/users/{user}/taxIdentifier`

Deletes the tax identifier of the given user. The user has none until a new one is
set. Responds with a 404 error when the user has no tax identifier.

Tax identifiers are only available in select projects.

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |
| `user` | string | Yes | The unique identifier for the user. |

### Responses

#### 200 — Returns the tax identifier after a successful deletion.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `governmentIdentifier`. |
| `brCpf` | mixed | No | Fields of a government identifier with the `brCpf` type. Only present when `type` is `brCpf`. |
| `type` | brCpf | Yes | The type of the government identifier. The object with the same name holds the fields of that type. |

#### 404 — The requested resource doesn't exist.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 422 — The request can't be processed, often due to an invalid parameter or incompatible system state.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---
