Partner account

In order to work with the Crypterium backend API, a partner needs to get an authorization token. Crypterium support service provides a partner with an identifier (merchantId) and a password. Using them, the partner obtains an authorization token. By default, the token is valid for 365 days. Authorization header contains this token.

HTTP Header Authorization: Bearer \<access_token>\

Authentication

POST /oauth/token

get authorization token with merchantId, password and user-agent

Parameters

NameTypeDefault valueDescription
Authorizationrequired, HeaderBasic bWVyY2hhbnQ6bWVyY2hhbnQ=base64('merchant:merchant')
User-Agentrequired, Headertaken from your devicestring that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent
merchantIdrequired, Stringprovided by your managermerchant identifier of uuid format, provided by Crypterium support service or manager
passwordrequired, Stringprovided by your managerpassword,provided by Crypterium support service or manager
grant_typerequired, Stringmerchanttype

To get a User-Agent parameter for your device, you may use these articles:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
https://hacks.mozilla.org/2013/09/user-agent-detection-history-and-checklist/

Request example

curl -X POST "https://api.crypterium.com/oauth/token" -H "accept: application/json"-H  "Content-Type: application/json" -H "Authorization: Basic bWVyY2hhbnQ6bWVyY2hhbnQ=" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0)"
 -F "grant_type=merchant" -F "merchantId=780628fc-3926-470e-a22a-ac60bb42b040" -F "password=123456"

Response example

{
  "access_token": "fb3cee22-08a5-4f77-95e7-ba7c23aaf8af",
  "token_type": "bearer",
  "expires_in": 24340862,
  "scope": "read write"
}

access_token - authorization token
expires_in - lifetime of an authorization token in seconds

Change password

POST /v1/merchant/password

change merchant password

Parameters

NameTypeDescription
Authorizationrequired, HeaderBearer \<access_token\> an authorization token
oldPasswordrequired, String
newPasswordrequired, String

Request example

curl -X POST "http://api.crypterium.com/v1/merchant/password" -H  "accept: */*" -H  "Authorization: Bearer fb3cee22-08a5-4f77-95e7-ba7c23aaf8af" -H  "Content-Type: application/json"
 -d "{  \"newPassword\": \"string\",  \"oldPassword\": \"string\"}"

Response example

{
  "result": "ok"
}