Skip to content

Create Transaction ​

Opens a FaceAuthen transaction and returns the JWT token the Mobile SDK authenticates with. It also fixes the challenge level, the sanity options the verify step will run, and whether flash liveness is required.

Endpoint ​

http
POST /v1/create_transaction
Content-Type: application/json
json
{
  "user_id": "user_00000001",
  "ref_id": "ref_00000001",
  "level": 0,
  "sanity_options": {
    "mask_check": true,
    "glasses_check": false
  },
  "enable_flash_liveness": false
}

Parameters:

ParamTypeRequiredDefaultDescription
user_idstringYes—The user ID.
ref_idstringYes—The transaction reference ID.
levelintegerNo0The challenge level. Validated against the tenant's configured challenge settings — must be no greater than the number of configured verdict levels. Higher levels require more stringent face verification.
sanity_optionsobjectNo—Per-call toggles selecting which sanity checks the verification step runs. Keys are filtered against the server's allow-list; unlisted keys are ignored.
enable_flash_livenessbooleanNofalseWhen true and the tenant has flash-liveness colors configured, the server generates a shuffled color sequence and stores it on the transaction for the verify step. Silently ignored when the tenant has no colors configured.

sanity_options keys ​

Allowed keys, each a boolean:

FieldTypeDescription
image_typeboolCheck the input image is the correct type for this flow.
occlusion_checkboolCheck the face is not occluded.
eyes_checkboolCheck the eyes are open and visible.
mask_checkboolCheck for a face mask.
glasses_checkboolCheck for glasses.
light_qualityboolCheck lighting quality.
deepfake_checkboolCheck for synthetic or generated faces.
supported_selfieboolCheck for a selfie held up on another surface.
nakedboolCheck for nudity.
tattooboolCheck for tattoos.

Headers:

HeaderRequiredDescription
App-IdNoThe App-Id the transaction is scoped to; selects the per-app config for challenge settings and flash liveness. Defaults to default if omitted.

Returns: CreateTransactionResponse

INFO

Unrecognized sanity_options keys are dropped silently rather than rejected. A typo means the check you intended simply never runs — verify against the allow-list above rather than assuming a misspelled key would error.

Sample Request ​

bash
curl --location '<BASE_URL>/v1/create_transaction' \
  -H '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,
    "sanity_options": {
      "mask_check": true,
      "glasses_check": false
    },
    "enable_flash_liveness": false
  }'

Response ​

json
{
  "success": true,
  "code": 0,
  "message": "Success",
  "data": {
    "request_id": "f48085e4-3ae4-40bb-b0e1-9b2c72575bc1",
    "transaction": {
      "id": "85712834-558f-4d9b-81bd-a2ab3b9a3aad",
      "ref_id": "ref_00000001",
      "user_id": "user_00000001",
      "status": "NOT_VERIFIED",
      "token": "<JWT_TOKEN>",
      "level": 0
    }
  },
  "errors": []
}
FieldTypeDescription
successbooleanWhether the API call succeeded.
codeintegerResponse code — 0 on success.
messagestringResponse message.
data.request_idstringRequest ID (UUID) for tracking.
data.transaction.idstringTransaction ID (UUID).
data.transaction.ref_idstringReference ID provided in the request.
data.transaction.user_idstringUser ID provided in the request.
data.transaction.statusstringTransaction status, e.g. NOT_VERIFIED.
data.transaction.tokenstringJWT token for the transaction.
data.transaction.levelintegerChallenge level for the transaction.
errors[].codestringError code identifier.
errors[].messagestringError message.
errors[].detailobjectAdditional error details, which may include the field name.

The HTTP status is 200 whenever the request is processed, successfully or not.

Note the transaction is nested under data.transaction here, unlike the eKYC and NFC create endpoints which return it flat under data.

Failure response ​

json
{
  "success": false,
  "code": 4001000,
  "message": "Input parameter violates a constraint.",
  "data": {
    "request_id": "f48085e4-3ae4-40bb-b0e1-9b2c72575bc1"
  },
  "errors": [
    {
      "code": "invalid_parameter_exception",
      "message": "Input parameter violates a constraint.",
      "detail": {
        "reason": "Invalid challenge level."
      }
    }
  ]
}

Errors ​

CodeMessage
2001010Access ID not found in the system.
2001020Transaction lock failed.
2001021Invalid transaction request.
2002206User profile is locked.
401100Unauthorized action. You do not have permission to perform this action.
4001000Input parameter violates a constraint.
4001001The X-TV-Timestamp header is expired. Please provide a newer timestamp.
4041002The profile of user not found.
5001000Some unexpected error occurs while processing the request.
CodeDescription
access_id_not_foundAccess ID not found in the system.
transaction_lock_failedTransaction lock failed.
transaction_invalid_requestInvalid transaction request.
access_denied_exceptionUnauthorized action. You do not have permission to perform this action.
user_profile_not_found_exceptionThe profile of user not found.
user_profile_lockedUser profile is locked.
invalid_parameter_exceptionInput parameter violates a constraint.
request_time_too_skewedThe X-TV-Timestamp header is expired. Please provide a newer timestamp.
internal_server_errorSome unexpected error occurs while processing the request.

A 4041002 means no profile exists yet — call Register Faces first. A 2002206 means the profile is locked; see Unlock Profile.

Next Steps ​

Developers