Lookup user by user identifier
GET
/dr/v1/users/{type}/{id}
const url = 'https://sender.sandbox-api.kivra.com/dr/v1/users/nationalidentitynumber/example?hashed=true';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://sender.sandbox-api.kivra.com/dr/v1/users/nationalidentitynumber/example?hashed=true'The user lookup checks if a given identifier is connected to a Kivra user. We recommend to hash (sha256) the identifier before doing the lookup except if a cardtoken is used. The cardtoken MUST NOT be hashed.
NOTE! A user can reject receipts from any chain so if a partner token is used when doing the user lookup a chain id must be passed.
Access scope
- PARTNER
- CHAIN
- STORE
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”type
required
string
The type of identifier given
id
required
string
The value of the identifier
Query Parameters
Section titled “Query Parameters”chain_id
string
The chain ID is required if using a partner token
hashed
required
boolean
Determinied if the identifier is given as hashed value or in cleartext
Responses
Section titled “Responses”User exists
Bad request
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
{ "error_code": "40005", "short_message": "bad request", "long_message": "person not found"}{ "error_code": "40010", "short_message": "bad request", "long_message": "unknown url parameter"}{ "error_code": "40012", "short_message": "bad request", "long_message": "invalid identifier"}Unauthorized
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
Exampleunauthorized
{ "error_code": "40100", "short_message": "unauthorized", "long_message": "permission denied"}Internal server error
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Example
{ "error_code": "50000", "short_message": "internal server error", "long_message": "unknown error ocurred"}