SonaCORE

Referência / Quadra Core API

External Accounts

3 operações em Quadra Core API 0.5.0.

GET/v1/external-accounts

List External Accounts

List EXTERNAL accounts in the caller's tenant (RFC-021 §3.2).

Cursor-paginated and scoped to the calling tenant. **Page until `next_cursor` is null** — a short page is not the end of the list.

Parâmetros

NomeTipoDetalhe
cursorstring, opcionalquery Opaque pagination cursor
limitintegerquery Max items per page

Respostas

StatusCorpoDetalhe
200Resposta bem-sucedidaO contrato não declara um modelo para esta resposta, então a forma dela não está documentada aqui. Um roteiro de demonstração mostra a forma que ela realmente devolve.
422HTTPValidationErrorErro de validação
POST/v1/external-accounts

Create an External Account

Create a non-custodial EXTERNAL account (RFC-021).

Registers an external counterparty (PIX key or phone) as a first-class, deduplicated, non-custodial account row. No Cardano address is derived and no datum file is written — the account cannot hold value, only be named.

Re-posting the same `(scheme, normalized_identifier)` within the same tenant returns the existing `account_id` with `200`. Reusing the same `Idempotency-Key` with a different body returns `409`.

Returns: 201 Created on first registration; 200 OK on identity-dedup hit.

Raises: 400: identifier could not be normalized for the given scheme 409: Idempotency-Key reused with a different request body 500: Internal error during account creation

Parâmetros

NomeTipoDetalhe
Idempotency-Keystringheaderobrigatório

Corpo da requisição

ExternalAccountCreateRequest — obrigatório. Os campos estão listados em Esquemas, abaixo.

Respostas

StatusCorpoDetalhe
201ExternalAccountResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/external-accounts/{account_id}

Get an External Account

Get a single EXTERNAL account by id (RFC-021 §3.2).

Returns 404 if no row exists for the id, or if the id refers to an account that is not of type EXTERNAL (e.g. a CUSTOMER or GL account). This prevents non-external account ids from leaking through this endpoint.

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório

Respostas

StatusCorpoDetalhe
200ExternalAccountResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação

Esquemas

Os modelos que as operações acima aceitam e devolvem. Campos opcionais estão marcados como tal; um campo tipado como outro modelo está documentado sob o nome dele.

AccountStatus

Account lifecycle status.

Um de: ACTIVE, CLOSED

ExternalAccountCreateRequest

Request body for creating an external (non-custodial) account.

CampoTipoDetalhe
display_namestringobrigatórioHuman-readable display name for this counterparty
identifierstringobrigatórioRaw identifier (server normalizes per scheme)
schemeExternalIdentitySchemeobrigatórioIdentifier scheme: PIX_KEY or PHONE

ExternalAccountResponse

Response model for external account creation and detail endpoints.

CampoTipoDetalhe
account_idstringobrigatórioUnique account identifier (acc_...)
created_atstringobrigatórioISO 8601 timestamp of creation
external_identityExternalIdentityobrigatórioNormalized identity of the external counterparty
is_frozenbooleanWhether the account is frozenPadrão false
promoted_to_account_idstring, opcionalIf this external account was promoted to a CUSTOMER account, the new account_id (RFC-021 §5). Null otherwise.
statusAccountStatusobrigatórioAccount lifecycle status
typestringAlways EXTERNALPadrão "EXTERNAL"
updated_atstringobrigatórioISO 8601 timestamp of last update

ExternalIdentity

Identity of an external (non-custodial) counterparty. The `identifier` in this model is the *normalized* form (E.164 phones, digits-only CPF/CNPJ, lowercased EVP/email) — never the raw user input.

CampoTipoDetalhe
display_namestringobrigatórioHuman-readable display name
identifierstringobrigatórioNormalized identifier
pix_subtype"EMAIL" | "CPF" | "CNPJ" | "EVP" | "PHONE", opcionalDetected PIX sub-type (EMAIL/CPF/CNPJ/EVP/PHONE); None for non-PIX schemes
schemeExternalIdentitySchemeobrigatórioIdentifier scheme

ExternalIdentityScheme

Scheme that an external counterparty identifier belongs to.

Um de: PIX_KEY, PHONE

HTTPValidationError

CampoTipoDetalhe
detailarray de ValidationError

ValidationError

CampoTipoDetalhe
ctxobject
inputnão declarado
locarray de string ou integerobrigatório
msgstringobrigatório
typestringobrigatório