API Docs Início Documentação Referência de API Copiar para LLM
POST/v1/BankAccount/{id}/Pix/Key
Banking · Chaves PIX

Incluir Chave PIX

Cria um novo registro de Bank Account.

Visão geral

Incluir Chave PIX

Autenticação e pré-requisitos

Requer autenticação. Envie o token no header Authorization: Bearer {{token}} (JWT do AWS Cognito). Integrações servidor-a-servidor podem usar X-Api-Key. Todo tráfego é HTTPS e a credencial nunca vai na URL nem em query string.

Pré-requisitos: a rota exige identificador(es) de recurso já existente(s):

Request

Parâmetros

NomeEmTipoObrigatórioDescriçãoExemplo
idpathstringobrigatórioId da conta bancária3fa85f64-5717-4562-b3fc-2c963f66afa6

Corpo da requisição

Envie no formato application/json. Corpo obrigatório.

Campos

CampoTipoObrigatórioDescriçãoValoresExemplo
typestringopcionalNaturalRegistrationNumber, LegalRegistrationNumber, Phone, Email, Automatic"NaturalRegistrationNumber"
pixKeystringopcional"texto"
descriptionTypestringopcional"texto"
formattedKeystringopcional"texto"

Exemplo de corpo

{
  "type": "NaturalRegistrationNumber",
  "pixKey": "texto",
  "descriptionType": "texto",
  "formattedKey": "texto"
}

Response

Resposta 200.

Campos

CampoTipoObrigatórioDescriçãoValoresExemplo
typestringopcionalNaturalRegistrationNumber, LegalRegistrationNumber, Phone, Email, Automatic, AgencyAndAccount"NaturalRegistrationNumber"
typeDisplaystringopcional"texto"
pixKeystringopcional"texto"

Exemplo de resposta

{
  "type": "NaturalRegistrationNumber",
  "typeDisplay": "texto",
  "pixKey": "texto"
}

Códigos de retorno

CódigoSignificadoDetalhe do contrato
200Requisição bem-sucedida.

Exemplos

curl -X POST "{{baseUrl}}/v1/BankAccount/3fa85f64-5717-4562-b3fc-2c963f66afa6/Pix/Key" \
  -H "Authorization: Bearer {{token}}" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "NaturalRegistrationNumber",
  "pixKey": "texto",
  "descriptionType": "texto",
  "formattedKey": "texto"
}'
var baseUrl = "{{baseUrl}}";
var token   = "{{token}}";

using var http = new HttpClient { BaseAddress = new Uri(baseUrl) };
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var rota = "/v1/BankAccount/3fa85f64-5717-4562-b3fc-2c963f66afa6/Pix/Key";

var corpo = new StringContent(
    """
    {
      "type": "NaturalRegistrationNumber",
      "pixKey": "texto",
      "descriptionType": "texto",
      "formattedKey": "texto"
    }
    """,
    Encoding.UTF8, "application/json");

var resp = await http.PostAsync(rota, corpo);
resp.EnsureSuccessStatusCode();
var json = await resp.Content.ReadAsStringAsync();
const baseUrl = '{{baseUrl}}';
const token   = '{{token}}';

const payload = {
  "type": "NaturalRegistrationNumber",
  "pixKey": "texto",
  "descriptionType": "texto",
  "formattedKey": "texto"
};

const resp = await fetch(`${baseUrl}/v1/BankAccount/3fa85f64-5717-4562-b3fc-2c963f66afa6/Pix/Key`, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(payload),
});

if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();

Troque apenas {{baseUrl}} e {{token}}. No Postman, defina-os como variáveis de environment; o cURL importa em Import > Raw text.

Downloads

Este endpoint já vem configurado nas collections abaixo, na pasta da etapa correspondente.

Guia de importação: Como importar no Postman · Todos os downloads: Downloads