Access Token generation
To generate a Token, you will need a Project ID and Project Secret, which are available after activating the Project in maibmerchants.
For the Test Project, the Project ID and Project Secret will be available immediately after the settings are made (IP, Platform, Callback URL, Ok URL, Fail URL).
Flow authentication by Access Token:
Send a request to the token generation endpoint using the Project ID and Project Secret. If the transmitted data is valid, you will receive a Token (Token lifetime) and a Refresh Token (Refresh Token lifetime) in response.
If the token has expired, use Refresh Token to generate a new Access Token. If the Refresh Token has also expired, use the Project ID and Project Secret (see point 1).
Make requests to maib ecomm using the Access Token.
Token generation using Project ID and Project Secret
https://api.maibmerchants.md/v1/generate-token
Request parameters (body)
projectId
YES
string
Project ID from Project in maibmerchants
projectSecret
YES
string
Project Secret from Project in maibmerchants
Request example
Response parameters
result
Object
An object containing the Token and the Refresh Token.
accessToken
string
Access Token
expiresIn
integer
Access Token lifetime in seconds
refreshToken
string
Refresh Token for generating a new Access Token.
refreshExpiresIn
integer
Refresh Token lifetime in seconds
tokenType
string
Token type (Bearer)
ok
Boolean
Request processing status.
true - no errors
false - an error occurred (error details will be in errors)
errorCode
String
Error code
errorMessage
String
Error description
errorArgs
Object
Object contains parameters with error details
Response example
Token generation using Refresh Token
Request parameter (body)
refreshToken
Yes
string
Refresh Token
Request example
Response example
Example of Authentication via Access Token
Last updated