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.
Name | Type | Default value | Description |
---|---|---|---|
Authorization | required, Header | Basic bWVyY2hhbnQ6bWVyY2hhbnQ= | base64('merchant:merchant') |
User-Agent | required, Header | taken from your device | string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent |
merchantId | required, String | Provided by your manager | Merchant identifier |
password | required, String | Provided by your manager | Password |
grant_type | required, String | merchant | Type |
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
Name | Type | Description |
---|---|---|
Authorization | required, Header | Bearer <access_token> |
oldPassword | required, String | |
newPassword | required, 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"
}
Updated over 2 years ago