Skip to content

Create Transaction ​

Opens an NFC transaction and returns the JWT token the Mobile SDK uses to authenticate its chip read. This is the first call in every NFC session.

Endpoint ​

http
POST /v1/create_transaction
Content-Type: application/json
json
{
  "document_id": "001xxxxxxxxx",
  "ref_id": "ref_00000001"
}

Parameters:

ParamTypeRequiredDefaultDescription
document_idstringYes—The Document ID — the citizen's NID number. Max length 64.
ref_idstringYes—The transaction reference ID you generate and manage. Max length 64.

Returns: CreateTransactionResponse

Authenticate this call with HMAC — see Overview § Authentication.

Sample Request ​

bash
curl --location '<BASE_URL>/v1/create_transaction' \
  --header 'Authorization: ATV <ACCESS_ID>:<SIGNATURE>' \
  --header 'X-TV-Timestamp: <TIMESTAMP>' \
  --header 'Content-Type: application/json' \
  --data '{
    "document_id": "001xxxxxxxxx",
    "ref_id": "ref_00000001"
  }'

Response ​

json
{
  "success": true,
  "code": 0,
  "message": "success",
  "request_id": "133963a4-3d2c-4a85-b0a1-3fa2878b8f99",
  "data": {
    "id": "4b1f99a2-7569-4fde-b65a-1260794cb9c6",
    "ref_id": "ref_00000001",
    "document_id": "001xxxxxxxxx",
    "status": "NOT_VERIFIED",
    "token": "<JWT_TOKEN>"
  }
}
FieldTypeDescription
codeintThe error code — 0 means no error. Max length 10.
request_idstringThe server request ID, used for tracing. Max length 64.
data.idstringThe transaction unique ID. Max length 64.
data.ref_idstringThe transaction reference ID you supplied. Max length 64.
data.document_idstringThe Document ID. Max length 64.
data.statusstringThe transaction status: NOT_VERIFIED, VERIFIED or EXPIRED. Max length 32.
data.tokenstringThe per-transaction token the Mobile SDK uses to authenticate with the server. Max length 1000.

WARNING

The token is scoped to one transaction and expires. Pass it straight to the SDK over your own authenticated channel, never log it, and mint a new transaction rather than reusing an old token.

Errors ​

CodeDescription
2001010The API key is incorrect.
2001020Transaction lock failed.
2001021Invalid transaction request.
2001022Transaction already verified.
2001023Invalid transaction key.
CodeDescription
401You are not authorized to perform the action.
500Some unexpected error occurs while processing the request.

Next Steps ​

  • Read NFC — the SDK's next call, using the token returned here
  • Overview — how the transaction status changes across the flow

Developers