# Users

XanPool API allows to create users' accounts as well as complete their KYC. KYC consists of three steps:

  1. Uploading ID's photos, proof of address & KYC video
  2. Verifying Phone number
  3. Sending a KYC request

# Sign up

Creates a new user on behalf of a partner.

Endpoint

POST /api/users

Payload

Parameter Description
email 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"
}

# Get user

Returns user's information

Endpoint

GET /api/users/{id}

Response

Response contains a user object

Request Example

curl "https://xanpool.com/api/users/1e1dad4b5b685900124e8712"
  -X GET
  -H "Content-Type: application/json"  
  -u {API_KEY}:{API_SECRET}

Response

{
  "id": "1e1dad4b5b685900124e8712",
  "email": "peter@xanpool.com",
  "firstName": "Daniel",
  "lastName": "Taiger",
  "kyc": "failed",
  "kycDocumentsDetails": {
    "addressProof": {
      "failedReason": "not_valid_proof_of_address",
      "state": "failed",
    },
    "backSideId": {
      "failedReason": "other",
      "failedReasonMessage": "Blurry back ID",
      "state": "failed",
    },
    "frontSideId": {
      "state": "verified",
    },
    "kycVideo": {
      "failedReason": "kyc_video_has_blurry_documents",
      "state": "failed",
    }
  }
}

# Get current user

Returns information about the user that is associated with the access token

Endpoint

GET /api/users/me

Response

Response contains a user object

Request Example

curl "https://xanpool.com/api/users/me"
  -X GET
  -H "Content-Type: application/json"  
  -H "Authorization: Bearer ${TOKEN}" 

Response

{
  "id": "1e1dad4b5b685900124e8712",
  "email": "peter@xanpool.com",
  "firstName": "Daniel",
  "lastName": "Taiger",
  "kyc": "failed",
  "kycDocumentsDetails": {
    "addressProof": {
      "failedReason": "not_valid_proof_of_address",
      "state": "failed",
    },
    "backSideId": {
      "failedReason": "other",
      "failedReasonMessage": "Blurry back ID",
      "state": "failed",
    },
    "frontSideId": {
      "state": "verified",
    },
    "kycVideo": {
      "failedReason": "kyc_video_has_blurry_documents",
      "state": "failed",
    }
  }
}

# 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"  
  -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"
  -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  
  -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"
  -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"
}

# User Object

Parameter Description
id Unique ID of the user
email Email of the user
firstName First name of the user
lastName Last name of the user
kyc KYC documents verification state, please refer to KYC verification statuses
kycDocumentsDetails Details of each individual KYC documents (addressProof, backSideId, frontSideId, and kycVideo), for details of each documents, please refer to KYC document details

# KYC Verification Statuses

Status Description
not-verified User has not uploaded any KYC documents
in-progress KYC documents are in the process of being reviewed
verified KYC documents are verified
failed KYC documents failed verification
banned There were some problems with verifying KYC documents

# KYC Document Details

Status Description
state Current state of KYC document (either verified, uploaded or failed)
failedReason Failed reason for KYC document, please refer to failed reason statuses
failedReasonMessage Will be present when failedReason status is other

# Failed Reason Statuses

Status Description
blurry_documents Uploaded documents weren't clear
document_is_cropped Uploaded document is cropped
kyc_video_incorrect Video holding ID is invalid
kyc_video_has_low_quality Uploaded video didn't have good quality
kyc_video_has_blurry_documents The documents in the uploaded video weren't clear
kyc_video_documents_does_not_match_uploaded_documents Documents uploaded in video didn't match the uploaded documents
not_valid_proof_of_address Uploaded proof of address is invalid
proof_of_address_not_issued_within_the_last_3_months Uploaded proof of address is not issued within the last 3 months
other Failed reason will be present in failedReasonMessage