Skip to content

Create Transaction ​

Opens an eKYC transaction for a user and returns the JWT token the Mobile SDK authenticates with. This is the first call in an SDK-driven eKYC session.

Endpoint ​

http
POST /v1/create_ekyc_transaction
Content-Type: application/json
json
{
  "user_id": "user_00000001",
  "ref_id": "ref_00000001",
  "level": 0
}

Parameters:

ParamTypeRequiredDefaultDescription
user_idstringYes—The user ID.
ref_idstringYes—The transaction reference ID you generate and manage.
levelintNo0The challenge level. Higher levels require more stringent checks.

Headers:

HeaderRequiredDescription
App-IdNoThe App-Id the transaction is scoped to. Defaults to default if omitted.

Returns: CreateTransactionResponse

Sample Request ​

bash
curl --location '<BASE_URL>/v1/create_ekyc_transaction' \
  --header 'Authorization: ATV <ACCESS_ID>:<SIGNATURE>' \
  --header 'X-TV-Timestamp: <TIMESTAMP>' \
  --header 'App-Id: <APP_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "user_id": "user_00000001",
    "ref_id": "ref_00000001",
    "level": 0
  }'

Response ​

json
{
  "success": true,
  "code": 0,
  "message": "Success",
  "request_id": "f48085e4-3ae4-40bb-b0e1-9b2c72575bc1",
  "data": {
    "id": "85712834-558f-4d9b-81bd-a2ab3b9a3aad",
    "ref_id": "ref_00000001",
    "user_id": "user_00000001",
    "status": "NOT_VERIFIED",
    "token": "<JWT_TOKEN>"
  }
}
FieldTypeDescription
data.idstringThe transaction unique ID.
data.ref_idstringThe transaction reference ID you supplied.
data.user_idstringThe user ID.
data.statusstringNOT_VERIFIED, VERIFIED or EXPIRED.
data.tokenstringThe JWT token the Mobile SDK uses to authenticate with the server.
errorsarrayDetail of each failure. Empty on success.
successboolWhether the call succeeded.
codeintNumeric status code — 0 on success.

INFO

The response carries user_id, matching the request. Contact the CAKE team if you see document_id in its place.

WARNING

The token is scoped to one transaction and expires. Hand it to the SDK over your own authenticated channel and never log it — the Access Key must stay on your backend.

Errors ​

CodeMessage
2001010Access ID not found.
2001020Transaction lock failed.
2001021Invalid transaction request.
2002206User profile is locked.
401100You are not authorized to perform the action.
4001000Input parameter violates a constraint.
4001001The X-TV-Timestamp header is expired, need a newer one.
5001000Some unexpected error occurs while processing the request.
CodeDescription
access_id_not_foundThe API key is incorrect.
transaction_lock_failedTransaction lock failed.
transaction_invalid_requestInvalid transaction request.
access_denied_exceptionYou are not authorized to perform the action.
user_profile_not_found_exceptionThe profile of user not found.
user_profile_lockedUser profile has been locked.
internal_server_errorSome unexpected error occurs while processing the request.

Next Steps ​

Developers