Merchant Account Access

Authentication

You need to use HTTP Header “Authorization: Bearer <access_token>“ for all backend queries.

Add User-Agent: \<user-agent>\ to the HTTP  header.

POST /oauth/token - get authorization token with merchanId and password.

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
passwordrequired, StringProvided by your managerPassword
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/

Example request:

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

Example response:

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

where access_token - authorization token, expires_in - lifetime.

Change password

POST /v1/merchant/password - change password

NameTypeDescription
Authorizationrequired, HeaderBearer <access_token>
oldPasswordrequired, String
newPasswordrequired, String

Example request:

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

Example response:

{
  "result": "ok"
}