Onboarding Foreign API Spc » History » Revision 2
Revision 1 (Ryan Supawarapong, 03/02/2026 02:48 AM) → Revision 2/12 (Ryan Supawarapong, 03/02/2026 02:49 AM)
# Onboarding Foreign API Spc ## Customer Precreate ### API Spec (from unit test example) | Type Item | Value Spec | |---|---| | API Path Endpoint | `/api/v1/foreign/individual/ico/precreate` `POST /api/v1/foreign/individual/ico/precreate` | | Request Type Description | `POST` Create pre-registration info for foreign individual onboarding | | Content-Type | `application/json` | | Authorization Response Content-Type | `Bearer ...` `application/json` | ### Request Body | Key Success Status | Type `200 OK` | Example | Required | |---|---|---|---| | title Error Status | string `400 Bad Request`, `500 Internal Server Error` | `"Mr."` | yes | | name Response Header | string `X-Request-ID: <uuid>` | `"John"` | yes | | surname Response Envelope | string `{ "status": "success\|error", "data": {...}, "message": "...", "xid": "..." }` | `"Doe"` ### Request Body | yes Field | Type | email Required | string Format/Validation | `"john@doe.com"` Example | yes | |---|---:|:---:|---|---| | mobile `title` | string | `"0987654321"` ✅ | yes non-empty | `Mr.` | | birthDate `name` | string (date-time) | `"1990-01-01T00:00:00Z"` ✅ | yes non-empty | `John` | | marriageStatus `surname` | string | `"Single"` ✅ | yes non-empty | `Doe` | | nationality `email` | string | `"USA"` ✅ | yes valid email | `john@doe.com` | | passportNumber `mobile` | string | `"AC123435"` ✅ | yes non-empty | `0987654321` | | expirationDate `birthDate` | string (date-time) | `"2030-01-01T00:00:00Z"` ✅ | yes RFC3339 date-time | `1990-01-01T00:00:00Z` | | agreement `marriageStatus` | boolean string | `true` ✅ | yes non-empty | ### Success Response (200) `Single` | JSON Path | Type | Example | Required | |---|---|---|---| | status `nationality` | string | `"success"` ✅ | yes non-empty | `USA` | data | object | `{"registerID":"registerId"}` | yes | | data.registerID `passportNumber` | string | `"registerId"` ✅ | no (`omitempty`) non-empty | `AC123435` | data.alreadyExist | boolean | `true` | no (`omitempty`) | | xid `expirationDate` | string | `"xRequestId"` ✅ | no RFC3339 date-time | `2030-01-01T00:00:00Z` | | header.X-Request-ID `agreement` | string boolean | `"xRequestId"` ✅ | yes (header) must be present | `true` | ### Error 200 Response (`status = success`) #### Bad Request (400) | JSON Path Scenario | Type `data` payload | Example | Required | |---|---|---|---| |---|---| | status New register | string `{ "registerID": "registerId" }` | `"error"` | yes | | message Already exists | string `{ "alreadyExist": true }` | `"validation failed"` | yes | | xid | string | `"xRequestId"` | no | #### Internal Server ### Error (500) Response | JSON Path HTTP Code | Type `status` | Example Body shape | Required | |---|---|---|---| |---:|---|---| | status `400` | string `error` | `"error"` `{ "status":"error", "message":"<error>", "xid":"<uuid>" }` | yes | | message `500` | string `error` | `"internal error"` | yes | | xid | string | `"xRequestId"` | no `{ "status":"error", "message":"<error>", "xid":"<uuid>" }` |