Skip to content

docs: enrich fx-account API reference with per-endpoint error examples#5

Merged
marioalvial merged 2 commits intomainfrom
docs/fx-account-error-examples-and-cleanup
Apr 15, 2026
Merged

docs: enrich fx-account API reference with per-endpoint error examples#5
marioalvial merged 2 commits intomainfrom
docs/fx-account-error-examples-and-cleanup

Conversation

@marioalvial
Copy link
Copy Markdown
Contributor

Summary

Per-endpoint error examples for the fx-account API reference, plus cleanup found along the way.

API Reference (main change)

Enriches apis/fx-account/openapi.yml with specific error examples per endpoint, rendered in Mintlify as a dropdown selector. Mapped from actual exceptions in fx-account/core:

Endpoint Errors documented New status code
POST /accounts INVALID_TAX_ID, UNSUPPORTED_ASSET, INVALID_DATA, UBOS_NOT_ALLOWED_FOR_INDIVIDUAL
GET /accounts/{id} INVALID_UUID, RESOURCE_NOT_FOUND
POST /accounts/{id}/review MISSING_DOCUMENTS_FOR_REVIEW (×2), NO_PROVIDER_ACCOUNT_REQUIRES_ANALYSIS
GET /fundingInstructions INVALID_UUID, RESOURCE_NOT_FOUND
POST /documents EMPTY_FILE, MISSING_MULTIPART_FIELD, INVALID_UUID, RESOURCE_NOT_FOUND
POST /ubos INVALID_TAX_ID, INVALID_DATA, DUPLICATE_UBO, UBOS_NOT_ALLOWED_FOR_INDIVIDUAL, ACCOUNT_NOT_MODIFIABLE, INSUFFICIENT_OWNERSHIP 409
GET /ubos UBOS_NOT_ALLOWED_FOR_INDIVIDUAL 422
GET /ubos/{uboId} RESOURCE_NOT_FOUND (×2), UBOS_NOT_ALLOWED_FOR_INDIVIDUAL 422
PATCH /ubos/{uboId} INVALID_TAX_ID, RESOURCE_NOT_FOUND (×2), plus 4× 422 variants
DELETE /ubos/{uboId} RESOURCE_NOT_FOUND (×2), UBOS_NOT_ALLOWED_FOR_INDIVIDUAL, ACCOUNT_NOT_MODIFIABLE, APPROVED_UBO 422
POST /ubos/{uboId}/documents EMPTY_FILE, MISSING_MULTIPART_FIELD, INVALID_UUID, RESOURCE_NOT_FOUND (×2)

Journey consolidation

  • Merge open-brl-account + open-crypto-account → single open-multi-currency-account journey. Accounts are multi-currency (one account, many assets) so the split was misleading.
  • Fix the create-account payload to match the real OpenAPI contract (nested owner with type discriminator, assets: [{code, isVirtual}]).
  • Update inbound links in the other journey pages and quickstart.

Config cleanup

  • Remove the <SandboxNote /> callout from all journey pages (low-signal; {{sandboxUrl}} in curl examples is already obvious).
  • Delete snippets/sandbox-note.mdx.
  • Remove logo.href from docs.json so the logo links to the docs root instead of a dead URL.
  • Update CLAUDE.md snippet list.

Dependency

Draft pending tracefinance/fx-account#84, which renames UBOsNotAllowedForIndividualExceptionUbosNotAllowedForIndividualException so the derived HTTP error code becomes UBOS_NOT_ALLOWED_FOR_INDIVIDUAL (what this PR documents) instead of the current U_B_OS_NOT_ALLOWED_FOR_INDIVIDUAL. Flip this PR to Ready after fx-account#84 is merged.

Test plan

  • yaml.safe_load on the OpenAPI succeeds — 8 paths, all intact
  • Redocly lint adds no new errors (14 pre-existing nullable issues unrelated)
  • mint dev smoke test — confirm dropdown examples render
  • mint broken-links — confirm the journey link renames didn't break anything

Out of scope (follow-ups)

  • 502 Bad Gateway responses for endpoints that call external providers (submitForReview, document uploads). Exceptions exist but aren't declared in the OpenAPI today.
  • 400 on listAccounts for filter parsing errors (same reason).
  • fx-payment OpenAPI — identical exercise, separate pass.
  • Clean up pre-existing nullable: true schema entries (OpenAPI 3.1 compliance).

Adds specific error examples to each of the 12 fx-account endpoints
using OpenAPI 3.0 plural `examples:` (Mintlify renders as a dropdown).
Promotes four previously implicit error cases to explicit status codes
(addUbo 409, listUbos / getUbo / removeUbo 422).

Also consolidates docs structure:
- Merge "Open a BRL account" + "Open a crypto account" into a single
  "Open a multi-currency account" journey. Accounts are multi-currency
  (one account, multiple assets) so the split was misleading.
- Replace stale create-account payload with the real OpenAPI contract
  (assets: [{code, isVirtual}], owner discriminator).
- Remove the low-signal sandbox-note callout from all journey pages.
- Link the navbar logo to the docs root instead of a dead URL.

Depends on tracefinance/fx-account#84 for the
`UBOS_NOT_ALLOWED_FOR_INDIVIDUAL` error code. Hold merge until that
lands; otherwise docs will show `UBOS_` while the live API still
emits `U_B_OS_`.
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 15, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
tracefinance 🟢 Ready View Preview Apr 15, 2026, 2:46 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@marioalvial marioalvial marked this pull request as ready for review April 15, 2026 14:53
Replaces two dead card links (open-brl-account, open-crypto-account,
both removed in this PR) with a single card pointing at the new
open-multi-currency-account journey — matching the link rename already
applied to quickstart and the other journey pages.

Unblocks the Mintlify build validation and link-rot checks.
@marioalvial marioalvial merged commit 54f031a into main Apr 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant