Know-Your-Customer verification via MasterPay Global. Submit personal data, upload identity documents, and track approval status.
---
name: KYC & Identity
description: Know-Your-Customer verification via MasterPay Global. Submit personal data, upload identity documents, and track approval status.
version: 1.0.0
metadata:
openclaw:
requires:
env:
- AIOT_API_BASE_URL
primaryEnv: AIOT_API_BASE_URL
---
# KYC & Identity
Use this skill when the user needs to complete identity verification, upload KYC documents, or check verification status.
## Configuration
The default API base URL is `https://payment-api-dev.aiotnetwork.io`. All endpoints are relative to this URL.
To override (e.g. for local development):
```bash
export AIOT_API_BASE_URL="http://localhost:8080"
```
If `AIOT_API_BASE_URL` is not set, use `https://payment-api-dev.aiotnetwork.io` as the base for all requests.
## Available Tools
- `create_masterpay_user` — Create a MasterPay user account (prerequisite for all MasterPay operations) | `POST /api/v1/masterpay/users` | Requires auth
- `get_kyc_status` — Check current KYC verification status and document upload progress | `GET /api/v1/masterpay/kyc/status` | Requires auth
- `get_kyc_metadata` — Get valid document types, occupations, nationalities, and countries for KYC forms | `GET /api/v1/masterpay/kyc/metadata` | Requires auth
- `submit_kyc` — Submit KYC personal data for review (uses profile data) | `POST /api/v1/masterpay/kyc/submit` | Requires auth
- `upload_kyc_document` — Upload a KYC document (passport, ID, proof of address) via multipart or base64 JSON | `POST /api/v1/masterpay/kyc/documents` | Requires auth
- `submit_wallet_kyc` — Submit wallet-level KYC for a card wallet (requires profile phone number and identity document ID number) | `POST /api/v1/masterpay/wallets/kyc` | Requires auth
- `get_profile` — Get user profile data used for KYC submission | `GET /api/v1/profile` | Requires auth
- `update_profile` — Update user profile data (english_first_name, english_last_name, dob, gender, nationality, occupation, source_of_fund, phone_number, phone_country_code, country, address1, address2, address3, city, state, zip, billing_same_as_home) | `PUT /api/v1/profile` | Requires auth
- `get_document` — Get stored identity document info | `GET /api/v1/profile/document` | Requires auth
- `update_document` — Update identity document (fields: identity_type (passport|identity_card), id_number — id_number is required for wallet KYC) | `PUT /api/v1/profile/document` | Requires auth
## Recommended Flows
### Complete KYC Verification
Full flow from profile setup to KYC approval
0. Create MasterPay user: POST /api/v1/masterpay/users — required once before any MasterPay operation
1. Get metadata: GET /api/v1/masterpay/kyc/metadata — learn valid nationalities, occupations, document types
2. Update profile: PUT /api/v1/profile with {english_first_name, english_last_name, dob (YYYY-MM-DD), gender, phone_number, phone_country_code (with '+' prefix, e.g. '+65'), nationality, occupation (use value from metadata endpoint), source_of_fund, country (e.g. 'SG', 'ARGENTINA'), address1, city, state, zip, billing_same_as_home: true}
3. Upload documents: POST /api/v1/masterpay/kyc/documents — JSON body: {document_type, file_data (base64), file_name, mime_type (image/jpeg|image/png|application/pdf)}. Valid document types: PassportFront, PassportBack, NationalIdFront, NationalIdBack, DrivingLicenseFront, DrivingLicenseBack, Selfie, ProofOfAddress. Also supports multipart/form-data with 'file' field.
4. Submit KYC: POST /api/v1/masterpay/kyc/submit — uses profile data, resolves country codes to names, and sends to MasterPay
5. Poll status: GET /api/v1/masterpay/kyc/status — wait for 'approved' (can take minutes to days)
## Rules
- MasterPay user must be created (POST /masterpay/users) before any KYC, wallet, or card operation — this is a one-time setup step
- Profile must include personal info AND address fields (country, address1, city, state) before submitting KYC
- Use country names or ISO alpha-2 codes in the profile country field (e.g. 'SG', 'ARGENTINA') — the backend resolves them to full country names for MasterPay
- Phone country code in profile must include the '+' prefix (e.g. '+65') — MasterPay requires it
- Documents should be uploaded before submission — MasterPay requires passport/ID and proof of address, but our backend does not block submission without them
- KYC review can take minutes to several days — poll status periodically
- Once approved, KYC does not need to be repeated
- Document uploads support both JSON (document_type, file_data as base64, file_name, mime_type) and multipart/form-data (file field + document_type form field) — max 15MB per file
## Agent Guidance
Follow these instructions when executing this skill:
- Always follow the documented flow order. Do not skip steps.
- If a tool requires authentication, verify the session has a valid bearer token before calling it.
- If a tool requires a transaction PIN, ask the user for it fresh each time. Never cache or log PINs.
- Never expose, log, or persist secrets (passwords, tokens, full card numbers, CVVs).
- If the user requests an operation outside this skill's scope, decline and suggest the appropriate skill.
- If a step fails, check the error and follow the recovery guidance below before retrying.
- Before any KYC operation, ensure a MasterPay user exists by calling `create_masterpay_user`. This is a one-time setup. Other MasterPay handlers also auto-create the user, but calling it explicitly is good practice.
- Profile fields use these exact JSON keys: `english_first_name`, `english_last_name`, `dob` (format: YYYY-MM-DD), `gender`, `nationality`, `occupation`, `source_of_fund`, `phone_number`, `phone_country_code`.
- Occupation MUST be a value from the metadata endpoint (`get_kyc_metadata`). Valid values include: GovernmentOfficers, GovernmentWorkers, SoeAndStateOrganExecutives, SoeAndStateOrganEmployees, PrivateBusinessOwnersAndExecutives, PrivateBusinessEmployees, NonGovernmentOrganizationExecutives, NonGovernmentOrganizationEmployees, SoleTraders, Retirees, Students, Unemployed, Freelancer. Always call metadata first to get the current list.
- Complete profile (`update_profile`) with all required fields INCLUDING address fields (country, address1, city, state, zip, billing_same_as_home) before calling `submit_kyc`. The backend validates profile fields are present and returns 400 if any are missing.
- Document upload via JSON requires: `document_type` (e.g. PassportFront, NationalIdFront, Selfie, ProofOfAddress), `file_data` (base64-encoded), `file_name`, `mime_type` (image/jpeg, image/png, or application/pdf). Alternatively, use multipart/form-data with a `file` field and `document_type` form field.
- The `update_document` endpoint (PUT /profile/document) accepts: `identity_type` ("passport" or "identity_card") and `id_number` (passport number, NRIC, etc.). The `id_number` is sent as MasterPay's orgCode during wallet KYC. Always set `id_number` before calling `submit_wallet_kyc`.
- `submit_wallet_kyc` requires: (1) profile with phone_number + phone_country_code, (2) identity document with `id_number` set. It will fail with INCOMPLETE_PROFILE if `id_number` is missing.
- KYC review takes minutes to days. Poll `get_kyc_status` periodically — there are no push notifications.
- Use ISO alpha-2 country codes (e.g., "SG", "MY") for the profile country field. Include the "+" prefix for phone country codes (e.g., "+65").
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit decision points for all common failure modes, structured inputs with env vars and auth details, detailed output contract specifying success and failure formats, and outcome signals tied to KYC status values; preserved original procedure order and MasterPay integration details while clarifying edge cases like rate limiting, timeout retries, and field validation.
use this skill when a user needs to complete identity verification, upload KYC documents, or check verification status against MasterPay Global. the skill handles the full flow from profile setup through document upload to approval polling. use it for onboarding workflows, wallet activation, or regulatory compliance checks.
environment variables
AIOT_API_BASE_URL: api base url. defaults to https://payment-api-dev.aiotnetwork.io if unset. override with export AIOT_API_BASE_URL="http://localhost:8080" for local dev.authentication
external connection: MasterPay Global
user profile data (required before KYC submission)
english_first_name, english_last_name: user's full name in englishdob: date of birth in YYYY-MM-DD format (e.g., "1990-03-15")gender: user's gendernationality: ISO alpha-3 or country name, validated against metadata endpointoccupation: must match a value from get_kyc_metadata (e.g., PrivateBusinessOwnersAndExecutives, Freelancer, Students). invalid values cause 400 error.source_of_fund: source of wealth or incomephone_number: user's phone number (digits only or with common separators)phone_country_code: country code with '+' prefix (e.g., "+65", "+1"). MasterPay requires the prefix.country: ISO alpha-2 code (e.g., "SG", "MY") or full country name (e.g., "ARGENTINA"). backend resolves to MasterPay country name.address1: primary address lineaddress2: optional secondary address lineaddress3: optional tertiary address linecity: city or suburbstate: state or provincezip: postal or zip codebilling_same_as_home: boolean, typically trueidentity document data (required before wallet KYC, optional for personal KYC)
identity_type: "passport" or "identity_card"id_number: passport number, NRIC, driver license number, etc. required for wallet-level KYC submission.document files (for upload_kyc_document step)
create MasterPay user (one-time setup)
POST /api/v1/masterpay/usersfetch KYC metadata
GET /api/v1/masterpay/kyc/metadataget current profile
GET /api/v1/profileupdate profile with personal and address data
PUT /api/v1/profile with json body containing english_first_name, english_last_name, dob, gender, nationality, occupation (from metadata), source_of_fund, phone_number, phone_country_code (with '+'), country (ISO-2 or name), address1, city, state, zip, billing_same_as_homeupdate identity document info
PUT /api/v1/profile/document with json body {identity_type, id_number}upload KYC documents
POST /api/v1/masterpay/kyc/documents with either:submit KYC for review
POST /api/v1/masterpay/kyc/submitpoll KYC status
GET /api/v1/masterpay/kyc/statussubmit wallet-level KYC (optional, for card wallet activation)
POST /api/v1/masterpay/wallets/kycretrieve stored document info (optional, for audit or retry)
GET /api/v1/profile/documentif MasterPay user creation fails (409 Conflict)
if occupation value is not in metadata list
if profile update fails (400 Bad Request)
if document upload fails (400 or 413 Payload Too Large)
if document upload times out (network error)
if KYC submission fails (400 Bad Request)
if KYC submission fails (500 or 502)
if KYC status returns "rejected"
if KYC status returns "needs_info"
if wallet KYC submission fails (400 INCOMPLETE_PROFILE)
if wallet KYC submission fails (400 KYC_NOT_APPROVED)
successful KYC flow completion
successful wallet KYC completion
failure states logged with detail
user knows KYC succeeded when:
user knows KYC is pending when:
user knows KYC failed when:
user knows KYC needs more info when:
agent guidance on errors