User Authentication
Scheme
First of all, to provide our features to your customers you need to sign up and authorize them. SDK works with JWT tokens which are necessary for all requests in mobile frameworks. Below is the scheme of sign up, sign in, and refresh token flows.
Crypterium Backend API
Get list of customers
GET /v1/merchant/customer
Parameters:
Name | Type | Description |
---|---|---|
offset | Integer | Offset for paging, add it to url |
pageNumber | Integer | Number of requested page |
pageSize | Integer | Amount of requested elements |
Request:
curl -X GET "https://sandbox-crpt-backend.features.testessential.net/v1/merchant/customer?offset=0&pageNumber=0&pageSize=1"
Response:
{
"content": [
{
"customerId": "2d084eb7-9841-4a8e-9521-cfa9d81121dc", // Customer identifier
"status": "ACTIVE", // Customer status
"kycLevel": "KYC_1" // Customer kyc level "NONE", "KYC_1", "KYC_2"
}
], // Array of customers data
"totalElements": 1,
"last": true,
"totalPages": 1,
"sort": null,
"first": true,
"numberOfElements": 1,
"size": 20,
"number": 0
}
Sign up new user
POST /v1/merchant/register
Parameters:
{
"email": "string",
"phone": "string"
}
Response:
{
"customerId": "c8772b0b-7bfd-49b2-8753-101013dd4a88" // Customer identifier
}
Authorize user
POST /v1/merchant/authorize
Parameters:
{
"customerId": "c8772b0b-7bfd-49b2-8753-101013dd4a88"
}
Response:
{
"access_token": "b4529e51-8c2e-45de-8905-d0b6ddcedc69",
"expires_in": 899,
"refresh_token": "9948fa44-4c43-4094-b700-469a68de6995",
"scope": "read write",
"token_type": "bearer"
}
Updated over 2 years ago