# Users
XanPool API allows to create users' accounts as well as complete their KYC. KYC consists of three steps:
- Uploading ID's photos, proof of address & KYC video
- Verifying Phone number
- Sending a KYC request
# Sign up
Creates a new user on behalf of a partner.
Endpoint
POST /api/users
Payload
Parameter | Description |
---|---|
Email of the user. | |
firstName | First name of the user |
lastName | Last name of the user |
Request Example
curl "https://xanpool.com/api/users"
-X POST
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET}
-d '{"email":"example@xanpool.com", "firstName":"Daniel", "lastName": "Taiger"}'
Response
{
"id": "1e1dad4b5b685900124e8712",
"email": "peter@xanpool.com",
"firstName": "Daniel",
"lastName": "Taiger",
"kyc": "not-verified"
}
# Initiate Phone's Verification
This endpoints initiates phone's verification. A user will receive a confirmation which should be used in the next step with 5 minutes before it expires.
Endpoint
PUT /api/users/{id}/phone
Payload
Parameter | Description |
---|---|
phone | A valid phone number without country code |
code | Country of the country starting with + |
Request Example
curl "https://xanpool.com/api/users/{id}/phone"
-X PUT
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET} # or -H "Authorization: Bearer ${TOKEN}"
-d '{"phone":"87711111", "code": "+65"}'
Response
{
"status": "ok"
}
# Complete Phone's Verification
Completes phone verification if a valid code is provided.
Endpoint
PUT /users/{id}/phone/verify
Payload
Parameter | Description |
---|---|
code | A six digit code received via SMS |
Request Example
curl "https://xanpool.com/api/users/{id}/phone/verify"
-X PUT
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET} # or -H "Authorization: Bearer ${TOKEN}"
-d '{"code": 123456}'
Response
{
"id": "1e1dad4b5b685900124e8712",
"email": "peter@xanpool.com",
"firstName": "Daniel",
"lastName": "Taiger",
"kyc": "not-verified",
"phone": "+6587711111"
}
# Upload KYC Documents
Allows to upload all three documents required for KYC - Front side of the ID, Back side of the ID(Optional), Proof of Address and KYC Video. Supported types for documents are are pdf, jpg, png, jpeg. Supported types for KYC video are mov, mp4, avi, wmv.
Endpoint
POST /api/users/{id}/upload-kyc-documents
Form attributes Payload should be application/x-www-form-urlencoded type
Parameter | Description |
---|---|
file | A binary file of the provided document |
filename | Name of the file |
type | Must be either front, back, addressProof, kycVideo |
Request Example
curl "https://xanpool.com/api/users/{id}/upload-kyc-documents"
-X POST
-u {API_KEY}:{API_SECRET} or # -H "Authorization: Bearer ${TOKEN}"
-F "type=front"
-F "filename=front.jpg"
-F "file=@front.jpg"
Response
{
"status": "ok"
}
# Initiate KYC request
Initiates KYC request, can be executed only after phone's verification as well as uploading all required documents.
Once the request has been sent, XanPool will start user's verification which usually takes ~ 5-30 minutes.
Endpoint
PUT /api/users/{id}/verify
Payload attributes
Parameter | Description |
---|---|
address | User's address |
Request Example
curl "https://xanpool.com/api/users/{id}/verify"
-X PUT
-H "Content-Type: application/json"
-u {API_KEY}:{API_SECRET} or # -H "Authorization: Bearer ${TOKEN}"
-d '{"address": "Singapore, Princep Street 128, #01-01"}'
Response
{
"id": "1e1dad4b5b685900124e8712",
"email": "peter@xanpool.com",
"firstName": "Daniel",
"lastName": "Taiger",
"kyc": "in-progress",
"phone": "+6587711111"
}
← OAuth2 Transactions →