Skip to content

Commit 9da2c08

Browse files
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

mintlify/api-reference/sandbox-testing.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import SandboxBeneficiaryVerification from '/snippets/sandbox-beneficiary-verifi
1010
import SandboxTransferPatterns from '/snippets/sandbox-transfer-patterns.mdx';
1111
import SandboxQuotePatterns from '/snippets/sandbox-quote-patterns.mdx';
1212
import SandboxUmaAddresses from '/snippets/sandbox-uma-addresses.mdx';
13-
import SandboxKybVerification from '/snippets/sandbox-kyb-verification.mdx';
13+
import SandboxVerification from '/snippets/sandbox-verification.mdx';
1414
import SandboxGlobalAccountMagic from '/snippets/sandbox-global-account-magic.mdx';
1515

1616
The Grid sandbox environment simulates real payment flows without moving real money. You can control test outcomes using special account number patterns and test addresses.
1717

1818
## KYC/KYB verification
1919

20-
<SandboxKybVerification />
20+
<SandboxVerification />
2121

2222
## Adding external accounts
2323

mintlify/openapi.yaml

Lines changed: 221 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mintlify/snippets/sandbox-kyb-verification.mdx

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)