> For the complete documentation index, see [llms.txt](https://selenium-4.gitbook.io/nexus-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://selenium-4.gitbook.io/nexus-docs/docs/issued-device-administration/initiate-pin-assignment/main.md).

# Initiate PIN Assignment

| Campo              | Valor                                                                |
| ------------------ | -------------------------------------------------------------------- |
| **Service Domain** | Issued Device Administration                                         |
| **BIAN Version**   | 14.0.0                                                               |
| **Operation**      | Initiate                                                             |
| **Method**         | POST                                                                 |
| **API Name**       | Issued Device Administration                                         |
| **Versão**         | v1.0.0                                                               |
| **Endpoint**       | `POST /v1/issued-device-administration/password-assignment/initiate` |
| **Autenticação**   | Bearer Token (OAuth 2.0 / OIDC)                                      |

***

## 1. Descrição da Operação

Esta API inicia o processo de atribuição de senha/PIN para um dispositivo emitido, como um cartão de débito ou pré-pago.

O processo registra os dados do emissor, cliente, cartão e referências operacionais relacionadas à geração/distribuição do PIN.

O caso inicial suportado é atribuição de PIN (`CardPIN`).

***

## 2. Cabeçalhos HTTP

| Header                           | Obrigatório | Notas                                                   |
| -------------------------------- | ----------- | ------------------------------------------------------- |
| `Authorization: Bearer {token}`  | Sim         | OAuth2 / JWT — `client_credentials` para M2M            |
| `Content-Type: application/json` | Sim         |                                                         |
| `Accept: application/json`       | Sim         |                                                         |
| `x-request-id`                   | Recomendado | UUID v4 — identificador único do pedido para correlação |
| `x-channel`                      | Recomendado | Canal de origem (`SOP`, `MOBILE`, `BACKOFFICE`, …)      |

***

## 3. Payload de Pedido (Request)

### 3.1 Exemplo

```json
{
  "issuedDeviceAssignmentType": "CardPIN",
  "issuerIdentification": {
    "identifierValue": "EMIS"
  },
  "issuedDeviceIdentification": {
    "identifierValue": "123456789012",
    "identifierType": "PAN"
  },
  "customerIdentification": {
    "identifierValue": "1234567890"
  },
  "partyIdentification": {
    "identifierValue": "1234567890"
  },
  "issuedDeviceDisplayName": "John Doe",
  "issuedDeviceComponentClass": "XXX_XXX",
  "issuedDeviceComponentCode": "XXX_xXX",
  "issuedDeviceAssignmentPasswordPurpose": "PIN",
  "issuedDeviceAssignmentMessageCode": "EXXO",
  "issuedDeviceAssignmentPinBlok": "12345678",
  "passwordAssignmentIdentification": {
    "identifierValue": "1234567890",
    "identifierType": "PINMailer"
  }
}
```

### 3.2 Descrição dos Campos

| Campo                                              | Tipo   | Descrição                                                             | Obrigatório/Opcional |
| -------------------------------------------------- | ------ | --------------------------------------------------------------------- | -------------------- |
| `issuedDeviceAssignmentType`                       | String | Tipo de atribuição de senha/dispositivo. Exemplo: `CardPIN`           | Obrigatório          |
| `issuerIdentification`                             | Object | Identificação do emissor responsável pela operação                    | Obrigatório          |
| `issuerIdentification.identifierValue`             | String | Código identificador do emissor                                       | Obrigatório          |
| `issuedDeviceIdentification`                       | Object | Identificação do dispositivo emitido                                  | Obrigatório          |
| `issuedDeviceIdentification.identifierValue`       | String | Valor do identificador do dispositivo                                 | Obrigatório          |
| `issuedDeviceIdentification.identifierType`        | String | Tipo do identificador do dispositivo (`PAN`, `CardI, etc`)            | Obrigatório          |
| `issuedDeviceReference`                            | Object | Referência do dispositivo emitido                                     | Obrigatório          |
| `customerIdentification`                           | Object | Identificação do cliente associado ao dispositivo                     | Obrigatório          |
| `customerIdentification.identifierValue`           | String | Identificador do cliente                                              | Obrigatório          |
| `partyIdentification`                              | Object | Identificação da entidade associada ao dispositivo                    | Opcional             |
| `partyIdentification.identifierValue`              | String | Identificador da entidade                                             | Opcional             |
| `issuedDeviceDisplayName`                          | String | Nome apresentado ou gravado no dispositivo emitido                    | Obrigatório          |
| `issuedDeviceComponentClass`                       | String | Classe do componente do dispositivo emitido                           | Opcional             |
| `issuedDeviceComponentCode`                        | String | Código do componente do dispositivo emitido                           | Opcional             |
| `issuedDeviceAssignmentPasswordPurpose`            | String | Descrição da atribuição da senha.                                     | Obrigatório          |
| `issuedDeviceAssignmentMessageCode`                | String | Código de mensagem associado ao processo de atribuição                | Opcional             |
| `passwordAssignmentReference`                      | Object | Referências operacionais da atribuição de senha                       | Obrigatório          |
| `issuedDeviceAssignmentPinBlock`                   | String | PIN Block criptografado utilizado na atribuição                       | Opcional             |
| `passwordAssignmentIdentification`                 | Object | Identificação da atribuição da senha                                  | Obrigatório          |
| `passwordAssignmentIdentification.identifierValue` | String | Identificador do PIN mailer relacionado                               | Obrigatório          |
| `passwordAssignmentIdentification.identifierType`  | String | Tipo da identificação da atribuição. Inicialmente suporta `PinMailer` | Obrigatório          |

***

## 4. Payload de Resposta (Response — 204 No Content)

Sem conteúdo de resposta. Não aplicável.

***

## 5. Códigos HTTP de Resposta

| Código                      | Descrição                                 |
| --------------------------- | ----------------------------------------- |
| `204 No Content`            | Pedido processado com sucesso             |
| `400 Bad Request`           | Payload inválido                          |
| `401 Unauthorized`          | Token inválido ou ausente                 |
| `403 Forbidden`             | Operação não autorizada                   |
| `404 Not Found`             | Instância de administração não encontrada |
| `409 Conflict`              | Conflito de estado da atribuição          |
| `422 Unprocessable Entity`  | Violação de regra de negócio              |
| `500 Internal Server Error` | Erro interno                              |

***

## 6. Envelope Padrão de Erro

```json
{
  "error": {
    "status": 422,
    "reason": "BUSINESS_RULE_VIOLATION",
    "message": "Saldo insuficiente na conta de despesas para liquidar comissões.",
    "path": "POST /v1/merchandising-loan/CRDE-2025-000128/execute",
    "errordetail": [
      {
        "code": "ML-422-001",
        "reason": "INSUFFICIENT_FUNDS_EXPENSE_ACCOUNT",
        "message": "Conta 125818810007: saldo 850.00 USD < despesa 1250.75 USD."
      }
    ]
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://selenium-4.gitbook.io/nexus-docs/docs/issued-device-administration/initiate-pin-assignment/main.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
