Skip to main content

Responses

The Shufti Pro Verification API will send you two types of responses if a request for verification is made. First is the HTTP response sent against your request, and the second is the callback response. Both HTTP and callback responses will be in JSON format with a header. application/json The response header also includes a Key Signature. This key is used for validating the source of the response. Be sure to validate the request by generating signature and matching it with the Signature value from the response header.


HTTP Status Codes

Shufti Pro Verification API uses conventional HTTP response codes to indicate the success or failure of an API request. Every response is generated in JSON with a specific HTTP code.

Following is a list of HTTP codes that are generated in responses by Shufti Pro Verification API.


HTTP codeHTTP messageMessage
200OKsuccess
400Bad RequestBad Request: one or more parameter is invalid or missing
401UnauthorizedUnauthorized: invalid signature key provided in the request
402Request FailedInvalid request data: missing required parameters
403ForbiddenForbidden: service not allowed
404Not FoundResource not found
409ConflictConflicting data: already exists
429Too Many RequestsToo Many Attempts.
500Server ErrorInternal Server Error
504Gateway TimeoutServer error
524Timeout from CloudflareUnofficial Server Error

Response Events

Events are sent in responses that show the status of the request. These events are sent in both HTTP and callback responses.


EventdescriptionHTTP ResponseCallback Response
request.invalidRequest parameters provided in request are invalid.YesNo
request.unauthorizedRequest is unauthorized. The information provided in authorization header is invalid.YesNo
verification.acceptedRequest was valid and accepted after verification.YesYes
request.receivedRequest has been received.YesYes
request.deletedRequest has been deleted.YesYes

verification.accepted
{
"reference": "17374217",
"event": "verification.accepted",
"proofs": {
"businessocr": {
"proof": "https://ns.shuftipro.com/api/pea/7b09493b70030d35c4368536dd6281b8c7bd40d2"
}
},
"verification_data": {
"business_ocr": {
"last_name": "Doe",
"first_name": "John",
"issue_date": "2018-01-31",
"expiry_date": "2028-01-30",
"nationality": "BRITSH CITIZEN",
"gender": "M",
"place_of_birth": "BRISTOL",
"document_number": "GB1234567"
}
},
"verification_result": [],
"info": {
"agent": {
"is_desktop": true,
"is_phone": false,
"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
"device_name": "Macintosh",
"browser_name": "",
"platform_name": "OS X - 10_14_0"
},
"geolocation": {
"host": "212.103.50.243",
"ip": "212.103.50.243",
"rdns": "212.103.50.243",
"asn": "9009",
"isp": "M247 Ltd",
"country_name": "Germany",
"country_code": "DE",
"region_name": "Hesse",
"region_code": "HE",
"city": "Frankfurt am Main",
"postal_code": "60326",
"continent_name": "Europe",
"continent_code": "EU",
"latitude": "50.1049",
"longitude": "8.6295",
"metro_code": "",
"timezone": "Europe/Berlin"
}
}
}

Verification Response

Responses will contain the following parameters:


ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventsThis is the request event which shows status of request. Event is changed in every response. Please consult Events for more information.
errorWhenever there is an error in your request, this parameter will have the details of that error.
tokenThis is the unique request token of the request.
verification_dataIt is only returned in case of a valid verification. This object will include the all the gathered data in a request process. Check verification.accepted and verification.declined responses in Events section for a sample response.
infoThis object will be returned in case of verification.accepted or verification.declined. It contains the following keys:
Agent provides information about the device and browser of the end-user.
Geolocation provides information about the geographical location of the end-user.
For Details on info object go to Info

tip

Callback response will be sent on the callback_url provided in the request callback_url parameter.


Status Response

The Shufti Pro Verification API will send a JSON response if a status request is made. Make sure to validate the request by generating signature and matching it with the Signature value from the response header.

ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventThis is the request event which shows status of request. Event is changed in every response.
Please consult Events for more information.
countryThis contains country code sent by the merchant at the time of request. Country code in the format of ISO 3166-1 alpha-2. Please consult Supported Countries for country codes.
Type: string
Example: DE
null if not provided by merchant.
proofsThis contains all the proofs that were used to verify data. The Proof URLs returned are temporary and valid for 15 minutes only.
verification_dataThis contains all the data used for verification. This will only be returned in case of verification.accepted or verification.declined.
infoThis object will be returned in case of verification.accepted or verification.declined. It contains the following keys:
Agent provides information about the device and browser of the end-user.
Geolocation provides information about the geographical location of the end-user.
For Details on info object go to Info

caution

request.invalid response with HTTP status code 400 means the request is invalid.

Delete Request Response

The Shufti Pro Verification API will send a JSON response if a delete request is made. Make sure to validate the request by generating signature and matching it with the Signature value from the response header

ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventThis is the request event which shows status of request. Event is changed in every response.

Please consult Events for more information.


caution

request.invalid will be returned in case of invalid reference provided or the request is already deleted.


sample-response
//Content-Type: application/json
//Signature: NmI4NmIyNzNmZjM0ZmNl

{
"reference": "17374217",
"event": "request.deleted"
}

Response Signature

Every HTTP and Callback response will be in application/JSON with a key Signature in the header. It can be used to validate the source of the request. Make a signature using the following procedure:

  1. Concatenate Secret Key at the end of the raw response string. (i.e. response + secret_key).
  2. Take SHA256 of concatenated string.
  3. Match the SHA256 string with Signature value from the header of the response.

In short, make signature as mentioned format and match it with the signature provided in the header in Signature key.

hash('sha256', response . your_secret_key)

The clients who are registered with shuftipro after 15th March, 2023. They need to make the signature using the following procedure.

  1. Take SHA256 of Secret Key string.
  2. Concatenate hashed Secret Key at the end of the raw response string. (i.e. response + hash('sha256', secret_key)).
  3. Take SHA256 of concatenated string.
  4. Match the SHA256 string with Signature value from the header of the response.
hash('sha256', response . hash('sha256', secret_key))