Skip to main content

Generating Tokens

Verify and Compare tokens are generated for Ghana Card only.

info

Tokens have a limited lifespan. Each token created is valid for 15 minutes from the time of generation.
Expired tokens will no longer be valid and cannot be used for verification purposes.

POST /custom/initiate/token_verification

Description​

The /custom/initiate/token_verification endpoint generates tokens required for Verify and Compare remote verifications. Ensure that the body parameters are passed in the multipart/form-data format.

Required Body Paramaters (formdata)​

  • id_type: This is a string indicating the type of ID to be verified.
    For Verify and Compare, this is always "GHANA_CARD".

  • ghanacardnumber: (optional) This is a string representing the Ghana Card number of the individual being verified.
    When provided, it should follow the format GHA-XXXXXXXXX-X where X represents a digit.

  • send_token_to_client: (optional) This parameter has a value of 1, indicating that an SMS will be sent to the individual being verified to receive the token.

  • verificationtype: This parameter has a value of 3

  • phonenumber: (optional) This is the phone number of the individual being verified. An SMS containing the verification link will be sent to this number.

  • referenceid: This is a string that can be used to track this verification. In this case, set the referenceid as the client's phone number.

  • purpose: This is a string describing the purpose for the verification, such as "Identity Verification".

  • email: (optional) This is an optional email to send the remote verification link to.

  • with_instructions: (optional) This optional field has a defaults value of 1. Set it to 0 to skip verification guidelines and confirmation screens, proceeding directly to the liveness capture session. Include this parameter if needed.

  • require_location: (optional) This parameter determines whether the user's device location should be captured during the verification process. Set to 1 to enable location capture or 0 to omit it.

  • require_address_location: (optional) This parameter determines whether the user's home address should be captured after the verification process. Set to 1 to enable home address capture or 0 to omit it.

  • require_phone_number_verification: (optional) This parameter determines whether the user's phone number should be verified. Set to 1 to require phone number verification or 0 to omit it.

  • require_email_verification: (optional) This parameter determines whether the user's email address should be verified. Set to 1 to require email verification or 0 to omit it.

curl --location 'https://service-prod.metric.africa/api/identification/custom/initiate/token_verification' \
--header 'X-API-AUTH: abcdefghijklmnopqrstuvwxyz' \
--form 'id_type="GHANA_CARD"' \
--form 'ghanacardnumber="GHA-XXXXXXXXX-X"' \
--form 'send_token_to_client="1"' \
--form 'verificationtype="3"' \
--form 'phonenumber="0300000000"' \
--form 'referenceid="0300000000"' \
--form 'purpose="Testing purpose"' \
--form 'email="email@email.com"' \
--form 'with_instructions="1"' \
--form 'require_address_location="1"' \
--form 'require_phone_number_verification="1"' \
--form 'require_email_verification="1"' \