Generate Security Key

Use the Integrator API service to generate a new API security key.

This guide shows you how to use API to generate an API key for a specified merchant account. Use this key to interact with all Maast APIs in a test environment. See Generate Security Key in API Reference for field definitions.


Prerequisites

  1. Contact Maast Support at [email protected] to set up an integrator sandbox account with Integrator API capacity. Save the account's API security key.
  2. Save the merchant ID (mid) that Maast provides for your integrator sandbox account. Alternatively, follow the instructions in Generate Test Account to generate and save a new merchant ID (found as merchant_id in the response).

Implement

Write a POST request. For the request endpoint, include the merchant ID (mid) by appending it to the end of /platform/vendor/settings/key/. The resulting endpoint is /platform/vendor/settings/key/mid, where the ID value replaces mid.

You can configure your request by setting the number of minutes after requesting a new API key that the old API key will remain valid. Do so in the minutes field in the request body.

Once configured, your request will resemble the sample code below:

curl --request POST \
     --url https://api-test.maast.com/platform/vendor/settings/key/210000000289 \
     --header 'accept: application/json' \
     --header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz' \
     --header 'content-type: application/json' \
     --data '{"minutes":2880}'

Integrate

Send your request. You will receive a response like this from the Maast server:

{
  "code": 0,
  "message": "Success",
  "data": {
    "security_key": "3888ab7bba98452987cdf69ae917561a"
  }
}

Check the code field in the request response: 0 confirms success. If the value is something other than 0, check Platform API Response Codes in Reference.

Check the security_key field in the data object for your new security key. Save the key.

See Generate Security Key in API Reference for response field definitions.

🚧

Save the Security Key

Save your new security key and keep it private. If you lose it, you must generate a new one.


Test

Start testing now at https://api-test.maast.com.


Go Live

Follow these steps to start transacting with an active production account:

  • Contact your sales representative or apply for your production account here.
  • Once Maast has approved your production account, log in to Maast Manager.
  • Get your production API key and production merchant ID the same way you got your sandbox credentials.
  • Start transacting at https://api.maast.com.