API Quick Start
Perform a basic sale transaction with our Payment Gateway API.
Use the instructions below to quickly set up Maast's Payment Gateway API for sale transactions. See the Payment Gateway API Sale (Auth + Capture) guide to customize and add optional features for payments with this integration method. See Authentication in API Reference for more information on authentication for APIs.
Prerequisites
- See Create a Sandbox Account to sign up and log in to the Maast Manager portal.
- Follow the steps in Get Your API Credentials to save a sandbox ID and API key.
- See Authentication to format the credentials and generate your API token. (Alternatively, use the credentials as-is to test this endpoint with our 'Try It!' feature.)
Integrate
Follow the steps below to perform a basic sale transaction:
- Send a POST request to the
/pg/sale
endpoint with the following in the body of the request:
{
"merchant_id": "<Provide merchant ID that links to API Key>",
"cardholder_name": "JOHN CUSTOMER",
"amt_tran": 1193.5,
"card_number": "4111111111111111",
"exp_date": "0930",
"cvv2": "152"
}
The full request will look like this:
curl --request POST \
--url https://api-test.maast.com/pg/sale \
--header 'accept: application/json' \
--header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz' \
--header 'content-Type: application/json' \
--data '
{
"merchant_id": "210000000289",
"cardholder_name": "JOHN CUSTOMER",
"amt_tran": 1193.5,
"card_number": "4111111111111111",
"exp_date": "0930",
"cvv2": "152"
}
'
- Maast will return a response like the code below:
{
"rcode": "000",
"rmsg": "Approved T59123",
"pg_id": "efgbe295c41611edb32402171867ecb2",
"auth_code": "T59123"
}
- Check the
rcode
field.000
confirms a successful transaction. Ifrcode
is a value other than000
, check Payment Gateway API Response Codes in Reference.
Test and Go Live
See our Test and Go Live guide to test your API integration and to start transacting with an active production account.
Updated 12 months ago