> 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/term-deposit/main-1.md).

# Retrieve Term Deposit Account Details

| Campo          | Valor                         |
| -------------- | ----------------------------- |
| Service Domain | Term Deposit                  |
| BIAN Version   | 14.0.0                        |
| Operation      | Retrieve Term Deposit Account |
| Method         | GET                           |
| API Name       | Term Deposit Management API   |
| Versão         | v1.0.0                        |

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

O serviço de Consulta de Detalhes de uma Conta de Depósito a Prazo permite obter informação detalhada sobre uma conta de depósito a prazo específica de um cliente ou entidade. A operação retorna os dados de identificação do acordo, o estado do acordo, o titular associado, a agência, o montante do depósito, o período de vigência (abertura/maturidade), o prazo e as condições de juro, a conta de liquidação de juros associada (linked account) e o saldo inicial da conta.

| Campo        | Valor                                      |
| ------------ | ------------------------------------------ |
| API Name     | Term Deposit Management API                |
| Versão       | v1.0.0                                     |
| Endpoint     | GET /term-deposit/{termDepositId}/retrieve |
| Autenticação | Bearer Token (OAuth 2.0 / OIDC)            |

## 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-channel                      | Recomendado | Canal de origem (SOP, MOBILE, BACKOFFICE, …) |

## 3. Parâmetros

### 3.1 Path Parameters

| Parâmetro     | Tipo   | Obrigatório | Descrição                                                    |
| ------------- | ------ | ----------- | ------------------------------------------------------------ |
| termDepositId | string | Sim         | Identificador único da conta de depósito a prazo (Conta DP). |

### 3.2 Query Parameters

*Não aplicável - esta operação não recebe parâmetros de query.*

## 4. Payload de Resposta (Response - 200 OK)

### 4.1 Exemplo

```json
{
  "termDepositFulfillmentArrangement": {
    "accountDetails": {
      "accountType": "TermDepositAccount",
      "accountName": {
        "name": "ANGELO ADAO UPALE MACUIA RODRIGUES"
      },
      "accountBalance": {
        "balanceAmount": {
          "amountValue": 0.00,
          "amountCurrency": {
            "currencyCode": "AKZ"
          },
          "amountType": "InitialAmount"
        }
      }
    },
    "productAgreementIdentification": {
      "identifierValue": "TD001",
      "productAgreementDescription": "productCode"
    },
    "componentAgreementIdentification": {
      "identifierValue": "COM001",
      "componentAgreementDescription": "componentCode"
    },
    "agreementDescription": "DP BCI BASE",
    "agreementStatus": {
      "statusCode": "E",
      "statusReason": "Encerrada",
      "statusDate": {
        "dateContent": "2026-06-11",
        "dateType": "EffectiveDate"
      }
    },
    "bankBranchLocationReference": {
      "branchIdentification": {
        "identifierValue": "801"
      }
    },
    "termDepositAmount": {
      "amountValue": 100000.00,
      "amountCurrency": {
        "currencyCode": "AKZ"
      },
      "amountType": "Principal"
    },
    "termDepositPeriod": {
      "fromDate": {
        "dateContent": "2021-09-01",
        "dateType": "OpeningDate"
      },
      "toDate": {
        "dateContent": "2026-07-01",
        "dateType": "MaturityDate"
      }
    },
    "entitlementOptionDefinition": {
      "depositTerm": {
        "depositTermValue": 91,
        "depositTermValueDescription": "NumberOfDays"
      },
      "depositInterest": {
        "interestRate": {
          "rateValue": 10.0
        },
        "interestPeriod": {
          "fromDate": {
            "dateContent": "2026-06-02",
            "dateType": "EffectiveDate"
          },
          "toDate": {
            "dateContent": "2026-09-01",
            "dateType": "MaturityDate"
          }
        },
        "interestSchedule": {
          "scheduleCode": "M",
          "scheduleValue": "Mensal"
        }
      }
    },
    "linkedAccount": {
      "accountIdentification": {
        "accountIdentificationType": "BBAN",
        "accountIdentification": {
          "identifierValue": "2711324710001"
        }
      },
      "accountType": "CurrentAccount",
      "accountPurpose": "InterestSettlement"
    }
  }
}
```

### 4.2 Campos da Resposta

| Campo                                                                                                             | Tipo              | Descrição                                                                                               |
| ----------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------- |
| termDepositFulfillmentArrangement                                                                                 | object            | Objecto com os detalhes da conta de depósito a prazo consultada.                                        |
| termDepositFulfillmentArrangement.accountDetails.accountType                                                      | string            | Tipo de conta (ex: `TermDepositAccount`).                                                               |
| termDepositFulfillmentArrangement.accountDetails.accountName.name                                                 | string            | Nome do titular associado à conta.                                                                      |
| termDepositFulfillmentArrangement.accountDetails.accountBalance.balanceAmount.amountValue                         | number            | Valor do montante inicialmente depositado na conta, na abertura do DP.                                  |
| termDepositFulfillmentArrangement.accountDetails.accountBalance.balanceAmount.amountCurrency.currencyCode         | string            | Código da moeda do montante (ISO 4217, ex: `AKZ`).                                                      |
| termDepositFulfillmentArrangement.accountDetails.accountBalance.balanceAmount.amountType                          | string            | Tipo de montante (`InitialAmount`).                                                                     |
| termDepositFulfillmentArrangement.productAgreementIdentification.identifierValue                                  | string            | Código do produto associado ao acordo.                                                                  |
| termDepositFulfillmentArrangement.productAgreementIdentification.productAgreementDescription                      | string            | Descrição/rótulo do código do produto.                                                                  |
| termDepositFulfillmentArrangement.componentAgreementIdentification.identifierValue                                | string            | Código do componente associado ao acordo.                                                               |
| termDepositFulfillmentArrangement.componentAgreementIdentification.componentAgreementDescription                  | string            | Descrição/rótulo do código do componente.                                                               |
| termDepositFulfillmentArrangement.agreementDescription                                                            | string            | Descrição comercial do acordo/produto (ex: `DP BCI BASE`).                                              |
| termDepositFulfillmentArrangement.agreementStatus.statusCode                                                      | string            | Código do estado do acordo (ex: `E`).                                                                   |
| termDepositFulfillmentArrangement.agreementStatus.statusReason                                                    | string            | Descrição do estado do acordo (ex: `Encerrada`).                                                        |
| termDepositFulfillmentArrangement.agreementStatus.statusDate.dateContent                                          | string (ISO 8601) | Data da última alteração de estado (data situação).                                                     |
| termDepositFulfillmentArrangement.agreementStatus.statusDate.dateType                                             | string            | Tipo de data (`EffectiveDate`).                                                                         |
| termDepositFulfillmentArrangement.bankBranchLocationReference.branchIdentification.identifierValue                | string            | Identificador da agência/balcão onde a conta foi aberta.                                                |
| termDepositFulfillmentArrangement.termDepositAmount.amountValue                                                   | number            | Montante actualmente depositado na conta (Principal — quanto dinheiro está fisicamente na conta agora). |
| termDepositFulfillmentArrangement.termDepositAmount.amountCurrency.currencyCode                                   | string            | Código da moeda do montante depositado (ISO 4217, ex: `AKZ`).                                           |
| termDepositFulfillmentArrangement.termDepositAmount.amountType                                                    | string            | Tipo de montante (`Principal`).                                                                         |
| termDepositFulfillmentArrangement.termDepositPeriod.fromDate.dateContent                                          | string (ISO 8601) | Data de abertura do depósito a prazo.                                                                   |
| termDepositFulfillmentArrangement.termDepositPeriod.fromDate.dateType                                             | string            | Tipo de data (`OpeningDate`).                                                                           |
| termDepositFulfillmentArrangement.termDepositPeriod.toDate.dateContent                                            | string (ISO 8601) | Data de maturidade (vencimento) do depósito a prazo.                                                    |
| termDepositFulfillmentArrangement.termDepositPeriod.toDate.dateType                                               | string            | Tipo de data (`MaturityDate`).                                                                          |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositTerm.depositTermValue                        | integer           | Valor numérico do prazo do depósito.                                                                    |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositTerm.depositTermValueDescription             | string            | Unidade do prazo do depósito (ex: `NumberOfDays`).                                                      |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestRate.rateValue              | number            | Taxa de juro aplicada ao depósito (%).                                                                  |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestPeriod.fromDate.dateContent | string (ISO 8601) | Data de início do período de contagem de juro em vigor.                                                 |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestPeriod.fromDate.dateType    | string            | Tipo de data (`EffectiveDate`).                                                                         |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestPeriod.toDate.dateContent   | string (ISO 8601) | Data de fim do período de contagem de juro em vigor.                                                    |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestPeriod.toDate.dateType      | string            | Tipo de data (`MaturityDate`).                                                                          |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestSchedule.scheduleCode       | string            | Código da periodicidade de pagamento/capitalização de juros (ex: `M`).                                  |
| termDepositFulfillmentArrangement.entitlementOptionDefinition.depositInterest.interestSchedule.scheduleValue      | string            | Descrição da periodicidade (ex: `Mensal`).                                                              |
| termDepositFulfillmentArrangement.linkedAccount.accountIdentification.accountIdentificationType                   | string            | Tipo de identificação da conta associada (ex: `BBAN`).                                                  |
| termDepositFulfillmentArrangement.linkedAccount.accountIdentification.accountIdentification.identifierValue       | string            | Número da conta associada.                                                                              |
| termDepositFulfillmentArrangement.linkedAccount.accountType                                                       | string            | Tipo da conta associada (ex: `CurrentAccount`).                                                         |
| termDepositFulfillmentArrangement.linkedAccount.accountPurpose                                                    | string            | Finalidade da conta associada (ex: `InterestSettlement` — liquidação de juros).                         |

## 5. Códigos HTTP de Resposta

| Código | Estado                | Descrição                                                          |
| ------ | --------------------- | ------------------------------------------------------------------ |
| 200    | OK                    | Consulta executada com sucesso.                                    |
| 400    | Bad Request           | Parâmetros inválidos ou em falta (ex: termDepositId não indicado). |
| 401    | Unauthorized          | Token ausente, expirado ou inválido.                               |
| 404    | Not Found             | Rota não encontrada.                                               |
| 500    | Internal Server Error | Erro inesperado no sistema.                                        |
| 502    | Bad Gateway           | Resposta inválida ou indisponibilidade do serviço.                 |
| 504    | Gateway Timeout       | Timeout na chamada do serviço.                                     |

## 6. Envelope Padrão de Erro

```json
{
  "status": 404,
  "reason": "RESOURCE_NOT_FOUND",
  "message": "Não foi encontrada nenhuma conta de depósito a prazo para o identificador indicado.",
  "path": "/term-deposit/901966920/retrieve",
  "errors": [
    {
      "code": "TD-404-001",
      "reason": "TERM_DEPOSIT_NOT_FOUND",
      "message": "termDepositId '901966920' não encontrado."
    }
  ]
}
```

### 6.1 Estrutura do Envelope de Erro

| Campo             | Tipo    | Descrição                                                               |
| ----------------- | ------- | ----------------------------------------------------------------------- |
| status            | integer | Código HTTP do erro.                                                    |
| reason            | string  | Código textual de alto nível que identifica a categoria do erro.        |
| message           | string  | Mensagem legível que descreve o problema ocorrido.                      |
| path              | string  | Caminho do endpoint que originou o erro.                                |
| errors\[]         | array   | Lista de erros detalhados. Pode estar ausente em erros genéricos (500). |
| errors\[].code    | string  | Código específico do domínio (ex: TD-404-001).                          |
| errors\[].reason  | string  | Identificador textual da causa específica do erro.                      |
| errors\[].message | string  | Mensagem detalhada com valores concretos quando aplicável.              |

## 7. Regras de Negócio

| # | Regra                            | Detalhe                                                                                                                                                                                                                                                         |
| - | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | Conta Válida                     | O termDepositId deve corresponder a uma conta de depósito a prazo existente no sistema (activa ou encerrada).                                                                                                                                                   |
| 2 | Contas Encerradas                | A operação devolve também contas com estado `Encerrada` (ex: `statusCode = "E"`), permitindo consultar o histórico da conta.                                                                                                                                    |
| 3 | Conta de Liquidação              | Quando existente, a `linkedAccount` identifica a conta à ordem para onde os juros do depósito são liquidados (`accountPurpose = InterestSettlement`).                                                                                                           |
| 4 | Saldo Inicial vs Montante Actual | `accountDetails.accountBalance` reflecte o montante inicialmente depositado na abertura do DP (`amountType = InitialAmount`), enquanto `termDepositAmount` reflecte o montante actualmente na conta (`amountType = Principal`); os dois valores podem divergir. |

## 8. Requisitos Não-Funcionais

| Requisito    | Detalhe                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| HTTPS / TLS  | Obrigatório TLS 1.2 ou superior em todas as comunicações.                                                |
| Bearer Token | Obrigatório — scope term-deposit:account:retrieve. Pedidos sem token ou com token inválido retornam 401. |
| Auditoria    | Registo persistente obrigatório de todas as consultas (log estruturado).                                 |


---

# 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 dynamically 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/term-deposit/main-1.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 `build a script that syncs our docs to a CMS` 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.
