Submit KYC application
POST /kyc/application
Submit information for KYC application.
Encrypted kyc payload
When the header has encrypted=true, the payload should be encrypted.
The steps to encrypt are:
- Generate AES Key: Create a random 256-bit AES key
- Encrypt Payload: Use AES-256-GCM to encrypt your KYC JSON data
- Encrypt AES Key: Use Rain-provided RSA public key with OAEP padding
- Encode Components: Base64-encode all encrypted components
- Set Header: Include encrypted: “true” header in your request
- Submit Request
KYC Encryption Public Key for sandbox is:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyZixoAuo015iMt+JND0y
usAvU2iJhtKRM+7uAxd8iXq7Z/3kXlGmoOJAiSNfpLnBAG0SCWslNCBzxf9+2p5t
HGbQUkZGkfrYvpAzmXKsoCrhWkk1HKk9f7hMHsyRlOmXbFmIgQHggEzEArjhkoXD
pl2iMP1ykCY0YAS+ni747DqcDOuFqLrNA138AxLNZdFsySHbxn8fzcfd3X0J/m/T
2dZuy6ChfDZhGZxSJMjJcintFyXKv7RkwrYdtXuqD3IQYakY3u6R1vfcKVZl0yGY
S2kN/NOykbyVL4lgtUzf0IfkwpCHWOrrpQA4yKk3kQRAenP7rOZThdiNNzz4U2BE
2wIDAQAB
-----END PUBLIC KEY-----
KYC Encryption Public Key for production needs to be provided.
A working and tested example is available in here
Payload structure before encryption
- Personal information (name, date of birth, address)
- Identity verification documents
- Compliance information (occupation, income, etc.)
- Terms of service acceptance
Here’s the markdown table with object notation for nested fields:
| fieldName | type | example | notes |
|---|---|---|---|
| string | user@domain.com | ||
| lastName | string | Doe | |
| firstName | string | John | |
| nationalId | string | 123456789 | |
| birthDate | string | 1970-01-01 | |
| countryOfIssue | string | US | |
| phoneCountryCode | string | 1 | |
| phoneNumber | string | 5551234567 | |
| address.line1 | string | 123 Main Street | |
| address.line2 | string | Apt 4B | |
| address.city | string | New York | |
| address.region | string | NY | |
| address.postalCode | string | 10001 | |
| address.countryCode | string | US | |
| ipAddress | string | 192.168.1.100 | |
| occupation | string | 11-1011 | Ask for the mandatory occupation codes |
| annualSalary | string | 75000 | |
| accountPurpose | string | Personal Banking | |
| expectedMonthlyVolume | string | 5000 | |
| isTermsOfServiceAccepted | boolean | true |
Authentication and organization verification
The exa account needs to be authenticated but also a member of the organization that submit the KYC application needs to probe that belong to the organization and needs to have kyc permission, every owner and admin of an organization has this permission.
To probe the member of the organization needs to generate a SIWE message with the following statement and viem library is recommended:
“I apply for KYC approval on behalf of address [checksum address] with payload hash [hash]”;
The hash is sha256(encryptedPayload.ciphertext)
The siwe message will be:
| fieldName | type | example | notes |
|---|---|---|---|
| verify.message | string | SIWE message that includes the statement | |
| verify.signature | Hex | signature of the message | |
| verify.walletAddress | Address | address of the member of the organization that signed the message | |
| verify.chainId | number | 11155420 |
A working and tested example is available in here
Note that the member of the organization must be created, the organization must exist and the member must be added as admin by another admin or owner.
Working example about how to login is here
The admin should add a member using addMember method.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body
Section titled “Request Body ”object
Email address
user@domain.comThe person’s last name
The person’s first name
The person’s national ID
Birth date (YYYY-MM-DD)
1970-01-01The person’s country of issue of their national id, as a 2-digit country code
The user’s phone country code
The user’s phone number
The person’s address
object
The user’s occupation. Must be a valid SOC code.
The user’s annual salary
The user’s account purpose
The user’s expected monthly volume
Whether the user has accepted the terms of service
object
object
object
Responses
Section titled “ Responses ”KYC application submitted successfully
object
Bad request
Invalid Payload
object
Forbidden
object
Bad request