Commit 9da2c08
authored
Grid Programmatic KYC API (#726)
## Summary
**Phase 1 grid-api slice** of the KYC singleton flow — OpenAPI schema additions, the new EDD endpoint, and Mintlify sandbox docs.
## OpenAPI schemas
- `taxIdentification` added to `IndividualCustomerFields.yaml` as a single optional object referencing the existing `IdentificationType` enum (`SSN` | `ITIN` | `EIN` | `NON_US_TAX_ID`).
- New `TaxIdentification.yaml` (idType, identifier, countryOfIssuance).
- New shared `FieldConstraint.yaml` under `errors/` — regex / format / enum / min-max length. `Error400.yaml`'s `details` description documents the convention: on submit-endpoint validation failures, `details.constraint` conforms to `FieldConstraint`, giving platforms a machine-readable validator hint they can use to pre-validate their onboarding form before re-submitting. Applies to `POST /customers`, `PATCH /customers/{id}`, `POST /customers/edd`, `PATCH /customers/edd`.
- New enum schemas: `IndividualSourceOfFundsCategory` (11 individual-appropriate values), `SourceOfWealthCategory`, `AnnualIncomeRange`, `NetWorthRange`, `PepStatus`, `ExpectedMonthlyTransactionCount`, `ExpectedMonthlyTransactionVolume`. `IndividualSourceOfFundsCategory` sits alongside the existing (business) `SourceOfFundsCategory`, keeping the business flow's enum untouched. `ExpectedMonthlyTransactionCount`/`Volume` are extracted from previously-inline definitions in `BusinessInfo.yaml` and shared with the new EDD schema.
## New EDD endpoint
Flat linked-resource pattern per `openapi/README.md` — customerId in the request body on `POST`, as a query param on `GET`/`PATCH`.
- `POST /customers/edd` — create or replace a customer's enhanced-due-diligence fields (200, upsert semantics).
- `GET /customers/edd?customerId={id}` — retrieve (404 if none recorded).
- `PATCH /customers/edd?customerId={id}` — partial update.
- `CustomerEddCreateRequest.yaml` — POST body: `customerId` + 8 optional EDD fields.
- `CustomerEdd.yaml` — response and PATCH body: 8 optional fields (`sourceOfFundsCategories`, `sourceOfWealthCategories`, `purposeOfAccount`, `expectedMonthlyTransactionCount`, `expectedMonthlyTransactionVolume`, `annualIncomeRange`, `netWorthRange`, `pepStatus`).
- Registered in `openapi/openapi.yaml`.
## Sandbox docs
- `mintlify/snippets/sandbox-verification.mdx` — combined snippet covering all three verification types (business KYB, beneficial-owner KYC, individual-customer KYC).
- Individual KYC outcome table: `fullName` suffix `001` → PENDING, `002` → REJECTED, `003` → APPROVED with EDD-required flow, else APPROVED.
- Full curl example: create individual customer → verify (returns `VerificationError` with `EDD_INFORMATION_MISSING`) → `POST /customers/edd` → retry verification → APPROVED.
- Import in `mintlify/api-reference/sandbox-testing.mdx` points at the renamed snippet.
## Verification
- `make build` succeeds — bundled `openapi.yaml` and `mintlify/openapi.yaml` regenerated.
- `make lint` passes (exit 0; 14 pre-existing warnings, no new errors introduced by this diff).
## Scope
grid-api (OpenAPI spec + Mintlify docs) only. Sparkcore persistence, sandbox switch wiring, and Sumsub integration ship on [webdev#31010](lightsparkdev/webdev#31010) (plan up for approval). OFAC / LexisNexis handling is a separate workstream.
Reply with a comment (e.g. LGTM) to approve — emoji reactions don't notify me here.1 parent 45d45b9 commit 9da2c08
16 files changed
Lines changed: 744 additions & 147 deletions
File tree
- mintlify
- api-reference
- snippets
- openapi/components/schemas
- customers
- errors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
0 commit comments