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
API endpoint (POST) |
---|
https://api.maibmerchants.md/v1/generate-token |
Request parameters (body)
Parameter | Required | Type | Description |
---|---|---|---|
projectId | YES | string | Project ID from Project in maibmerchants |
projectSecret | YES | string | Project Secret from Project in maibmerchants |
Request example
Response parameters
Parameter | Type | Description |
---|---|---|
result | Object | An object containing the Token and the Refresh Token. |
| string | Access Token |
| integer | Access Token lifetime in seconds |
| string | Refresh Token for generating a new Access Token. |
| integer | Refresh Token lifetime in seconds |
| string | Token type (Bearer) |
ok | Boolean | Request processing status. true - no errors false - an error occurred (error details will be in errors) |
errors | Array | Request processing errors. Errors table |
| String | Error code |
| String | Error description |
| Object | Object contains parameters with error details |
Response example
Token generation using Refresh Token
Request parameter (body)
Parameter | Required | Type | Description |
---|---|---|---|
refreshToken | Yes | string | Refresh Token |
Request example
Response example
Example of Authentication via Access Token
Last updated