API reference
Account Applications
Generated HTTP reference for the 1 operation the published OpenAPI document describes under account-applications.
3 min read
Account Applications
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
GET /v1/account-applications/{id}
Read the status of a consumer account application
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The provider's proposal id, returned by POST /v1/account-applications. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
consumer_id | string | no | A fallback only. The recorded proposal's own consumer id wins; this value is used when the recorded row carries none. Omitted, the proposal id stands in. |
document_number | string | yes | REQUIRED. The CPF or CNPJ the caller claims this application is about, checked against the document recorded for the proposal. Formatting is normalized before the comparison. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
400 | object | Bad Request — document_number was not supplied. A BARE error body, not the \{ error: \{ code, message \} \} envelope: this handler writes its failures inline and there is no request_id in the body. |
502 | object | Bad Gateway. The provider call failed — and ALSO where the typed ownership refusals land, because the handler's catch is blanket. message carries the underlying sentence and is the only thing that separates a provider outage from a refusal to bind a document the proposal did not verify. Bare body, no request_id. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
account | string,null | yes | The provisioned account number once one exists, else null. Stringified: the provider returns it as either a string or a number. The branch is resolved in the same fetch and is NOT returned by this operation; it is written into the funding source's metadata.branch. |
funding_source_id | string,null | yes | The pix-celcoin funding source, or null before one exists. Deterministic — fs_celcoin_ followed by the consumer id, one account per consumer — so a repeat call resolves the same row instead of opening a second one. |
hosted_url | string,null | yes | The documentoscopia webview the consumer opens, taken from the proposal's first documentscopys entry. Null on rejected and on approved. |
pix_key | string,null | yes | The DICT entry registered for the account, once registration has succeeded. Null before that. |
pix_key_registration_error | string | no | ABSENT from the body unless Pix-key registration failed for an account that is otherwise real and usable. Deliberately non-blocking and deliberately not swallowed: the account works, the wallet's own lazy registration retries the step the next time the consumer needs to receive, and the failure is surfaced here so a caller can log or alert on it. Its presence does not make the application unapproved. |
pix_key_type | string,null | yes | — |
status | "pending" | "documentscopy_pending" | "approved" | "rejected" | yes | FOUR values, and the exported CelcoinOnboardingStatus union has five. unknown is in the type and is not in this enum because resolveCelcoinOnboarding — the only producer this route has — never returns it: its four return statements carry rejected, documentscopy_pending, pending (twice) and approved. The only other "unknown" in that file is a conflict_case, which is a different field on a different shape. pending is also the answer when the proposal is past the known pending states but no account number could be parsed from the provider's fetch response. That case is logged with the raw body truncated, so a genuine not-minted-yet and a parse that is wrong look the same to the caller and different in the log. |
Example response
{
"status": "pending",
"pix_key_registration_error": "string"
}Example request
curl -X GET https://api.codespar.dev/v1/account-applications/{id} \
-H "Authorization: Bearer $CODESPAR_API_KEY"