Getting Started with Unigate
This guide takes you from your Pilot credentials to your first approved test transaction on Unigate, Magensa's API for card-present and card-not-present payments through MPPG v5 or later. You'll set up Postman, build the Authorization header Unigate requires, run a sample EMV sale, and learn which response values to keep for later requests.
Before you begin
You need:
A Postman account. The sample requests are published as a Postman collection. Sign up at postman.com if you don't have one.
Your Unigate Onboarding Worksheet. It lists your Pilot
CustomerCode,Username, andPassword, plus the Base64-encoded version of those credentials.Familiarity with REST APIs and the basics of payment processing.
A MagTek card reader (optional for this guide). The samples include a working ARQC, so you can run your first transaction without one. You'll need a reader before your integration is complete..
Pilot and Production
Unigate has two environments, and each has its own credentials.
Environment
Use it for
Credentials
Pilot
Development and testing. Requests go to processor test systems, so nothing is charged.
From your Onboarding Worksheet, which includes the pre-encoded Base64 value.
Production
Live transactions.
Issued separately. You must build the Authorization header yourself.
Step 1: Copy the collection to Postman
Sign in to Postman.
Open the Unigate API collection.
Select Run in Postman in the top right of the page. The button only appears when you're signed in.
Choose the workspace to copy the collection into.
Step 2: Build the Authorization header
Unigate authenticates every request with HTTP Basic Auth in the Authorization header. Unigate's credential format combines three values instead of the usual two:
Join your
CustomerCodeandUsernamewith a forward slash (/).Add a colon (
:) and yourPassword.Base64-encode the resulting string.
Put
Basicand a space in front of the encoded string.
Worked example
Step
Value
CustomerCode
CUSTOMER000
Username
MAGTEST000
Password
123456789
Combined string
CUSTOMER000/MAGTEST000:123456789
Base64 encoded
Q1VTVE9NRVIwMDAvTUFHVEVTVDAwMDoxMjM0NTY3ODk=
Authorization header
Basic Q1VTVE9NRVIwMDAvTUFHVEVTVDAwMDoxMjM0NTY3ODk=
For Pilot, you can copy the encoded value straight from your Onboarding Worksheet. For Production, generate it in code:
Python
Node.js
C#
Shell
WARNING: Base64 is encoding, not encryption. Anyone who sees the header can decode your password. Send requests only over HTTPS, keep credentials out of source control, and never log the header.
Step 3: Save your credentials at the collection level
Set your credentials once on the collection so every sample request inherits them:
In Postman, select the Unigate collection and open the Authorization tab.
Set Auth Type to Basic Auth.
Enter
CustomerCode/Usernameas the username (for example,CUSTOMER000/MAGTEST000) and your password as the password. Postman builds the encoded header for you.Save the collection.
Leave each request's authorization set to Inherit auth from parent (the default). If a request fails to authenticate, check that it hasn't been changed.
Step 4: Run your first EMV sale
In the collection, open the Transaction › EMV folder (EMV).
Open EMV ARQC Sale. EMV ARQC Authorize also works as a starting point.
Select Send.
The request already contains a sample ARQC, so it runs against your Pilot account in real time without a card reader.
Step 5: Read the response
A Unigate response contains three kinds of data:
Data
What it's for
Standardized Magensa fields
Consistent values across every processor. For example, isTransactionApproved tells you whether the processor approved the transaction, whatever that processor calls "approved."
Normalized processor fields
Processor fields renamed to common keys. For example, Fiserv's ReturnCode becomes processorStatusCode, and TSYS's hostReferenceNumber becomes processorReference.
Raw processor fields
The processor's original values, always included so no data is lost.
Check isTransactionApproved rather than parsing processor-specific status values. Processors report approval differently: Fiserv returns "StatusCode": "OK", TSYS returns status: "PASS", and Worldpay returns TransactionStatus: "Approved". Amount formats (cents vs. dollars) and date formats also vary. For examples from each processor, see Processor Responses.
Step 6: Test with your own MagTek reader
The sample ARQC proves your credentials and request format work. Before your integration is complete, you must send an ARQC that your own MagTek reader generated.
Connect your test reader. See Connection Basics.
Run an EMV transaction on the reader with a test card. See Your First Transaction.
In EMV ARQC Sale, replace the sample ARQC (also called the Authorization Request) with your reader's ARQC output. For the format of that data, see EMV ARQC Type.
Send the request. Pilot uses test systems, so nothing is charged.
To see a reader and Unigate working together in a browser first, try the MMS Unigate Demo. For help getting started with readers, see the RMS reader quickstart.
Before you go to Production
Check your processor's var sheet. Some processors have non-standard requirements, which they list on the var sheet they issue to you.
Build the Production header in code as shown in Step 2. Production credentials don't come pre-encoded.
Contact your assigned solutions architect for processor-specific inputs and outputs, advanced request fields, or anything this guide doesn't cover.
Next steps
Topic
What you'll learn
How initial requests (Sale, Authorize) relate to follow-up actions (Capture, Tip Adjust, Refund, Void).
How Unigate maps processor-specific fields to common keys.
Every Transaction and ReferenceTransaction request, with links into the Postman collection.
Browser demos of Unigate with and without MagTek readers.
Need More Help?
Last updated

