Onboarding Foreign API Spc » History » Version 1
Ryan Supawarapong, 03/02/2026 02:48 AM
| 1 | 1 | Ryan Supawarapong | # Onboarding Foreign API Spc |
|---|---|---|---|
| 2 | |||
| 3 | ### API Spec (from unit test example) |
||
| 4 | |||
| 5 | | Item | Spec | |
||
| 6 | |---|---| |
||
| 7 | | Endpoint | `POST /api/v1/foreign/individual/ico/precreate` | |
||
| 8 | | Description | Create pre-registration info for foreign individual onboarding | |
||
| 9 | | Content-Type | `application/json` | |
||
| 10 | | Response Content-Type | `application/json` | |
||
| 11 | | Success Status | `200 OK` | |
||
| 12 | | Error Status | `400 Bad Request`, `500 Internal Server Error` | |
||
| 13 | | Response Header | `X-Request-ID: <uuid>` | |
||
| 14 | | Response Envelope | `{ "status": "success\|error", "data": {...}, "message": "...", "xid": "..." }` | |
||
| 15 | |||
| 16 | ### Request Body |
||
| 17 | |||
| 18 | | Field | Type | Required | Format/Validation | Example | |
||
| 19 | |---|---:|:---:|---|---| |
||
| 20 | | `title` | string | ✅ | non-empty | `Mr.` | |
||
| 21 | | `name` | string | ✅ | non-empty | `John` | |
||
| 22 | | `surname` | string | ✅ | non-empty | `Doe` | |
||
| 23 | | `email` | string | ✅ | valid email | `john@doe.com` | |
||
| 24 | | `mobile` | string | ✅ | non-empty | `0987654321` | |
||
| 25 | | `birthDate` | string | ✅ | RFC3339 date-time | `1990-01-01T00:00:00Z` | |
||
| 26 | | `marriageStatus` | string | ✅ | non-empty | `Single` | |
||
| 27 | | `nationality` | string | ✅ | non-empty | `USA` | |
||
| 28 | | `passportNumber` | string | ✅ | non-empty | `AC123435` | |
||
| 29 | | `expirationDate` | string | ✅ | RFC3339 date-time | `2030-01-01T00:00:00Z` | |
||
| 30 | | `agreement` | boolean | ✅ | must be present | `true` | |
||
| 31 | |||
| 32 | ### 200 Response (`status = success`) |
||
| 33 | |||
| 34 | | Scenario | `data` payload | |
||
| 35 | |---|---| |
||
| 36 | | New register | `{ "registerID": "registerId" }` | |
||
| 37 | | Already exists | `{ "alreadyExist": true }` | |
||
| 38 | |||
| 39 | ### Error Response |
||
| 40 | |||
| 41 | | HTTP Code | `status` | Body shape | |
||
| 42 | |---:|---|---| |
||
| 43 | | `400` | `error` | `{ "status":"error", "message":"<error>", "xid":"<uuid>" }` | |
||
| 44 | | `500` | `error` | `{ "status":"error", "message":"<error>", "xid":"<uuid>" }` | |