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


Integrate

Follow the steps below to perform a basic sale transaction:

  1. 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"
}
'
  1. Maast will return a response like the code below:
{
  "rcode": "000",
  "rmsg": "Approved T59123",
  "pg_id": "efgbe295c41611edb32402171867ecb2",
  "auth_code": "T59123"
}
  1. Check the rcode field. 000 confirms a successful transaction. If rcode is a value other than 000, 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.