Logo
Merchant Warrior API documentation

Login to Sandbox | Download PDF Version

Navbar

Introduction

Merchant Warrior (MW) is an Australian based payment provider that offers a range of online payment solutions to Merchants worldwide.

MW is a Tier 1 PCI DSS certified provider. This qualification is obtained annually, after an independent audit carried out by a certified QSA and QPSAC.

This information has been provided to assist with the integration and implementation of services to the MW platform.

Production API Endpoint

https://api.merchantwarrior.com/post/

Sandbox API Endpoint

https://base.merchantwarrior.com/post/

Replace snippets below with your merchantUUID, apiKey and correct hash.

Direct API

The following sub-sections will outline the various API methods present in the Merchant Warrior Direct API.

Introduction

The Direct API provides you with a single integration point for processing to your Acquirer(s).

You will need to obtain a Merchant UUID, API Key and API passphrase in order to connect to the Direct API. These details will be issued to you when you create your MW account.

Request Format

API requests are submitted to the Direct API service using POST, and must be performed over HTTPS.

Available Methods

The Direct API service consists of the following methods:
processCard: Performs a purchase transaction on a customer's credit card
processAuth: Performs a pre-authorization on a customer's credit card
processCapture: Performs a capture request
processBatch: Submits a batch file for processing
retrieveBatch: Retrieves the batch status or processed batch file result
refundCard: Performs a refund request
queryCard: Queries previous credit card transactions
processDDebit: Performs a direct debit transaction on a customer's bank account
queryDD: Queries previous direct debit transactions
queryBIN: Queries a Bank Identification Number (BIN)
getSettlement: Returns a list of settled transactions
checkEnrollment: Check if a card is participating 3DS scheme and initiate a 3DS authentication.
checkPARes: Check the result of a 3DS authentication.
addBlacklistedCard: Add a card to the blacklist.
removeBlacklistedCard: Remove a card out of the blacklist.
queryBlacklistedCard: Query a blacklisted card info.

Sample Request
curl -X POST \ 
    -d method="processCard" \
    -d merchantUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d transactionAmount="1.00" \
    -d transactionCurrency="AUD" \
    -d transactionProduct="Test Product" \
    -d customerName="Test Customer" \
    -d customerCountry="AU" \
    -d customerState="QLD" \
    -d customerCity="Brisbane" \
    -d customerAddress="123 Test Street" \
    -d customerPostCode="4000" \
    -d customerPhone="61731665489" \
    -d customerEmail="[email protected]" \
    -d customerIP="1.1.1.1" \
    -d paymentCardName="Test Customer" \
    -d paymentCardNumber="5123456789012346" \
    -d paymentCardExpiry="0521" \
    -d paymentCardCSC="123" \
    -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'processCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'paymentCardCSC' => '123',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'processCard',
  'merchantUUID': '5265f8eed6a19',
  'apiKey': 'ksmnwxab',
  'transactionAmount': '1.00',
  'transactionCurrency': 'AUD',
  'transactionProduct': 'Test Product',
  'customerName': 'Test Customer',
  'customerCountry': 'AU',
  'customerState': 'QLD',
  'customerCity': 'Brisbane',
  'customerAddress': '123 Test Street',
  'customerPostCode': '4000',
  'customerPhone': '61731665489',
  'customerEmail': '[email protected]',
  'customerIP': '1.1.1.1',
  'paymentCardName': 'Test Customer',
  'paymentCardNumber': '5123456789012346',
  'paymentCardExpiry': '0521',
  'paymentCardCSC': '123',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'processCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'paymentCardCSC' => '123',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "processCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },
                        { "customerIP", "1.1.1.1" },
                        { "paymentCardName", "Test Customer" },
                        { "paymentCardNumber", "5123456789012346" },
                        { "paymentCardExpiry", "0521" },
                        { "paymentCardCSC", "123" },
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "processCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionProduct", "Test Product"}, _
                {"customerName", "Test Customer"}, _
                {"customerCountry", "AU"}, _
                {"customerState", "QLD"}, _
                {"customerCity", "Brisbane"}, _
                {"customerAddress", "123 Test Street"}, _
                {"customerPostCode", "4000"}, _
                {"customerPhone", "61731665489"}, _
                {"customerEmail", "[email protected]"}, _
                {"customerIP", "1.1.1.1"}, _
                {"paymentCardName", "Test Customer"}, _
                {"paymentCardNumber", "5123456789012346"}, _
                {"paymentCardExpiry", "0521"}, _
                {"paymentCardCSC", "123"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "processCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionProduct", "TestProduct");
            params.put("customerName", "TestCustomer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");
            params.put("customerIP", "1.1.1.1");
            params.put("paymentCardName", "TestCard");
            params.put("paymentCardNumber", "5123456789012346");
            params.put("paymentCardExpiry", "0521");
            params.put("paymentCardCSC", "123");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Transaction approved</responseMessage>
    <transactionID>1336-20be3569-b600-11e6-b9c3-005056b209e0</transactionID>
    <transactionReferenceID>12345</transactionReferenceID>
    <authCode>731357421</authCode>
    <receiptNo>731357421</receiptNo>
    <authMessage>Honour with identification</authMessage>
    <authResponseCode>08</authResponseCode>
    <authSettledDate>2016-11-29</authSettledDate>
    <paymentCardNumber>512345XXXXXX2346</paymentCardNumber>
    <transactionAmount>1.00</transactionAmount>
    <cardType>mc</cardType>
    <cardExpiryMonth>05</cardExpiryMonth>
    <cardExpiryYear>21</cardExpiryYear>
    <custom1/>
    <custom2/>
    <custom3/>
    <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
</mwResponse>

processCard


The processCard method is the method used to perform a purchase request.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: processCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
transactionProduct Required A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.
transactionReferenceID Not Required This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the queryCard method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters

3DS Parameters

Parameter Required Description
threeDSToken Not Required This parameter is used to indicate if a transaction has been authenticated. Its value is returned by checkPARes method.

Recurring Parameters

Parameter Required Description
recurringFlag Not Required This parameter is used to indicate if a transaction will be marked as recurring. Its value must be 0 or 1.
Example: 1

Customer Parameters

Parameter Required Description
customerName Required This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Must be valid if present. Sending this optional parameter is highly recommended.
Example: [email protected]
Valid length: Up to 255 characters
customerIP Not Required Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended.
Example: 123.456.789.012 or 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Valid length: Up to 39 characters
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Payment Parameters

Parameter Required Description
paymentCardNumber Required Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678).
Example: 5123456789012346 or 4557012345678902
Valid length: Between 13 and 16 digits
paymentCardExpiry Required This must be MMYY format. The month must be zero padded if it is less than 10.
Example: 0513
Valid length: 4 digits
paymentCardName Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 255 characters
paymentCardCSC Not Required This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information.
Example: 123
Valid length: Between 3 and 4 characters

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field. Returned as <custom1> in the XML response.
Valid length: Up to 500 characters
custom2 Not Required Freeform field. Returned as <custom2> in the XML response.
Valid length: Up to 500 characters
custom3 Not Required Freeform field. Returned as <custom3> in the XML response.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST \
    -d method="processAuth" \
    -d merchantUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d transactionAmount="1.00" \
    -d transactionCurrency="AUD" \
    -d transactionProduct="Test Product" \
    -d customerName="Test Customer" \
    -d customerCountry="AU" \
    -d customerState="QLD" \
    -d customerCity="Brisbane" \
    -d customerAddress="123 Test Street" \
    -d customerPostCode="4000" \
    -d customerPhone="61731665489" \
    -d customerEmail="[email protected]" \
    -d customerIP="1.1.1.1" \
    -d paymentCardName="Test Customer" \
    -d paymentCardNumber="5123456789012346" \
    -d paymentCardExpiry="0521" \
    -d paymentCardCSC="123" \
    -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'processAuth',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'paymentCardCSC' => '123',
  'hash' => 'b55552ff426d7e214885465d27ea006221)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'processAuth',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionAmount' : '1.00',
  'transactionCurrency' : 'AUD',
  'transactionProduct' : 'Test Product',
  'customerName' : 'Test Customer',
  'customerCountry' : 'AU',
  'customerState' : 'QLD',
  'customerCity' : 'Brisbane',
  'customerAddress' : '123 Test Street',
  'customerPostCode' : '4000',
  'customerPhone' : '61731665489',
  'customerEmail' : '[email protected]',
  'customerIP' : '1.1.1.1',
  'paymentCardName' : 'Test Customer',
  'paymentCardNumber' : '5123456789012346',
  'paymentCardExpiry' : '0521',
  'paymentCardCSC' : '123',
  'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'processAuth',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'paymentCardCSC' => '123',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "processAuth" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },
                        { "customerIP", "1.1.1.1" },
                        { "paymentCardName", "Test Customer" },
                        { "paymentCardNumber", "5123456789012346" },
                        { "paymentCardExpiry", "0521" },
                        { "paymentCardCSC", "123" },
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "processAuth"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionProduct", "Test Product"}, _
                {"customerName", "Test Customer"}, _
                {"customerCountry", "AU"}, _
                {"customerState", "QLD"}, _
                {"customerCity", "Brisbane"}, _
                {"customerAddress", "123 Test Street"}, _
                {"customerPostCode", "4000"}, _
                {"customerPhone", "61731665489"}, _
                {"customerEmail", "[email protected]"}, _
                {"customerIP", "1.1.1.1"}, _
                {"paymentCardName", "Test Customer"}, _
                {"paymentCardNumber", "5123456789012346"}, _
                {"paymentCardExpiry", "0521"}, _
                {"paymentCardCSC", "123"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "processAuth");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionProduct", "TestProduct");
            params.put("customerName", "TestCustomer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");
            params.put("customerIP", "1.1.1.1");
            params.put("paymentCardName", "TestCard");
            params.put("paymentCardNumber", "5123456789012346");
            params.put("paymentCardExpiry", "0521");
            params.put("paymentCardCSC", "123");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Transaction approved</responseMessage>
    <transactionID>1336-37edc560-b601-11e6-b9c3-005056b209e0</transactionID>
    <transactionReferenceID>12345</transactionReferenceID>
    <authCode>731357433</authCode>
    <receiptNo>731357433</receiptNo>
    <authMessage>Honour with identification</authMessage>
    <authResponseCode>08</authResponseCode>
    <authSettledDate>2016-11-29</authSettledDate>
    <paymentCardNumber>512345XXXXXX2346</paymentCardNumber>
    <transactionAmount>1.00</transactionAmount>
    <cardType>mc</cardType>
    <cardExpiryMonth>05</cardExpiryMonth>
    <cardExpiryYear>21</cardExpiryYear>
    <custom1/>
    <custom2/>
    <custom3/>
    <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
</mwResponse>

processAuth


The processAuth method is used to perform a pre-authorization request.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: processAuth

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
transactionProduct Required A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.
transactionReferenceID Not Required This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the queryCard method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters

3DS Parameters

Parameter Required Description
threeDSToken Not Required This parameter is used to indicate if a transaction has been authenticated. Its value is returned by checkPARes method.

Customer Parameters

Parameter Required Description
customerName Required This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Sending this optional parameter is highly recommended.
Example: [email protected]
Valid length: Up to 255 characters
customerIP Not Required Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended.
Example: 123.456.789.012 or 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Valid length: Up to 39 characters
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Payment Parameters

Parameter Required Description
paymentCardNumber Required Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678).
Example: 5123456789012346 or 4557012345678902
Valid length: Between 13 and 16 digits
paymentCardExpiry Required This must be MMYY format. The month must be zero padded if it is less than 10.
Example: 0513
Valid length: 4 digits
paymentCardName Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 255 characters
paymentCardCSC Not Required This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information.
Example: 123
Valid length: Between 3 and 4 characters

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field. Returned as <custom1> in the XML response.
Valid length: Up to 500 characters
custom2 Not Required Freeform field. Returned as <custom2> in the XML response.
Valid length: Up to 500 characters
custom3 Not Required Freeform field. Returned as <custom3> in the XML response.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST \
  -d method="processCapture" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionAmount="1.00" \
  -d transactionCurrency="AUD" \
  -d transactionID="1336-37edc560-b601-11e6-b9c3-005056b209e0"
  -d captureAmount="1.00"
  -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'processCapture',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
  'captureAmount' => '1.00',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'processCapture',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionAmount' : '1.00',
  'transactionCurrency' : 'AUD',
  'transactionID' : '1336-37edc560-b601-11e6-b9c3-005056b209e0',
  'captureAmount' : '1.00',
  'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'processCapture',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
  'captureAmount' => '1.00',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "processCapture" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0" },
                        { "captureAmount", "1.00" },                        
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "processCapture"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0"}, _
                {"captureAmount", "1.00"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "processCapture");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0");
            params.put("captureAmount", "1.00");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>0</responseCode>
  <responseMessage>Transaction approved</responseMessage>
  <transactionID>1336-fe4d3be6-b604-11e6-b9c3-005056b209e0</transactionID>
  <authCode>731357526</authCode>
  <receiptNo>731357526</receiptNo>
  <authMessage>Approved or completed successfully</authMessage>
  <authResponseCode>00</authResponseCode>
  <authSettledDate>2016-11-30</authSettledDate>
  <custom1/>
  <custom2/>
  <custom3/>
  <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
</mwResponse>

processCapture


The processCapture method is used to perform a capture request.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: processCapture

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required This amount must be the exact amount submitted with the initial transaction. This is used in the verification hash, and is not the amount that will be refunded.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD

Capture Parameters

Parameter Required Description
transactionID Required The <transactionID> is provided to you by Merchant Warrior after an initial pre-authorization (processAuth) transaction.
Example: 1-a1c340c8-7c30-11de-8888-000c29753ad4
transactionReferenceID Not Required This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the queryCard method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters
captureAmount Required The amount is in the same format as transactionAmount. It cannot be less than 0.01 or more than the initial transaction amount.
Example: 10.00

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
  curl -X POST \
  -F "method=processBatch" \
  -F "merchantUUID=5265f8eed6a19" \
  -F "apiKey=ksmnwxab" \
  -F "batchNotifyURL=https://www.mydomain.com/notify" \
  -F "[email protected]" \
  -F "fileHash=eaf937db33027ba345d0d8a788460b81" \
  -F "urlHash=f06d19d9d7311cdcdfc37534a7fd0ea4" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'processBatch',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'batchNotifyURL' => 'https://www.mydomain.com/notify',
  'batchFile' => '@Batch.zip',
  'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
  'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'processBatch',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'batchNotifyURL' : 'https://www.mydomain.com/notify',
  'batchFile' : '@Batch.zip',
  'fileHash' : 'eaf937db33027ba345d0d8a788460b81',
  'urlHash' : 'f06d19d9d7311cdcdfc37534a7fd0ea4'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'processBatch',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'batchNotifyURL' => 'https://www.mydomain.com/notify',
  'batchFile' => '@Batch.zip',
  'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
  'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "processBatch" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "batchNotifyURL", "https://www.mydomain.com/notify" },
                        { "batchFile", "@Batch.zip" },
                        { "fileHash", "eaf937db33027ba345d0d8a788460b81" },
                        { "urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4" },                       
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "processBatch"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"batchNotifyURL", "https://www.mydomain.com/notify"}, _
                {"batchFile", "@Batch.zip"}, _
                {"fileHash", "eaf937db33027ba345d0d8a788460b81"}, _
                {"urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "processBatch");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("batchNotifyURL", "https://www.mydomain.com/notify");
            params.put("batchFile", "@Batch.zip");
            params.put("fileHash", "eaf937db33027ba345d0d8a788460b81");
            params.put("urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4");          

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>0</responseCode>
  <responseMessage>Batch has been successfully submitted.</responseMessage>
  <batchUUID>1336583d3a953ce2d</batchUUID>
</mwResponse>

processBatch


The processBatch method enables merchants to securely automate the processing of batch files containing credit card, token transaction data or bank accounts. This method accepts and processes compressed .csv files directly via the Direct API and should be implemented when automating a large number of transactions is a requirement.

The processBatch method will process a batch file and automatically issue a notification via POST to the merchant’s application when the batch file has completed processing. The batch response file (containing the results to all transactions processed via the original batch file) can be sent (and compressed) with the POST notification if requested by the merchant.

Sample process and response batch files can be found at the Sample Files section.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: processBatch

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Batch Parameters

Parameter Required Description
batchNotifyURL Required Asynchronous POST notifications will be sent to this URL.
Example: https://www.example.com/notify.php
batchResponseFileAttach Not Required The value is a boolean to denote whether a response file should be attached with the asynchronous POST notifications.
Example: 1
batchResponseFileCompress Not Required The value is a boolean to denote whether the response file should be compressed (.zip).
Example: 1

Batch File Parameters

Parameter Required Description
batchFile Required The batch file must be in CSV format (.csv) and compressed (.zip).
Example: Batch.zip
fileHash Required The hash of the batch file. See Batch File Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters

Verification Hash

Parameter Required Description
urlHash Required The hash of the batchNotifyURL. See Batch URL Hash for information on how to construct the hash correctly.
Example: 511999e54b9ad51ce4c28d7f0550ac81
Valid length: 32 characters
Sample Request
curl -X POST \
  -d method="retrieveBatch" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d batchUUID="1336583d3a953df2d" \
  -d hash="fb0e9b2a729d0fda759ui658cb8c2b20" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'retrieveBatch',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'batchUUID' => '1336583d3a953df2d',
  'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'retrieveBatch',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'batchUUID' : '1336583d3a953df2d',
  'hash' : 'fb0e9b2a729d0fda759ui658cb8c2b20'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'retrieveBatch',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'batchUUID' => '1336583d3a953df2d',
  'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "retrieveBatch" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "batchUUID", "1336583d3a953df2d" },                       
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "retrieveBatch"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"batchUUID", "1336583d3a953df2d"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "retrieveBatch");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("batchUUID", "1336583d3a953df2d");
            params.put("hash", "fb0e9b2a729d0fda759ui658cb8c2b20");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
                postData.append(param.getKey());
                postData.append('=');
                postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
"Transaction ID","Result","Amount","Currency","Created Date","Created Time","Processed Date","Processed Time","Card Name/Card ID","Card Number/Card Key","Custom 1","Custom 2","Custom 3","Store ID","Type","MW Response","Provider Response"
"1336-45a61a65-b60e-11e6-b9c3-005056b209e0","Fail","23.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:49","Test Customer","5123xxxxxxxx2346","JaYfKnIbVlAx","NyYiVwKwFcUk","VyJvNpVgWgUu","","purchase","Transaction declined","42 - No universal account"
"1336-45e0d356-b60e-11e6-b9c3-005056b209e0","Fail","58.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","YvMcYhKwPtNo","ReMkHxIsKaFe","WuYiJhWoOuUq","","purchase","Transaction declined","42 - No universal account"
"1336-460cc7af-b60e-11e6-b9c3-005056b209e0","Fail","95.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WmVaZgVcNmIi","BlVkOnKoMsHo","PtEwVqShSnWp","","purchase","Transaction declined","42 - No universal account"
"1336-463779d5-b60e-11e6-b9c3-005056b209e0","Fail","84.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WhSkJgUxDaDr","JxMmMrAjUeJp","SpMtMtReQwHo","","purchase","Transaction declined","42 - No universal account"
"1336-465d56ec-b60e-11e6-b9c3-005056b209e0","Fail","36.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","NpAvSjMjShOo","MsIdHfBdBeVx","TkIlCoQjDvCd","","purchase","Transaction declined","42 - No universal account"
"1336-468b285d-b60e-11e6-b9c3-005056b209e0","Fail","76.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","ZsVfXdAtWxGd","ZeChZtSlZxLp","QtKhXnSoTjDv","","purchase","Transaction declined","42 - No universal account"
"1336-46b4bf03-b60e-11e6-b9c3-005056b209e0","Fail","41.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","DbCpNjWsBaSe","XdErQtJkVoUh","AmYdWjSwEmEs","","purchase","Transaction declined","42 - No universal account"
"1336-46e0e0d5-b60e-11e6-b9c3-005056b209e0","Fail","62.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","IsGhDeYnNyJn","BjQsDcBkCpXo","JgMnRxSgMwIe","","purchase","Transaction declined","42 - No universal account"
"1336-470c772d-b60e-11e6-b9c3-005056b209e0","Fail","27.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","NaWuNoUmYmCj","OdCoTdJbLkZp","SfEbKqAxNrRx","","purchase","Transaction declined","42 - No universal account"
"1336-4732f831-b60e-11e6-b9c3-005056b209e0","Fail","6.00","AUD","29/11/2016","18:31:52","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","BmAuNyDtSkYt","PyBvKnTyYpZe","JlAdLmXaBnFc","","purchase","Transaction declined","42 - No universal account"

retrieveBatch


The retrieveBatch method is the method used to retrieve the results of a batch file that has been processed via the processBatch method (see above). This method returns a .csv or .zip (depending on whether the merchant requested a compressed response file) file containing the results of all transactions submitted in the original batch file.

Sample process and response batch files can be found at the Sample Files section

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: retrieveBatch

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Batch Parameters

Parameter Required Description
batchUUID Required The value of this parameter is assigned to you by Merchant Warrior for every processBatch request.
Example: 14dc3311444adc

Verification Hash

Parameter Required Description
hash Required The hash of the batchUUID. See Batch Response Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
  curl -X POST \
  -d method="refundCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionAmount="1.00" \
  -d transactionCurrency="AUD" \
  -d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209f0" \
  -d refundAmount="1.00" \
  -d hash="b55552ff426d7e3d4635334th7ea0067" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'refundCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
  'refundAmount' => '1.00',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'refundCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionAmount' : '1.00',
  'transactionCurrency' : 'AUD',
  'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056b209f0',
  'refundAmount' : '1.00',
  'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'refundCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
  'refundAmount' => '1.00',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "refundCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0" },
                        { "refundAmount", "1.00" },                       
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "refundCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0"}, _
                {"refundAmount", "1.00"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "refundCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0");
            params.put("refundAmount", "1.00");           
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
                postData.append(param.getKey());
                postData.append('=');
                postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>0</responseCode>
  <responseMessage>Transaction approved</responseMessage>
  <transactionID>1336-1b7762bc-b610-11e6-b9c3-005056b209e0</transactionID>
  <transactionReferenceID>12345</transactionReferenceID>
  <authCode>731357634</authCode>
  <receiptNo>731357634</receiptNo>
  <authMessage>Honour with identification</authMessage>
  <authResponseCode>08</authResponseCode>
  <authSettledDate>2016-11-30</authSettledDate>
  <custom1/>
  <custom2/>
  <custom3/>
  <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
</mwResponse>

refundCard


The refundCard method is used to perform a refund of an existing purchase or capture transaction.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: refundCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required This amount must be the exact amount submitted with the initial transaction. This is used in the verification hash, and is not the amount that will be refunded.
Example: 10.00
transactionCurrency Required The currency must match the one submitted with the initial transaction. This is used in the verification hash.
Example: AUD
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Refund Parameters

Parameter Required Description
transactionID Required The <transactionID> returned for the initial transaction.
Example: 1-a1c340c8-7c30-11de-8888-000c29753ad4
transactionReferenceID Not Required This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the queryCard method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters
refundAmount Required The amount is in the same format as transactionAmount. It cannot be less than 0.01 or more than the initial transaction amount.
Example: 10.00

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
  curl -X POST \
  -d method="queryCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionID="1336-20be3569-b600-11e6-b9c3-005056e109e0" \
  -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },                      
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "queryCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "queryCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionID", 
              "1336-20be3569-b600-11e6-b9c3-005056e109e0");           
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
                postData.append(param.getKey());
                postData.append('=');
                postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", 
              "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
              new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
              sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'queryCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>0</responseCode>
  <responseMessage>Transaction approved</responseMessage>
  <transactionID>1336-20be3569-b600-11e6-b9c3-005056e109e0</transactionID>
  <authCode>731357421</authCode>
  <receiptNo>731357421</receiptNo>
  <authMessage>Honour with identification</authMessage>
  <authResponseCode>08</authResponseCode>
  <authSettledDate>2016-11-29</authSettledDate>
  <refundTotal>1.00</refundTotal>
  <custom1/>
  <custom2/>
  <custom3/>
  <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
</mwResponse>
Sample 'extended' Request
  curl -X POST \
  -d method="queryCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209e0" \
  -d extended="1" \
  -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'extended' => '1',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },
                        { "extended", "1" },                    
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "queryCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
                {"extended", "1"} _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "queryCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionID", 
                "1336-20be3569-b600-11e6-b9c3-005056e109e0");
            params.put("extended", "1");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
                postData.append(param.getKey());
                postData.append('=');
                postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", 
                "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'extended' => '1',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'queryCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
  'extended' : '1',
  'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
Sample 'extended' Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>0</responseCode>
  <responseMessage>Transaction approved</responseMessage>
  <transactionID>1336-20be3569-b600-11e6-b9c3-005056b209e0</transactionID>
  <transactionReferenceID>12345</transactionReferenceID>
  <authCode>731357421</authCode>
  <receiptNo>731357421</receiptNo>
  <authMessage>Honour with identification</authMessage>
  <authResponseCode>08</authResponseCode>
  <authSettledDate>2016-11-29</authSettledDate>
  <refundTotal>1.00</refundTotal>
  <custom1/>
  <custom2/>
  <custom3/>
  <customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
  <transactionProduct>Test Product</transactionProduct>
  <customerName>Test Customer</customerName>
  <customerCountry>AU</customerCountry>
  <customerState>QLD</customerState>
  <customerCity>Brisbane</customerCity>
  <customerAddress>123 Test Street</customerAddress>
  <customerPostcode>4000</customerPostcode>
  <customerPhone>61731665489</customerPhone>
  <customerEmail>[email protected]</customerEmail>
  <transactionAmount>1.00</transactionAmount>
  <transactionCurrency>AUD</transactionCurrency>
  <cardName>Test Customer</cardName>
  <cardNumberFirst>4564</cardNumberFirst>
  <cardNumberLast>0004</cardNumberLast>
</mwResponse>

queryCard


The queryCard method is used to perform a query of an existing transaction. If you lose the original response, never receive a response, or if you wish to verify a response, you can use this method.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: queryCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Query Parameters

Parameter Required Description
transactionID Required/ Not Required The <transactionID> returned for the initial transaction.
Example: 1-a1c340c8-7c30-11de-8888-000c29753ad4
transactionReferenceID Required/ Not Required The <transactionReferenceID> sent for the initial transaction. This is a merchant’s reference ID for a transaction request sent to Merchant Warrior.
Example: A257240023321
extended Not Required Returns additional information stored with the transaction. This must be in boolean format.
Example: 1

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Query Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters


Sample Request
  curl -X POST \
  -d method="processDDebit" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionAmount="1.00" \
  -d transactionCurrency="AUD" \
  -d transactionProduct="A1234" \
  -d customerName="Test Customer" \
  -d customerCountry="AU" \
  -d customerState="QLD" \
  -d customerCity="Brisbane" \
  -d customerAddress="123 Test Street" \
  -d customerPostCode="4000" \
  -d customerPhone="61731665489" \
  -d customerEmail="[email protected]" \
  -d customerIP="1.1.1.1" \
  -d paymentAccountBSB="014667" \
  -d paymentAccountNumber="12345678" \
  -d paymentAccountName="Test Customer" \
  -d hash="f518187f47bc52fe5a76a18593df72c9" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'processDDebit',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'A1234',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentAccountBSB' => '014667',
  'paymentAccountNumber' => '12345678',
  'paymentAccountName' => 'Test Customer',
  'hash' => 'f518187f47bc52fe5a76a18593df72c9'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'processDDebit',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionAmount' : '1.00',
  'transactionCurrency' : 'AUD',
  'transactionProduct' : 'A1234',
  'customerName' : 'Test Customer',
  'customerCountry' : 'AU',
  'customerState' : 'QLD',
  'customerCity' : 'Brisbane',
  'customerAddress' : '123 Test Street',
  'customerPostCode' : '4000',
  'customerPhone' : '61731665489',
  'customerEmail' : '[email protected]',
  'customerIP' : '1.1.1.1',
  'paymentAccountBSB' : '014667',
  'paymentAccountNumber' : '12345678',
  'paymentAccountName' : 'Test Customer',
  'hash' : 'f518187f47bc52fe5a76a18593df72c9'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'processDDebit',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'A1234',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'customerIP' => '1.1.1.1',
  'paymentAccountBSB' => '014667',
  'paymentAccountNumber' => '12345678',
  'paymentAccountName' => 'Test Customer',
  'hash' => 'f518187f47bc52fe5a76a18593df72c9'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "processDDebit" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },
                        { "customerIP", "1.1.1.1" },
                        { "paymentAccountBSB", "014667" },
                        { "paymentAccountNumber", "12345678" },
                        { "paymentAccountName", "Test Customer" },
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "processDDebit"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionProduct", "Test Product"}, _
                {"customerName", "Test Customer"}, _
                {"customerCountry", "AU"}, _
                {"customerState", "QLD"}, _
                {"customerCity", "Brisbane"}, _
                {"customerAddress", "123 Test Street"}, _
                {"customerPostCode", "4000"}, _
                {"customerPhone", "61731665489"}, _
                {"customerEmail", "[email protected]"}, _
                {"customerIP", "1.1.1.1"}, _
                {"paymentAccountBSB", "014667"}, _
                {"paymentAccountNumber", "12345678"}, _
                {"paymentAccountName", "Test Customer"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "processDDebit");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionProduct", "TestProduct");
            params.put("customerName", "TestCustomer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");
            params.put("customerIP", "1.1.1.1");
            params.put("paymentAccountBSB", "014667");
            params.put("paymentAccountNumber", "12345678");
            params.put("paymentAccountName", "TestCustomer");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>10</responseCode>
  <responseMessage>Transaction pending</responseMessage>
  <transactionID>1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0</transactionID>
  <transactionReferenceID>12345</transactionReferenceID>
  <settlementDate>2016-12-05</settlementDate>
  <custom1>1</custom1>
  <custom2>2</custom2>
  <custom3>3</custom3>
  <customHash>f696e286657237370aa37cfdd9a8c61c</customHash>
</mwResponse>
Sample DDNotifyUrl
<?php
$passphrase = 'YOURPASSPHRASE';
$uploadDir = '/tmp/';

if(!empty($_SERVER['HTTP_MWFILEHASH']) && !empty($_FILES) && !empty($_FILES['file_contents']) && !empty($_FILES['file_contents']['name'])) {
    $responseHash = $_SERVER['HTTP_MWFILEHASH'];
    $filePath = $_FILES['file_contents']['tmp_name'];
    $fileName = $_FILES['file_contents']['name'];
    $testHash = md5(strtolower(md5($passphrase).md5_file($filePath)));
    if($responseHash == $testHash) {
        //fileHash valid
        $tmpPath = $_FILES['file_contents']['tmp_name'];
        $uploadPath = $uploadDir . $fileName;
        if(move_uploaded_file($tmpPath, $uploadPath)) {
            //Do something with file
            //File retrievable from $uploadPath
        }
        else {
            //file invalid
        }

    } else {
        //fileHash invalid
    }
}
exit();


?>

processDDebit


The processDDebit method is used to perform a direct debit request to debit funds from an Australian or New Zealand bank account.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: processDDebit

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
transactionProduct Required A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters
transactionReferenceID Not Required This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the queryCard method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters

Customer Parameters

Parameter Required Description
customerName Required This field can only contain alphanumeric characters, as well as the full stop, comma, aposprophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Sending this optional parameter is highly recommended.
Example: [email protected]
Valid length: Up to 255 characters
customerIP Not Required Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended.
Example: 123.456.789.012 or 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Valid length: Up to 39 characters
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Payment Parameters

Parameter Required Description
paymentAccountBSB Required This field must contain 6 digits.
Example: 011123
Valid length: 6 digits
paymentAccountNumber Required This must be a valid account number.
Example: 123456789
Valid length: 4-10 digits
paymentAccountName Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 32 characters

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field. Returned as <custom1> in the XML response.
Valid length: Up to 500 characters
custom2 Not Required Freeform field. Returned as <custom2> in the XML response.
Valid length: Up to 500 characters
custom3 Not Required Freeform field. Returned as <custom3> in the XML response.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
  curl -X POST \
  -d method="queryDD" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d transactionID="1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" \
  -d hash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryDD',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
  'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'queryDD',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'transactionID' : '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
  'hash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryDD',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
  'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryDD" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" },                        
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "queryDD"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "queryDD");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                  postData.append('&');
                  postData.append(param.getKey());
                  postData.append('=');
                  postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
  <responseCode>10</responseCode>
  <responseMessage>Transaction pending</responseMessage>
  <transactionID>1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0</transactionID>
  <settlementDate/>
  <custom1/>
  <custom2/>
  <custom3/>
  <customHash>9e71fc2a99a71b722ead746b776b25ac</customHash>
</mwResponse>

queryDD


The queryDD method is the method used to perform a query of an existing direct debit transaction. If you wish to verify the status of a transaction or lost the original response or never receive a response, you can use this method. This method will query the internal MW records and return the available stored data for the transaction.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: queryDD

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Query Parameters

Parameter Required Description
transactionID Required/ Not Required The <transactionID> returned for the initial transaction.
Example: 1-a1c340c8-7c30-11de-8888-000c29753ad4
transactionReferenceID Required/ Not Required The <transactionReferenceID> sent for the initial transaction. This is a merchant’s reference ID for a transaction request sent to Merchant Warrior.
Example: A257240023321
extended Not Required Returns additional information stored with the transaction. This must be in boolean format.
Example: 1

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Query Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters


Sample Request
  curl -X POST \
  -d method="queryBIN" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d bin="512346" \
  -d binHash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryBIN',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'bin' => '512346',
  'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'queryBIN',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'bin' : '512346',
  'binHash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryBIN',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'bin' => '512346',
  'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'bin' => (isset($xml['bin']) ? $xml['bin'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryBIN" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "bin", "512346" },                        
                        { "binHash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
            }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "queryBIN"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"bin", "512346"}, _
                {"binHash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "queryBIN");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("bin", "512346");
            params.put("binHash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                  postData.append('&');
                  postData.append(param.getKey());
                  postData.append('=');
                  postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?> 
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <bin>456442</bin>
    <bank_name>COMMONWEALTH BANK OF AUSTRALIA</bank_name>
    <type>CREDIT</type>
    <country>AU</country>
    <brand>VISA</brand>
    <rate/>
    <recurring_rate/>
    <name>CLASSIC</name>
</mwResponse>

queryBIN


The queryBIN method is used to determine the banking information (Bank Name, Card Type, Card Country etc) related to a credit/debit card's Bank Identification Number (BIN).

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: queryBIN

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Query Parameters

Parameter Required Description
bin Required The six digit BIN of the credit/debit card.
Example: 512346

Verification Hash

Parameter Required Description
binHash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See BIN Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters


Sample Request
  curl -X POST \
  -d method="getSettlement" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d settlementFrom="2017-05-01" \
  -d settlementTo="2017-05-02" \
  -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "getSettlement" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "settlementFrom", "2017-05-01" }, 
                        { "settlementTo", "2017-05-02" },                     
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "getSettlement"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"settlementFrom", "2017-05-01"},
                {"settlementTo", "2017-05-02"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "getSettlement");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("settlementFrom", "2017-05-01");
            params.put("settlementTo", "2017-05-02");           
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
                postData.append(param.getKey());
                postData.append('=');
                postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", 
              "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
              new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
              sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'getSettlement',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'settlementFrom' => '2017-05-01',
  'settlementTo' => '2017-05-02',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'getSettlement',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'settlementFrom' : '2017-05-01',
  'settlementTo' : '2017-05-02',
  'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'getSettlement',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'settlementFrom' => '2017-04-25',
  'settlementTo' => '2017-04-30',
  'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);


// Setup CURL defaults
$curl = curl_init();

$tmpFile = '/tmp/settlement.zip';
$tmpZip = fopen($tmpFile, 'w+');

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_FILE, $tmpZip);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

curl_close($curl);
fclose($tmpZip);

// Example of outputting Zip contents

$zip = zip_open($tmpFile);

if ($zip)
  {
  while ($zip_entry = zip_read($zip))
    {
    echo "Filename: " . zip_entry_name($zip_entry) . "\n\n";

    if (zip_entry_open($zip, $zip_entry))
      {
      $contents = zip_entry_read($zip_entry);
      echo "$contents\n\n";
      zip_entry_close($zip_entry);
      }
  }

zip_close($zip);

// Delete zip file when finished with it
unlink($tmpFile);
}

?>
Sample Response
A Zip file containing a CSV list of transactions will be returned.

getSettlement


The getSettlement method will return a compressed Zip archive that contains a CSV file with a list of transactions that have settled between the dates specified in the request.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: getSettlement

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Query Parameters

Parameter Required Description
settlementFrom Required The settlement start range date. This parameter cannot be greater than the settlementTo parameter.
Example: 2017-05-01
settlementTo Required The settlement end range date. The parameter cannot be a future date. The maximum value for this parameter is today's date.
Example: 2017-05-02

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Settlement Type Hash for information on how to construct the hash correctly.
Example: f7a04ace7b0c5bf8f24a49bfc73d3805
Valid length: 32 characters


Sample Request
curl -X POST \ 
    -d method="checkEnrollment" \
    -d merchantUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d transactionAmount="1.00" \
    -d transactionCurrency="AUD" \
    -d transactionProduct="Test Product" \  
    -d customerIP="1.1.1.1" \
    -d paymentCardName="Test Customer" \
    -d paymentCardNumber="5123456789012346" \
    -d paymentCardExpiry="0521" \
    -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'checkEnrollment',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'checkEnrollment',
  'merchantUUID': '5265f8eed6a19',
  'apiKey': 'ksmnwxab',
  'transactionAmount': '1.00',
  'transactionCurrency': 'AUD',
  'transactionProduct': 'Test Product',
  'customerIP': '1.1.1.1',
  'paymentCardName': 'Test Customer',
  'paymentCardNumber': '5123456789012346',
  'paymentCardExpiry': '0521',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'checkEnrollment',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerIP' => '1.1.1.1',
  'paymentCardName' => 'Test Customer',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0521',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "checkEnrollment" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionProduct", "Test Product" },                       
                        { "customerIP", "1.1.1.1" },
                        { "paymentCardName", "Test Customer" },
                        { "paymentCardNumber", "5123456789012346" },
                        { "paymentCardExpiry", "0521" },
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "checkEnrollment"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionProduct", "Test Product"}, _                
                {"customerIP", "1.1.1.1"}, _
                {"paymentCardName", "Test Customer"}, _
                {"paymentCardNumber", "5123456789012346"}, _
                {"paymentCardExpiry", "0521"}, _
                {"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "checkEnrollment");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionProduct", "TestProduct");            
            params.put("customerIP", "1.1.1.1");
            params.put("paymentCardName", "TestCard");
            params.put("paymentCardNumber", "5123456789012346");
            params.put("paymentCardExpiry", "0521");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <acsURL>https://example.aspx?ReqType=0</acsURL>
    <paReq>eNpVUsFu2zAMvesrchjQ</paReq>
    <enrolled>Y</Enrolled>
    <eci>5</Eci>
</mwResponse>

checkEnrollment


The checkEnrollment method is the method used to initiate a 3DS authentication.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: checkEnrollment

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
transactionProduct Required A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.

Customer Parameters

Parameter Required Description
customerIP Not Required Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended.
Example: 123.456.789.012 or 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Valid length: Up to 39 characters

Payment Parameters

Parameter Required Description
paymentCardNumber Required Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678).
Example: 5123456789012346 or 4557012345678902
Valid length: Between 13 and 16 digits
paymentCardExpiry Required This must be MMYY format. The month must be zero padded if it is less than 10.
Example: 0513
Valid length: 4 digits
paymentCardName Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 255 characters
paymentCardCSC Not Required This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information.
Example: 123
Valid length: Between 3 and 4 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST \ 
    -d method="checkPARes" \
    -d merchantUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d PARes="eJzNWVmvm9iy/it" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'checkPARes',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'PARes' => 'eJzNWVmvm9iy/it'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'checkPARes',
  'merchantUUID': '5265f8eed6a19',
  'apiKey': 'ksmnwxab',
  'PARes': 'eJzNWVmvm9iy/it'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'checkPARes',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'PARes' => 'eJzNWVmvm9iy/it'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "checkPARes" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "PARes", "eJzNWVmvm9iy/it" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "checkPARes"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"PARes", "eJzNWVmvm9iy/it"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "checkPARes");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("PARes", "eJzNWVmvm9iy/it");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <threeDSToken>8e86aef68037e8849980</threeDSToken>
    <threeDSResult>N</threeDSResult>
    <threeDSEci>7</threeDSEci>
    <threeDSXid>857e2347c329eec31c75</threeDSXid>
    <threeDSCavv></threeDSCavv>
</mwResponse>

checkPARes


The checkPARes method is the method used to verify a 3DS result.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: checkPARes

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

3DS Verification Parameters

Parameter Required Description
PARes Required The value of this parameter is returned by Customer's issuer bank.
Example: eJzNWVmvm9iy/it
Sample Request
curl -X POST \
  -d method="addBlacklistedCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d cardName="Test Customer" \
  -d cardNumber="5123456789012346" \
  -d cardExpiryMonth="05" \
  -d cardExpiryYear="17" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'addBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardName' => 'Test Customer',
  'cardNumber' => '5123456789012346',
  'cardExpiryMonth' => '05',
  'cardExpiryYear' => '17'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'addBlacklistedCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'cardName' : 'Test Customer',
  'cardNumber' : '5123456789012346',
  'cardExpiryMonth' : '05',
  'cardExpiryYear' : '17'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'addBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardName' => 'Test Customer',
  'cardNumber' => '5123456789012346',
  'cardExpiryMonth' => '05',
  'cardExpiryYear' => '17'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "addBlacklistedCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "cardName", "Test Customer" },
                        { "cardNumber", "5123456789012346" },
                        { "cardExpiryMonth", "05" },
                        { "cardExpiryYear", "17" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "addBlacklistedCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"cardName", "Test Customer"}, _
                {"cardNumber", "5123456789012346"}, _
                {"cardExpiryMonth", "05"}, _
                {"cardExpiryYear", "17"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "addBlacklistedCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("cardName", "TestCustomer");
            params.put("cardNumber", "5123456789012346");
            params.put("cardExpiryMonth", "05");
            params.put("cardExpiryYear", "17");            

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <cardID>5bee5e25c09bb</cardID>
    <cardNumberFirst>512345</cardNumberFirst>
    <cardNumberLast>2346</cardNumberLast>
    <cardExpiryMonth>05</cardExpiryMonth>
    <cardExpiryYear>21</cardExpiryYear>
</mwResponse>

addBlacklistedCard


The addBlacklistedCard method is used to add a card into the merchant blacklist.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: addBlacklistedCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Cardholder Data

Parameter Required Description
cardName Required The name of card holder.
Example: NUFM56937091
Maximum length: 255 digits
cardNumber Required The full card number.
Example: 4557012345678902
Valid length: Between 13 and 16 digits
cardExpiryMonth Required This must be MM format. The month must be zero padded if it is less than 10.
Example: 05
Valid length: 2 digits
cardExpiryYear Required This must be YY format.
Example: 13
Valid length: 2 digits

Verification Hash

Parameter Required Description
secureHash Required The verification hash is a combination of the full parameters sent in the request and the MD5 of your API Passphrase. See Secure Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST \
  -d method="removeBlacklistedCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'removeBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardID' => '5bee5e25c09bb'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'removeBlacklistedCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'cardID' : '5bee5e25c09bb'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'removeBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardID' => '5bee5e25c09bb'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "removeBlacklistedCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "cardID", "5bee5e25c09bb" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "removeBlacklistedCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"cardID", "5bee5e25c09bb"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "removeBlacklistedCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("cardID", "5bee5e25c09bb");            

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <cardName>Bob Jones</cardName>
    <cardNumberFirst>512345</cardNumberFirst>
    <cardNumberLast>2346</cardNumberLast>
    <cardExpiryMonth>05</cardExpiryMonth>
    <cardExpiryYear>21</cardExpiryYear>
</mwResponse>

removeBlacklistedCard


The removeBlacklistedCard method is used to remove a card out of the merchant blacklist.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: addBlacklistedCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Cardholder Data

Parameter Required Description
cardID Required A unique alphanumeric string returned by addBlacklistedCard, used to identify a specific card.
Example: 5bee5e25c09bb
Sample Request
curl -X POST \
  -d method="queryBlacklistedCard" \
  -d merchantUUID="5265f8eed6a19" \
  -d apiKey="ksmnwxab" \
  -d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardID' => '5bee5e25c09bb'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method' : 'queryBlacklistedCard',
  'merchantUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'cardID' : '5bee5e25c09bb'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryBlacklistedCard',
  'merchantUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'cardID' => '5bee5e25c09bb'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
  throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryBlacklistedCard" },
                        { "merchantUUID", "578dd399d2373" },
                        { "apiKey", "dyqxkzse" },
                        { "cardID", "5bee5e25c09bb" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/",
            New System.Collections.Specialized.NameValueCollection() From { _
                {"method", "queryBlacklistedCard"}, _
                {"merchantUUID", "578dd399d2373"}, _
                {"apiKey", "dyqxkzse"}, _
                {"cardID", "5bee5e25c09bb"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "removeBlacklistedCard");
            params.put("merchantUUID", "5265f8eed6a19");
            params.put("apiKey", "ksmnwxab");
            params.put("cardID", "5bee5e25c09bb");            

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <cardName>Bob Jones</cardName>
    <cardNumberFirst>512345</cardNumberFirst>
    <cardNumberLast>2346</cardNumberLast>
    <cardExpiryMonth>05</cardExpiryMonth>
    <cardExpiryYear>21</cardExpiryYear>
</mwResponse>

queryBlacklistedCard


The queryBlacklistedCard method is used to query a card info in the merchant black list.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: queryBlacklistedCard

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Cardholder Data

Parameter Required Description
cardID Required A unique alphanumeric string returned by addBlacklistedCard, used to identify a specific card.
Example: 5bee5e25c09bb
global Not Required The value indicates the query is based on your black card list or Merchant Warrior global black list. Must be 0 or 1.
Example: 1
Production API Endpoint

https://api.merchantwarrior.com/partner/

Sandbox API Endpoint

https://base.merchantwarrior.com/partner/

Replace snippets below with your partnerUUID, apiKey and correct hash.

Partner API

The following sub-sections will outline information in relation to the Merchant Warrior Partner API.

Introduction

The Merchant Warrior Partner API enables approved development and industry partners to generate merchant accounts in real-time.

You will need to obtain a Partner UUID, API Key and API passphrase in order to use this feature. These details will be made available to you after your Partner application has been processed.

Request Format

API requests are submitted to this service using POST, and must be performed over HTTPS.

Available Methods
addMerchant: Create an MW merchant account
checkMerchant: Check a merchant creation request

Sample Request
curl -X POST \ 
    -d method="addMerchant" \
    -d partnerUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d merchantCompanyLegalName="Test Company Pty Ltd"
    -d merchantCompanyTradingName="Test Company"
    -d merchantCompanyRegNumber="123456789" 
    -d merchantCountry="AU" \
    -d merchantState="QLD" \
    -d merchantCity="Brisbane" \
    -d merchantStreet="123 Test Street" \
    -d merchantPostcode="4000" \
    -d merchantTimezone="Australia/Brisbane" \
    -d merchantIndustry="Professional Services" \
    -d merchantWebsite="http://www.merchantwarrior.com" \
    -d merchantContactName="join" \
    -d merchantContactEmail="[email protected]" \
    -d merchantContactPhone="61731665489" \
    -d merchantContactMobile="61731665489" \
    -d merchantBillingContactName="join" \
    -d merchantBillingContactEmail="[email protected]" \
    -d fileAttachments="@/var/tmp/bankstatement.zip" \
    -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/partner/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/partner/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'addMerchant',
  'partnerUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'merchantCompanyLegalName' => 'Test Company Pty Ltd',
  'merchantCompanyTradingName' => 'Test Company',
  'merchantCompanyRegNumber' => '123456789',
  'merchantCountry' => 'AU',
  'merchantState' => 'QLD',
  'merchantCity' => 'Brisbane',
  'merchantStreet' => '123 Test Street',
  'merchantPostcode' => '4000',
  'merchantTimezone' => 'Australia/Brisbane',
  'merchantIndustry' => 'Professional Services',
  'merchantWebsite' => 'http://www.merchantwarrior.com',
  'merchantContactName' => 'join',
  'merchantContactEmail' => '[email protected]',
  'merchantContactMobile' => '61731665489',
  'merchantWebsite' => '61731665489',
  'merchantBillingContactName' => 'join',
  'merchantBillingContactEmail' => '[email protected]',
  'fileAttachments' => '@/var/tmp/bankstatement.zip',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = { 
  'method' : 'addMerchant',
  'partnerUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'merchantCompanyLegalName' : 'Test Company Pty Ltd',
  'merchantCompanyTradingName' : 'Test Company',
  'merchantCompanyRegNumber' : '123456789',
  'merchantCountry' : 'AU',
  'merchantState' : 'QLD',
  'merchantCity' : 'Brisbane',
  'merchantStreet' : '123 Test Street',
  'merchantPostcode' : '4000',
  'merchantTimezone' : 'Australia/Brisbane',
  'merchantIndustry' : 'Professional Services',
  'merchantWebsite' : 'http://www.merchantwarrior.com',
  'merchantContactName' : 'join',
  'merchantContactEmail' : '[email protected]',
  'merchantContactMobile' : '61731665489',
  'merchantWebsite' : '61731665489',
  'merchantBillingContactName' : 'join',
  'merchantBillingContactEmail' : '[email protected]',
  'fileAttachments' : '@/var/tmp/bankstatement.zip',
  'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/partner/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/partner/');

// Setup POST data
$postData = array (
  'method' => 'addMerchant',
  'partnerUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'merchantCompanyLegalName' => 'Test Company Pty Ltd',
  'merchantCompanyTradingName' => 'Test Company',
  'merchantCompanyRegNumber' => '123456789',
  'merchantCountry' => 'AU',
  'merchantState' => 'QLD',
  'merchantCity' => 'Brisbane',
  'merchantStreet' => '123 Test Street',
  'merchantPostcode' => '4000',
  'merchantTimezone' => 'Australia/Brisbane',
  'merchantIndustry' => 'Professional Services',
  'merchantWebsite' => 'http://www.merchantwarrior.com',
  'merchantContactName' => 'join',
  'merchantContactEmail' => '[email protected]',
  'merchantContactMobile' => '61731665489',
  'merchantWebsite' => '61731665489',
  'merchantBillingContactName' => 'join',
  'merchantBillingContactEmail' => '[email protected]',
  'fileAttachments' => '@/var/tmp/bankstatement.zip',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

exit(var_dump($xml));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/partner/", 
                    new System.Collections.Specialized.NameValueCollection() {                   
                        {'method' , 'addMerchant'},
                        {'partnerUUID' , '5265f8eed6a19'},
                        {'apiKey' , 'ksmnwxab'},
                        {'merchantCompanyLegalName' , 'Test Company Pty Ltd'},
                        {'merchantCompanyTradingName' , 'Test Company'},
                        {'merchantCompanyRegNumber' , '123456789'},
                        {'merchantCountry' , 'AU'},
                        {'merchantState' , 'QLD'},
                        {'merchantCity' , 'Brisbane'},
                        {'merchantStreet' , '123 Test Street'},
                        {'merchantPostcode' , '4000'},
                        {'merchantTimezone' , 'Australia/Brisbane'},
                        {'merchantIndustry' , 'Professional Services'},
                        {'merchantWebsite' , 'http://www.merchantwarrior.com'},
                        {'merchantContactName' , 'join'},
                        {'merchantContactEmail' , '[email protected].com'},
                        {'merchantContactMobile' , '61731665489'},
                        {'merchantWebsite' , '61731665489'},
                        {'merchantBillingContactName' , 'join'},
                        {'merchantBillingContactEmail' , '[email protected].com'},
                        {'fileAttachments' , '@/var/tmp/bankstatement.zip'},
                        {'hash' , 'b55552ff426d7e3d4885465d27ea0062'},
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/partner/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {'method' , 'addMerchant'}, _
                {'partnerUUID' , '5265f8eed6a19'}, _
                {'apiKey' , 'ksmnwxab'}, _
                {'merchantCompanyLegalName' , 'Test Company Pty Ltd'}, _
                {'merchantCompanyTradingName' , 'Test Company'}, _
                {'merchantCompanyRegNumber' , '123456789'}, _
                {'merchantCountry' , 'AU'}, _
                {'merchantState' , 'QLD'}, _
                {'merchantCity' , 'Brisbane'}, _
                {'merchantStreet' , '123 Test Street'}, _
                {'merchantPostcode' , '4000'}, _
                {'merchantTimezone' , 'Australia/Brisbane'}, _
                {'merchantIndustry' , 'Professional Services'}, _
                {'merchantWebsite' , 'http://www.merchantwarrior.com'}, _
                {'merchantContactName' , 'join'}, _
                {'merchantContactEmail' , '[email protected]'}, _
                {'merchantContactMobile' , '61731665489'}, _
                {'merchantWebsite' , '61731665489'}, _
                {'merchantBillingContactName' , 'join'}, _
                {'merchantBillingContactEmail' , '[email protected]'}, _
                {'fileAttachments' , '@/var/tmp/bankstatement.zip'}, _
                {'hash' , 'b55552ff426d7e3d4885465d27ea0062'}, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/partner/");
            Map<String, String> params = new LinkedHashMap<>(); 

            params.put('method' , 'addMerchant');
            params.put('partnerUUID' , '5265f8eed6a19');
            params.put('apiKey' , 'ksmnwxab');
            params.put('merchantCompanyLegalName' , 'Test Company Pty Ltd');
            params.put('merchantCompanyTradingName' , 'Test Company');
            params.put('merchantCompanyRegNumber' , '123456789');
            params.put('merchantCountry' , 'AU');
            params.put('merchantState' , 'QLD');
            params.put('merchantCity' , 'Brisbane');
            params.put('merchantStreet' , '123 Test Street');
            params.put('merchantPostcode' , '4000');
            params.put('merchantTimezone' , 'Australia/Brisbane');
            params.put('merchantIndustry' , 'Professional Services');
            params.put('merchantWebsite' , 'http://www.merchantwarrior.com');
            params.put('merchantContactName' , 'join');
            params.put('merchantContactEmail' , 'mw@emailaddress.com');
            params.put('merchantContactMobile' , '61731665489');
            params.put('merchantWebsite' , '61731665489');
            params.put('merchantBillingContactName' , 'join');
            params.put('merchantBillingContactEmail' , 'mw@emailaddress.com');
            params.put('fileAttachments' , '@/var/tmp/bankstatement.zip');
            params.put('hash' , 'b55552ff426d7e3d4885465d27ea0062');

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "multipart/form-data");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <requestReference>042cbef76a6dad632d25</requestReference>
</mwResponse>
Sample 'notifyURL' Response if the merchant request is approved
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <requestReference>c4538fd54dbdad7acd14</requestReference>
    <status>approved</status>
</mwResponse>
Sample 'notifyURL' Response if the merchant request is declined
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <requestReference>c4538fd54dbdad7acd14</requestReference>
    <status>declined</status>
</mwResponse>
Sample 'notifyURL' Response when the merchant account is created
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <requestReference>c4538fd54dbdad7acd14</requestReference>
    <status>created</status>
    <merchantUUID>5b0e0431ea239</merchantUUID>
    <apiKey>f3wj1ids</apiKey>
    <apiPassphrase>o3xnxqgu</apiPassphrase>
</mwResponse>

addMerchant


The addMerchant method is the method used to perform a merchant creation request.
If you supply a notifyURL (see below) with your request, you will receive a notification message in real-time when the creation request has completed.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: addMerchant

Authentication Parameters

Parameter Required Description
partnerUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Merchant Company Parameters

Parameter Required Description
merchantCompanyLegalName Required The legal name of the company.
Example: Company ABC PTY LTD
merchantCompanyTradingName Required The trading name of the company. This may be the same as the legal name.
Example: ABC COMPANY
merchantCompanyRegNumber Required The registration number of the company, eg. ABN, NZBN, EIN etc.
Example: 123456
Valid length: Up to 64 characters.
merchantIndustry Required The industry that best defines the merchant's operations. Must be one of the followings:
'Professional Services',
'Mail/Telephone Order',
'Business Services',
'Retail Store',
'Airline Services',
'Entertainment',
'Automobiles',
'Clothing',
'Contracted Services',
'Government',
'Hotel',
'Personal Services',
'Repair Services',
'Transportation',
'Utilities',
'Wholesale',
'Other'
Example: Clothing
Valid length: Up to 75 characters.
merchantWebsite Required The website of the company. Starts with http:// or https://
Example: https://apple.com.au
Valid length: Up to 75 characters.

Merchant Address Parameters

Parameter Required Description
merchantCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
merchantState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
merchantCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
merchantStreet Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
merchantPostcode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
merchantTimezone Required Must be a valid timezone.
Example: Australia/Brisbane
Valid length: Up to 75 characters

Merchant Contact Parameters

Parameter Required Description
merchantContactName Required The main contact name of this merchant. This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
merchantContactEmail Required The main contact email of this merchant.
Example: [email protected]
Valid length: Up to 255 characters
merchantContactPhone Required The main contact phone number of this merchant.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
merchantContactMobile Required The main contact mobile number of this merchant.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
merchantBillingContactName Required The billing contact name of this merchant. This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
merchantBillingContactEmail Required The billing contact email of this merchant.
Example: [email protected]
Valid length: Up to 255 characters

settlement Parameters

Parameter Required Description
ddSettlementAccountName Not Required The merchant's settlement account name for direct debit (bank account) transactions. This field is required if you specify either ddSettlementAccountBSB or ddSettlementAccountNumber.
Example: Test Name
Valid length: Up to 75 characters
ddSettlementAccountBSB Not Required The merchant's settlement account BSB for direct debit (bank account) transactions. This field is required if you specify either ddSettlementAccountName or ddSettlementAccountNumber.
Example: 123456
Valid length: Up to 75 characters
ddSettlementAccountNumber Not Required The merchant's settlement account number for direct debit (bank account) transactions. This field is required if you specify either ddSettlementAccountBSB or ddSettlementAccountName.
Example: 00123456
Valid length: Up to 75 characters
ccSettlementAccountName Not Required The merchant's settlement account name for credit card transactions. This field is required if you specify either ccSettlementAccountBSB or ccSettlementAccountNumber.
Example: Test Name
Valid length: Up to 75 characters
ccSettlementAccountBSB Not Required The merchant's settlement account BSB for credit card transactions. This field is required if you specify either ccSettlementAccountName or ccSettlementAccountNumber.
Example: 123456
Valid length: Up to 75 characters
ccSettlementAccountNumber Not Required The merchant's settlement account number for credit card transactions. This field is required if you specify either ccSettlementAccountBSB or ccSettlementAccountName.
Example: 512345678912346
Valid length: Up to 75 characters
cardAcceptorName Not Required Freeform field. The name that will appear on the card holder's statement.
Example: NIKE ACCESSORIES
Valid length: Up to 19 characters

attachment Parameters

Parameter Required Description
fileAttachments Not Required Due diligence documentation. This must be a compressed .zip archive and must not exceed 30MB.

Test Parameters

Parameter Required Description
status Not Required The request will be automatically approved or declined based on this parameter. This must be either approved or declined if present. This parameter will only work in the sandbox environment.
Example: approved

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Partner Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST \ 
    -d method="checkMerchant" \
    -d partnerUUID="5265f8eed6a19" \
    -d apiKey="ksmnwxab" \
    -d requestReference="abdfd1231150fda"   
    -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/partner/
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/partner/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'checkMerchant',
  'partnerUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'requestReference' => 'abdfd1231150fda',  
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = { 
  'method' : 'checkMerchant',
  'partnerUUID' : '5265f8eed6a19',
  'apiKey' : 'ksmnwxab',
  'requestReference' : 'abdfd1231150fda',
  'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/partner/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/partner/');

// Setup POST data
$postData = array (
  'method' => 'checkMerchant',
  'partnerUUID' => '5265f8eed6a19',
  'apiKey' => 'ksmnwxab',
  'requestReference' => 'abdfd1231150fda',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

exit(var_dump($xml));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/partner/", 
                    new System.Collections.Specialized.NameValueCollection() {                   
                        {'method' , 'checkMerchant'},
                        {'partnerUUID' , '5265f8eed6a19'},
                        {'apiKey' , 'ksmnwxab'},
                        {'requestReference' , 'abdfd1231150fda'},                       
                        {'hash' , 'b55552ff426d7e3d4885465d27ea0062'},
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/partner/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {'method' , 'checkMerchant'}, _
                {'partnerUUID' , '5265f8eed6a19'}, _
                {'apiKey' , 'ksmnwxab'}, _
                {'requestReference' , 'abdfd1231150fda'}, _             
                {'hash' , 'b55552ff426d7e3d4885465d27ea0062'}, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/partner/");
            Map<String, String> params = new LinkedHashMap<>(); 

            params.put('method' , 'checkMerchant');
            params.put('partnerUUID' , '5265f8eed6a19');
            params.put('apiKey' , 'ksmnwxab');
            params.put('requestReference' , 'abdfd1231150fda');         
            params.put('hash' , 'b55552ff426d7e3d4885465d27ea0062');

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "multipart/form-data");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Merchant Created</responseMessage>
    <status>created</status>
    <merchantUUID>5b0e0431ea239</merchantUUID>
    <apiKey>f3wj1ids</apiKey>
    <apiPassphrase>o3xnxqgu</apiPassphrase>
</mwResponse>
Sample 'notifyURL' Response if merchant gets created
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <requestReference>c4538fd54dbdad7acd14</requestReference>
    <status>created</status>
    <merchantUUID>5b0e0431ea239</merchantUUID>
    <apiKey>f3wj1ids</apiKey>
    <apiPassphrase>o3xnxqgu</apiPassphrase>
</mwResponse>

checkMerchant


The checkMerchant method is the method used to check the status of a merchant creation request.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: checkMerchant

Authentication Parameters

Parameter Required Description
partnerUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Merchant Company Parameters

Parameter Required Description
requestReference Required This parameter is returned by addMerchant.
Example: abdfd1231150fda

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Partner Query Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Production API Endpoint

https://api.merchantwarrior.com/paylink/

Sandbox API Endpoint

https://base.merchantwarrior.com/paylink/

Replace snippets below with your merchantUUID, apiKey and correct hash.

MWPAY.Link

The following sub-sections will outline information in relation to the Merchant Warrior PAY.Link service.

Introduction

The Merchant Warrior MWPAY.Link service enables you to generate a unique payment link that when accessed will allow your customer to complete a payment via a secure Hosted Payment Page.

Each MWPAY.Link that is generated will have a unique code attached to it. You can also link your own internal Reference ID to a unique code in order to reconcile transactions that take place via a unique payment link. The MWPAY.Link service can also notify your systems in real-time after a customer has completed a payment.

MWPAY.Link URLs are useful for scenarios such as sending bills via email and/or SMS, e-invoices, donations etc.

You will need to obtain a Merchant UUID, API Key and API passphrase in order to use this feature. These details will be issued to you when you create your MW account.

Request Format

API requests are submitted to this service using POST, and must be performed over HTTPS.

Sample Request
curl -X POST \ 
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d linkReferenceID="12345" \
    -d transactionAmount="1.00" \
    -d transactionCurrency="AUD" \
    -d transactionProduct="Test Product" \
    -d customerName="Test Customer" \
    -d customerCountry="AU" \
    -d customerState="QLD" \
    -d customerCity="Brisbane" \
    -d customerAddress="123 Test Street" \
    -d customerPostCode="4000" \
    -d customerPhone="61731665489" \
    -d customerEmail="[email protected]" \
    -d hash="fe5b6e0a3cd07ef9b72a1366270496fc" https://api.merchantwarrior.com/paylink/

require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/paylink/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'linkReferenceID' => '12345',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'fe5b6e0a3cd07ef9b72a1366270496fc'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'linkReferenceID': '12345',
  'transactionAmount': '1.00',
  'transactionCurrency': 'AUD',
  'transactionProduct': 'Test Product',
  'customerName': 'Test Customer',
  'customerCountry': 'AU',
  'customerState': 'QLD',
  'customerCity': 'Brisbane',
  'customerAddress': '123 Test Street',
  'customerPostCode': '4000',
  'customerPhone': '61731665489',
  'customerEmail': '[email protected]',  
  'hash': 'fe5b6e0a3cd07ef9b72a1366270496fc'
}

r = requests.post('https://api.merchantwarrior.com/paylink/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/paylink/');

// Setup POST data
$postData = array (
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'linkReferenceID' => '12345',
  'transactionAmount' => '1.00',
  'transactionCurrency' => 'AUD',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'fe5b6e0a3cd07ef9b72a1366270496fc'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status,   
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/paylink/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "linkReferenceID", "12345" },
                        { "transactionAmount", "1.00" },
                        { "transactionCurrency", "AUD" },
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },                        
                        { "hash", "fe5b6e0a3cd07ef9b72a1366270496fc" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/paylink/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                {"merchantUUID", "4a3cda44663c5"}, _
                {"apiKey", "2h7eognq"}, _
                {"linkReferenceID", "12345"}, _
                {"transactionAmount", "1.00"}, _
                {"transactionCurrency", "AUD"}, _
                {"transactionProduct", "Test Product"}, _
                {"customerName", "Test Customer"}, _
                {"customerCountry", "AU"}, _
                {"customerState", "QLD"}, _
                {"customerCity", "Brisbane"}, _
                {"customerAddress", "123 Test Street"}, _
                {"customerPostCode", "4000"}, _
                {"customerPhone", "61731665489"}, _
                {"customerEmail", "[email protected]"}, _                
                {"hash", "fe5b6e0a3cd07ef9b72a1366270496fc"} _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/paylink/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("linkReferenceID", "12345");
            params.put("transactionAmount", "1.00");
            params.put("transactionCurrency", "AUD");
            params.put("transactionProduct", "Test Product");
            params.put("customerName", "Test Customer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");            
            params.put("hash", "fe5b6e0a3cd07ef9b72a1366270496fc");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation Successful</responseMessage>
    <linkReferenceID>12345</linkReferenceID>
    <uniqueCode>fd4a9585e24dca85f66f0c641fd43d08</uniqueCode>
    <expiry>2017-05-01 17:45:12</expiry>
    <linkURL>
    https://mwpay.link/MW00000043
    </linkURL>
    <transactionProduct>Book</transactionProduct>
    <transactionAmount>1330.00</transactionAmount>
    <transactionCurrency>AUD</transactionCurrency>
</mwResponse>
Sample 'notifyURL' Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Transaction approved</responseMessage>
    <status>approved</status>
    <transactionID>2-c7e87f8f-767f-11e7-92a6-005056b209e0</transactionID>
    <authCode>731903678</authCode>
    <receiptNo>731903678</receiptNo>
    <authMessage>Honour with identification</authMessage>
    <authResponseCode>08</authResponseCode>
    <authSettledDate>2017-08-01</authSettledDate>
    <paymentCardNumber>456471XXXXXX0004</paymentCardNumber>
    <transactionAmount>19.00</transactionAmount>
    <hash>ad91cb6b70bf903c04019425ac99883f</hash>
    <custom1/>
    <custom2/>
    <custom3/>
    <customHash>5ffe664050654421284bbc5c4f137adb</customHash>
    <uniqueCode>dig0095</uniqueCode>
</mwResponse>
Sample 'returnURL' Response
https://www.mydomain.com/sample.return.php?uniqueCode=dig0095&status=approved&reference=2-c7e87f8f-767f-11e7-92a6-005056b209e0&paymentCardNumber=456471XXXXXX0004&transactionAmount=19.00&hash=ad91cb6b70bf903c04019425ac99883f&message=Transaction+approved&custom1=&custom2=&custom3=&customHash=5ffe664050654421284bbc5c4f137adb
The responses below are for a request where the linkReferenceID parameter has been set
Sample 'notifyURL' Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Transaction approved</responseMessage>
    <status>approved</status>
    <transactionID>2-8d872d9a-7680-11e7-92a6-005056b209e0</transactionID>
    <authCode>731903726</authCode>
    <receiptNo>731903726</receiptNo>
    <authMessage>Honour with identification</authMessage>
    <authResponseCode>08</authResponseCode>
    <authSettledDate>2017-08-01</authSettledDate>
    <paymentCardNumber>456471XXXXXX0004</paymentCardNumber>
    <transactionAmount>1343.30</transactionAmount>
    <hash>547739ddb9f0fef0d4a2b6cc8054099c</hash>
    <custom1>custom1</custom1>
    <custom2>custom2</custom2>
    <custom3>custom3</custom3>
    <customHash>99a94945aa6eb74adf0e92d78ea4b3ff</customHash>
    <linkReferenceID>1234567</linkReferenceID>
    <uniqueCode>MW0000005R</uniqueCode>
</mwResponse>
Sample 'returnURL' Response
https://www.mydomain.com/sample.return.php?linkReferenceID=1234567&uniqueCode=MW0000005R&status=approved&reference=2-8d872d9a-7680-11e7-92a6-005056b209e0&paymentCardNumber=456471XXXXXX0004&transactionAmount=1343.30&hash=547739ddb9f0fef0d4a2b6cc8054099c&message=Transaction+approved&custom1=custom1&custom2=custom2&custom3=custom3&customHash=99a94945aa6eb74adf0e92d78ea4b3ff
The responses below are for a request where the dynamic currency has been selected
Sample 'notifyURL' Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Transaction approved</responseMessage>
    <status>approved</status>
    <transactionID>2-8d872d9a-7680-11e7-92a6-005056b209e0</transactionID>
    <authCode>731903726</authCode>
    <receiptNo>731903726</receiptNo>
    <authMessage>Honour with identification</authMessage>
    <authResponseCode>08</authResponseCode>
    <authSettledDate>2017-08-01</authSettledDate>
    <paymentCardNumber>456471XXXXXX0004</paymentCardNumber>
    <transactionAmount>1343.30</transactionAmount>
    <hash>547739ddb9f0fef0d4a2b6cc8054099c</hash>
    <custom1>custom1</custom1>
    <custom2>custom2</custom2>
    <custom3>custom3</custom3>
    <customHash>99a94945aa6eb74adf0e92d78ea4b3ff</customHash>
    <linkReferenceID>1234567</linkReferenceID>
    <uniqueCode>MW0000005R</uniqueCode>
    <cardType>visa</cardType>
    <dccOriginalCur>AUD</dccOriginalCur>
    <dccOriginalAmt>1343.30</dccOriginalAmt>
    <dccRate>0.77857</dccRate>
    <dccCur>USD</dccCur>
    <dccAmt>1045.85</dccAmt>
    <dccCom>2.75</dccCom>
</mwResponse>
Sample 'returnURL' Response
https://www.mydomain.com/sample.return.php?linkReferenceID=1234567&uniqueCode=MW0000005R&status=approved&reference=2-8d872d9a-7680-11e7-92a6-005056b209e0&paymentCardNumber=456471XXXXXX0004&transactionAmount=1343.30&hash=547739ddb9f0fef0d4a2b6cc8054099c&message=Transaction+approved&custom1=custom1&custom2=custom2&custom3=custom3&customHash=99a94945aa6eb74adf0e92d78ea4b3ff&cardType=visa&dccOriginalCur=AUD&dccOriginalAmt=1343.30&dccRate=0.77857&dccCur=USD&dccAmt=1045.85&dccCom=2.75


The request paramaters below detail how to generate a unique payment link. Each payment link will have a uniqueCode associated with it.

Request-Parameters

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

General Transaction Parameters

Parameter Required Description
transactionAmount Required The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
transactionCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
transactionProduct Required A product (or sale) id or description. We recommend using an order/product id. This field's primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.
referenceText Not Required This parameter is used to describe the order/product ID or reference. It will be placed next to the transactionProduct mentioned above in the payment page.
Example: Booking #
Valid length: Up to 50 characters
linkReferenceID Not Required This is a merchant's unique reference ID that can be used to match a uniqueCode with a merchant's internal reference ID.
Example: A257240023321
Valid length: Up to 40 characters
expiry Not Required The expiration of the unique payment link. This paramater should be formatted as a DateTime (yyyy-mm-dd hh:mm:ss). By default the unique payment link will expire after 7 days.
Example: 2017-05-01 17:45:12
sendEmail Not Required This value is a boolean denoting whether to automatically send an email to the customer with the unique payment link
Example: 1
reminderFrequency Not Required How often to send a reminder email to the customer if the unique payment link is unpaid. Reminder emails will only be sent if the sendEmail parameter was set to true. If this value is not set, or 0, no reminder emails will be sent
Example: 7

Customer Parameters

Parameter Required Description
customerName Not Required This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Not Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Not Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Not Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Not Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Not Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Must be valid if present. Sending this optional parameter is highly recommended.
Example: [email protected]
Valid length: Up to 255 characters

Redirect and Notification Parameters

Parameter Required Description
returnURL Required The customer will be redirected to this URL upon completion of the transaction. This parameter can also be hardcoded via the merchant administration interface.
Example: https://www.example.com/return.php
notifyURL Required Asynchronous POST notifications will be sent to this URL. This parameter can also be hardcoded via the merchant administration interface.
Example: https://www.example.com/notify.php
urlHash Required The urlHash field is a combination of your API Passphrase, and specific parameters sent in the transaction. It must be specified if you specify either returnURL or notifyURL. See Web URL Hash for information on how to construct the hash correctly.
Example: 511999e54b9ad51ce4c28d7f0550ac81
Valid Length: 32 characters

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field.
Valid length: Up to 500 characters
custom2 Not Required Freeform field.
Valid length: Up to 500 characters
custom3 Not Required Freeform field.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Production API Endpoint

https://api.merchantwarrior.com/post/

Sandbox API Endpoint

https://base.merchantwarrior.com/post/

Replace snippets below with your merchantUUID, apiKey and correct hash.

Recurring API

The following sub-sections will outline the various API methods present in the Merchant Warrior Recurring API.

Introduction

The Recurring API provides you with a platform to process and manage recurring bills and/or subscriptions.

Request Format

API requests are submitted to the Recurring API service using POST, and must be performed over HTTPS.

Available Methods

The Recurring API service consists of the following methods:
addRecurring: Creates a new recurring bill using a customer's credit card or token
updateRecurring: Modifies a recurring bill
suspendRecurring: Suspends a recurring bill for a specified period
unSuspendRecurring: Unsuspends a suspended recurring bill
deleteRecurring: Deletes a recurring bill from the platform
queryRecurring: Queries a recurring bill
addRecurringPlan: Creates a new recurring plan
updateRecurringPlan: Modifies a recurring plan
suspendRecurringPlan: Suspends all recurring bills associated with a recurring plan for a specified period
unSuspendRecurringPlan: Unsuspends the recurring bills associated with a suspended recurring plan
deleteRecurringPlan: Deletes a recurring plan
queryRecurringPlan: Queries a recurring plan

Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="addRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d accountType="credit" \
    -d paymentCardNumber="5123456789012346" \
    -d paymentCardExpiry="0517" \
    -d paymentCardName="Test Customer" \
    -d paymentCurrency="AUD" \
    -d paymentFrequency="cycle" \
    -d paymentInterval="7" \
    -d intervalType="days" \
    -d paymentStartDate="2017-06-30" \
    -d amountType="fixed_amount" \
    -d paymentAmount="10.00" \
    -d countType="unlimited" \  
    -d transactionProduct="Test Product" \
    -d customerName="Test Customer" \
    -d customerCountry="AU" \
    -d customerState="QLD" \
    -d customerCity="Brisbane" \
    -d customerAddress="123 Test Street" \
    -d customerPostCode="4000" \
    -d customerPhone="61731665489" \
    -d customerEmail="[email protected]" \    
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'addRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'accountType' => 'credit',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0517',
  'paymentCardName' => 'Test Customer',
  'paymentCurrency' => 'AUD',
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'addRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'accountType': 'credit',
  'paymentCardNumber': '5123456789012346',
  'paymentCardExpiry': '0517',
  'paymentCardName': 'Test Customer',
  'paymentCurrency': 'AUD',
  'paymentFrequency': 'cycle',
  'paymentInterval': '7',
  'intervalType': 'days',
  'paymentStartDate': '2017-06-30',
  'amountType': 'fixed_amount',
  'paymentAmount': '10.00',
  'countType': 'unlimited',
  'transactionProduct': 'Test Product',
  'customerName': 'Test Customer',
  'customerCountry': 'AU',
  'customerState': 'QLD',
  'customerCity': 'Brisbane',
  'customerAddress': '123 Test Street',
  'customerPostCode': '4000',
  'customerPhone': '61731665489',
  'customerEmail': '[email protected]',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'addRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'accountType' => 'credit',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0517',
  'paymentCardName' => 'Test Customer',
  'paymentCurrency' => 'AUD',
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "addRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "accountType", "credit" },
                        { "paymentCardNumber", "5123456789012346" },
                        { "paymentCardExpiry", "0517" },
                        { "paymentCardName", "Test Customer" },
                        { "paymentCurrency", "AUD" },
                        { "paymentFrequency", "cycle" },
                        { "paymentInterval", "7" },
                        { "intervalType", "days" },
                        { "paymentStartDate", "2017-06-30" },
                        { "amountType", "fixed_amount" },
                        { "paymentAmount", "10.00" },
                        { "countType", "unlimited" },                       
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },                        
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "addRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "accountType", "credit" }, _
                { "paymentCardNumber", "5123456789012346" }, _
                { "paymentCardExpiry", "0517" }, _
                { "paymentCardName", "Test Customer" }, _
                { "paymentCurrency", "AUD" }, _
                { "paymentFrequency", "cycle" }, _
                { "paymentInterval", "7" }, _
                { "intervalType", "days" }, _
                { "paymentStartDate", "2017-06-30" }, _
                { "amountType", "fixed_amount" }, _
                { "paymentAmount", "10.00" }, _
                { "countType", "unlimited" }, _                       
                { "transactionProduct", "Test Product" }, _
                { "customerName", "Test Customer" }, _
                { "customerCountry", "AU" }, _
                { "customerState", "QLD" }, _
                { "customerCity", "Brisbane" }, _
                { "customerAddress", "123 Test Street" }, _
                { "customerPostCode", "4000" }, _
                { "customerPhone", "61731665489" }, _
                { "customerEmail", "[email protected]" }, _                     
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "addRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("accountType", "credit");
            params.put("paymentCardNumber", "5123456789012346");
            params.put("paymentCardExpiry", "0517");
            params.put("paymentCardName", "TestCard");
            params.put("paymentCurrency", "AUD");
            params.put("paymentFrequency", "cycle");
            params.put("paymentInterval", "7");
            params.put("intervalType", "days");
            params.put("paymentStartDate", "2017-06-30");
            params.put("amountType", "fixed_amount");
            params.put("paymentAmount", "10.00");
            params.put("countType", "unlimited");
            params.put("transactionProduct", "Test Product");
            params.put("customerName", "Test Customer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <recurringUUID>2-207515fc-2fcd-11e7-92a6-005056b209e0</recurringUUID>
    <cardID>LJBW20886734</cardID>
    <suspendStartDate/><suspendEndDate/>
    <suspendNextBillingDate/>
    <customerName>Madi</customerName>
    <customerCountry>AU</customerCountry>
    <customerState>QLD</customerState>
    <customerCity>Brisbane</customerCity>
    <customerAddress>123 Test Street</customerAddress>
    <customerPostCode>4000</customerPostCode>
    <customerPhone/>
    <customerEmail/>
    <paymentFrequency>cycle</paymentFrequency>
    <paymentInterval>7</paymentInterval>
    <paymentCurrency>AUD</paymentCurrency>
    <intervalType>days</intervalType>
    <paymentStartDate>2017-06-30</paymentStartDate>
    <amountType>fixed_amount</amountType>
    <countType>unlimited</countType>
    <paymentAmount>10.00</paymentAmount>
    <recurringStatus>Active</recurringStatus>
    <nextBillingDate>2017-07-07</nextBillingDate>
    <nextBillingAmount>10.00</nextBillingAmount>
    <nextBillingCurrency>AUD</nextBillingCurrency>
</mwResponse>

addRecurring


The addRecurring method is used to create a new recurring bill.
A recurring bill can be attached to a credit card or Token ID and can also be associated with a recurring plan.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: addRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Card Parameters

Parameter Required Description
accountType Required This field indicates which payment method the customer wants to use. Only credit card is supported at the moment.
Example: credit
cardID Required/Not Required A unique alphanumeric string returned by addCard.
Example: ABCD12345678
paymentCardNumber Required/Not Required Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678).
Example: 5123456789012346 or 4557012345678902
Valid length: Between 13 and 16 digits
paymentCardExpiry Required/Not Required This must be MMYY format. The month must be zero padded if it is less than 10.
Example: 0513
Valid length: 4 digits
paymentCardName Required/Not Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 255 characters

Recurring Parameters

Parameter Required Description
paymentCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
immediateAmount Not Required The amount to charge prior to creating a new recurring bill. If this initial charge fails a recurring bill will not be created. This can be used to validate that the payment information is valid prior to creating the recurring bill.
Example: 10.00
recurringPlanUUID Not Required The recurring plan that will be attached to this recurring bill. A recurring plan is created by the addRecurringPlan method.
Example: 2-317d84f8-0d32-11e7-9a6a-005056b209e0
paymentFrequency Required/Not Required cycle or fixed_date. This should be set to cycle if you want to bill your customer periodically or set to fixed_date if you want to bill your customer on a specific day of each month.
Example: cycle
paymentInterval Required/Not Required If the paymentFrequency parameter has been set to cycle, then this parameter should be set to the interval between bills. If the paymentFrequency parameter has been set to fixed_date, then this parameter should be set to the day of the month that you would like billing to take place on, or the keyword end to run the bill at the end of each month.
Example: 7
intervalType Required/Not Required days or businessdays. If you only want to charge customer's during the business week (Monday-Friday) only, this parameter should be set to businessdays.
Example: days
paymentStartDate Required/Not Required The date that billing should start on. This must be a date in the future.
Example: 2017-05-10
amountType Required/Not Required fixed_amount or initialization. This should be set to fixed_amount if each recurring bill should be processed for the same amount or set to initialization if you want the initial bill(s) to have a different amount than the ongoing recurring bills.
Example: fixed_amount
paymentAmount Required/Not Required The amount associated with the recurring bill. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 20.00
initialAmount Required/Not Required The initial amount to be billed before the ongoing paymentAmount is billed for all remaining recurring bills. This parameter is only required if the amountType has been set to initialization. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
initialCount Required/Not Required The number of times you want an initialAmount to be billed before the ongoing paymentAmount is billed for all remaining recurring bills. This parameter is only required if the amountType has been set to initialization.
Example: 2
countType Required/Not Required One of the following: unlimited, max_count, fixed_period or max_amount.
unlimited - the recurring bill will never expire.
max_count - the recurring bill will continue until the max_count is reached.
fixed_period - the recurring bill will only run between a specified period.
max_amount - the recurring bill will continue to run until the max_amount is reached.
Example: unlimited
maxCount Required/Not Required The maximum number of times the recurring bill should run. This parameter is only required if the countType has been set to max_count.
Example: 100
paymentEndDate Required/Not Required The date of the last time the recurring bill should run. If this parameter is set, the recurring bill will only run between the paymentStartDate and paymentEndDate. This parameter is only required if the countType has been set to fixed_period.
Example: 2018-05-10
maxAmount Required/Not Required The maximum amount that a recurring bill can charge, regardless of the number of times that it runs. This parameter is only required if the countType has been set to max_amount. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 2000.00


Customer Parameters

Parameter Required Description
transactionProduct Required A product (or sale) id or description. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.
customerName Required This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Must be valid. Will Send transaction details to this email.
Example: [email protected]
Valid length: Up to 255 characters
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters
custom2 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters
custom3 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="updateRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringUUID="2-47e69806-2fcd-11e7-92a6-005056b209e0" \
    -d updatePaymentMethod="1" \
    -d accountType="credit" \
    -d paymentCardNumber="5123456789012346" \
    -d paymentCardExpiry="0517" \
    -d paymentCardName="Test Customer" \
    -d paymentCurrency="AUD" \
    -d updateRecurringSettings="1" \
    -d paymentFrequency="cycle" \
    -d paymentInterval="7" \
    -d intervalType="days" \
    -d paymentStartDate="2017-06-30" \
    -d amountType="fixed_amount" \
    -d paymentAmount="10.00" \
    -d countType="unlimited" \  
    -d transactionProduct="Test Product" \
    -d customerName="Test Customer" \
    -d customerCountry="AU" \
    -d customerState="QLD" \
    -d customerCity="Brisbane" \
    -d customerAddress="123 Test Street" \
    -d customerPostCode="4000" \
    -d customerPhone="61731665489" \
    -d customerEmail="[email protected]" \    
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'updateRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'updatePaymentMethod' => '1'
  'accountType' => 'credit',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0517',
  'paymentCardName' => 'Test Customer',
  'paymentCurrency' => 'AUD',
  'updateRecurringSettings' => '1'
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'updateRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringUUID': '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'updatePaymentMethod': '1',
  'accountType': 'credit',
  'paymentCardNumber': '5123456789012346',
  'paymentCardExpiry': '0517',
  'paymentCardName': 'Test Customer',
  'paymentCurrency': 'AUD',
  'updateRecurringSettings': '1',
  'paymentFrequency': 'cycle',
  'paymentInterval': '7',
  'intervalType': 'days',
  'paymentStartDate': '2017-06-30',
  'amountType': 'fixed_amount',
  'paymentAmount': '10.00',
  'countType': 'unlimited',
  'transactionProduct': 'Test Product',
  'customerName': 'Test Customer',
  'customerCountry': 'AU',
  'customerState': 'QLD',
  'customerCity': 'Brisbane',
  'customerAddress': '123 Test Street',
  'customerPostCode': '4000',
  'customerPhone': '61731665489',
  'customerEmail': '[email protected]',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'updateRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'updatePaymentMethod' => '1',
  'accountType' => 'credit',
  'paymentCardNumber' => '5123456789012346',
  'paymentCardExpiry' => '0517',
  'paymentCardName' => 'Test Customer',
  'paymentCurrency' => 'AUD',
  'updateRecurringSettings' => '1',
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'transactionProduct' => 'Test Product',
  'customerName' => 'Test Customer',
  'customerCountry' => 'AU',
  'customerState' => 'QLD',
  'customerCity' => 'Brisbane',
  'customerAddress' => '123 Test Street',
  'customerPostCode' => '4000',
  'customerPhone' => '61731665489',
  'customerEmail' => '[email protected]',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "addRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" },
                        { "updatePaymentMethod", "1" },
                        { "accountType", "credit" },
                        { "paymentCardNumber", "5123456789012346" },
                        { "paymentCardExpiry", "0517" },
                        { "paymentCardName", "Test Customer" },
                        { "paymentCurrency", "AUD" },
                        { "updateRecurringSettings", "1" },
                        { "paymentFrequency", "cycle" },
                        { "paymentInterval", "7" },
                        { "intervalType", "days" },
                        { "paymentStartDate", "2017-06-30" },
                        { "amountType", "fixed_amount" },
                        { "paymentAmount", "10.00" },
                        { "countType", "unlimited" },                       
                        { "transactionProduct", "Test Product" },
                        { "customerName", "Test Customer" },
                        { "customerCountry", "AU" },
                        { "customerState", "QLD" },
                        { "customerCity", "Brisbane" },
                        { "customerAddress", "123 Test Street" },
                        { "customerPostCode", "4000" },
                        { "customerPhone", "61731665489" },
                        { "customerEmail", "[email protected]" },                        
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "addRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" }, _
                { "updatePaymentMethod", "1" }, _
                { "accountType", "credit" }, _
                { "paymentCardNumber", "5123456789012346" }, _
                { "paymentCardExpiry", "0517" }, _
                { "paymentCardName", "Test Customer" }, _
                { "paymentCurrency", "AUD" }, _
                { "updateRecurringSettings", "1" }, _
                { "paymentFrequency", "cycle" }, _
                { "paymentInterval", "7" }, _
                { "intervalType", "days" }, _
                { "paymentStartDate", "2017-06-30" }, _
                { "amountType", "fixed_amount" }, _
                { "paymentAmount", "10.00" }, _
                { "countType", "unlimited" }, _                       
                { "transactionProduct", "Test Product" }, _
                { "customerName", "Test Customer" }, _
                { "customerCountry", "AU" }, _
                { "customerState", "QLD" }, _
                { "customerCity", "Brisbane" }, _
                { "customerAddress", "123 Test Street" }, _
                { "customerPostCode", "4000" }, _
                { "customerPhone", "61731665489" }, _
                { "customerEmail", "[email protected]" }, _                     
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "addRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0");
            params.put("updatePaymentMethod", "1");
            params.put("accountType", "credit");
            params.put("paymentCardNumber", "5123456789012346");
            params.put("paymentCardExpiry", "0517");
            params.put("paymentCardName", "TestCard");
            params.put("paymentCurrency", "AUD");
            params.put("updateRecurringSettings", "1");
            params.put("paymentFrequency", "cycle");
            params.put("paymentInterval", "7");
            params.put("intervalType", "days");
            params.put("paymentStartDate", "2017-06-30");
            params.put("amountType", "fixed_amount");
            params.put("paymentAmount", "10.00");
            params.put("countType", "unlimited");
            params.put("transactionProduct", "Test Product");
            params.put("customerName", "Test Customer");
            params.put("customerCountry", "AU");
            params.put("customerState", "QLD");
            params.put("customerCity", "Brisbane");
            params.put("customerAddress", "TestStreet");
            params.put("customerPostCode", "4000");
            params.put("customerPhone", "61731665489");
            params.put("customerEmail", "[email protected]");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <recurringUUID>2-47e69806-2fcd-11e7-92a6-005056b209e0</recurringUUID>
    <cardID>LJBW20886734</cardID>
    <suspendStartDate/><suspendEndDate/>
    <suspendNextBillingDate/>
    <customerName>Madi</customerName>
    <customerCountry>AU</customerCountry>
    <customerState>QLD</customerState>
    <customerCity>Brisbane</customerCity>
    <customerAddress>123 Test Street</customerAddress>
    <customerPostCode>4000</customerPostCode>
    <customerPhone/>
    <customerEmail/>
    <paymentFrequency>cycle</paymentFrequency>
    <paymentCurrency>AUD</paymentCurrency>
    <paymentInterval>7</paymentInterval>
    <intervalType>days</intervalType>
    <paymentStartDate>2017-06-30</paymentStartDate>
    <amountType>fixed_amount</amountType>
    <countType>unlimited</countType>
    <paymentAmount>10.00</paymentAmount>
    <recurringStatus>Active</recurringStatus>
    <nextBillingDate>2017-07-07</nextBillingDate>
    <nextBillingAmount>10.00</nextBillingAmount>
    <nextBillingCurrency>AUD</nextBillingCurrency>
</mwResponse>

updateRecurring


The updateRecurring method is used to modify the details of an existing recurring bill.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: updateRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Recurring Parameters

Parameter Required Description
recurringUUID Required The value of this parameter is used to identify each recurring. It is returned by addRecurring.
Example: 2-f6b2a37a-2f99-11e7-92a6-005056b209e0

Card Parameters

Parameter Required Description
updatePaymentMethod Required This parameter must be set to 1 if you want to change the credit card or token details associated with the recurring bill. If this parameter is not set, it defaults to 0.
Example: 0
accountType Required/Not Required This field indicates which payment method the customer wants to use. Only credit card is supported at the moment.
Example: credit
cardID Required/Not Required A unique alphanumeric string returned by addCard.
Example: ABCD12345678
paymentCardNumber Required/Not Required Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678).
Example: 5123456789012346 or 4557012345678902
Valid length: Between 13 and 16 digits
paymentCardExpiry Required/Not Required This must be MMYY format. The month must be zero padded if it is less than 10.
Example: 0513
Valid length: 4 digits
paymentCardName Required/Not Required This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed.
Example: Mr. Example Person or MR E PERSON or Example Person
Valid length: Between 3 and 255 characters

Recurring Parameters

Parameter Required Description
updateRecurringSettings Required This parameter must be set to 1 if you want to change the settings associated with the recurring bill. If this parameter is not set, it defaults to 0. You cannot update a recurring bill's settings if it is associated with a recurring plan. You must update the recurring plan (see updateRecurringPlan) that the recurring bill is attached to.
Example: 0
paymentCurrency Required One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
paymentFrequency Required/Not Required cycle or fixed_date. This should be set to cycle if you want to bill your customer periodically or set to fixed_date if you want to bill your customer on a specific day of each month.
Example: cycle
paymentInterval Required/Not Required If the paymentFrequency parameter has been set to cycle, then this parameter should be set to the interval between bills. If the paymentFrequency parameter has been set to fixed_date, then this parameter should be set to the day of the month that you would like billing to take place on, or the keyword end to run the bill at the end of each month.
Example: 7
intervalType Required/Not Required days or businessdays. If you only want to charge customer's during the business week (Monday-Friday) only, this parameter should be set to businessdays.
Example: days
paymentStartDate Required/Not Required The date that billing should start on. This must be a date in the future.
Example: 2017-05-10
amountType Required/Not Required fixed_amount or initialization. This should be set to fixed_amount if each recurring bill should be processed for the same amount or set to initialization if you want the initial bill(s) to have a different amount than the ongoing recurring bills.
Example: fixed_amount
paymentAmount Required/Not Required The amount associated with the recurring bill. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 20.00
initialAmount Required/Not Required The initial amount to be billed before the ongoing paymentAmount is billed for all remaining recurring bills. This parameter is only required if the amountType has been set to initialization. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 10.00
initialCount Required/Not Required The number of times you want an initialAmount to be billed before the ongoing paymentAmount is billed for all remaining recurring bills. This parameter is only required if the amountType has been set to initialization.
Example: 2
countType Required/Not Required One of the following: unlimited, max_count, fixed_period or max_amount.
unlimited - the recurring bill will never expire.
max_count - the recurring bill will continue until the max_count is reached.
fixed_period - the recurring bill will only run between a specified period.
max_amount - the recurring bill will continue to run until the max_amount is reached.
Example: unlimited
maxCount Required/Not Required The maximum number of times the recurring bill should run. This parameter is only required if the countType has been set to max_count.
Example: 100
paymentEndDate Required/Not Required The date of the last time the recurring bill should run. If this parameter is set, the recurring bill will only run between the paymentStartDate and paymentEndDate. This parameter is only required if the countType has been set to fixed_period.
Example: 2018-05-10
maxAmount Required/Not Required The maximum amount that a recurring bill can charge, regardless of the number of times that it runs. This parameter is only required if the countType has been set to max_amount. The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected.
Example: 2000.00

Customer Parameters

Parameter Required Description
transactionProduct Required A product (or sale) id or description. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes.
Example: ABC4321
Valid length: Up to 255 characters. Some Acquirers limit this field to 40 characters.
customerName Required This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters.
Example: Mr. Example Person
Valid length: Between 2 and 255 characters
customerCountry Required Two letter ISO 3166-1 alpha-2 country code.
Example: AU
Valid length: 2 characters
customerState Required Freeform field, keep consistent for your records and reporting.
Example: Queensland
Valid length: Up to 75 characters
customerCity Required Freeform field, keep consistent for your records and reporting.
Example: Brisbane
Valid length: Up to 75 characters
customerAddress Required Freeform field.
Example: 123 Test Street
Valid length: Up to 255 characters
customerPostCode Required This can also accomodate ZIP/Post codes for international transactions.
Example: 4000
Valid length: Between 4 and 10 characters
customerPhone Not Required Anything other than +,-, space and 0-9 will be stripped.
Example: 0401234567 or 61731234567
Valid length: Up to 25 characters
customerEmail Not Required Must be valid. Will Send transaction details to this email.
Example: [email protected]
Valid length: Up to 255 characters
storeID Not Required The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter.
Example: Test store name

Custom Parameters

Parameter Required Description
custom1 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters
custom2 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters
custom3 Not Required Freeform field. Will be passed to processCard.
Valid length: Up to 500 characters

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="suspendRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringUUID="2-47e69806-2fcd-11e7-92a6-005056b209e0" \
    -d suspendStartDate="2017-05-06" \
    -d suspendNextBillingDate="2017-06-06" \
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'suspendRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendStartDate' => '2017-05-06',
  'suspendNextBillingDate' => '2017-06-06',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'suspendRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringUUID': '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendStartDate': '2017-05-06',
  'suspendNextBillingDate': '2017-06-06',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'suspendRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendStartDate' => '2017-05-06',
  'suspendNextBillingDate' => '2017-06-06',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "suspendRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" },
                        { "suspendStartDate", "2017-05-06" },
                        { "suspendNextBillingDate", "2017-06-06" },                  
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "suspendRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" }, _
                { "suspendStartDate", "2017-05-06" }, _
                { "suspendNextBillingDate", "2017-06-06" }, _                 
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "suspendRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0");
            params.put("suspendStartDate", "2017-05-06");
            params.put("suspendNextBillingDate", "2017-06-06");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <recurringUUID>2-47e69806-2fcd-11e7-92a6-005056b209e0</recurringUUID>
    <cardID>LJBW20886734</cardID>
    <suspendStartDate/>
    <suspendEndDate/>
    <suspendNextBillingDate/>
    <customerName>Madi</customerName>
    <customerCountry>AU</customerCountry>
    <customerState>QLD</customerState>
    <customerCity>Brisbane</customerCity>
    <customerAddress>123 Test Street</customerAddress>
    <customerPostCode>4000</customerPostCode>
    <customerPhone/>
    <customerEmail/>
    <paymentFrequency>cycle</paymentFrequency>
    <paymentCurrency>AUD</paymentCurrency>
    <paymentInterval>7</paymentInterval>
    <intervalType>days</intervalType>
    <paymentStartDate>2017-06-30</paymentStartDate>
    <amountType>fixed_amount</amountType>
    <countType>unlimited</countType>
    <paymentAmount>10.00</paymentAmount>
    <recurringStatus>Suspended</recurringStatus>
</mwResponse>

suspendRecurring


The suspendRecurring method is used to suspend a recurring bill for a specified period of time.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: suspendRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Recurring Parameters

Parameter Required Description
recurringUUID Required The value of this parameter is used to identify each recurring. It is returned by addRecurring.
Example: 2-f6b2a37a-2f99-11e7-92a6-005056b209e0

Recurring Parameters

Parameter Required Description
suspendStartDate Not Required The date from which you want to suspend the recurring bill. If this parameter is not set, the recurring bill will be suspended immediately.
Example: 2017-04-05
suspendEndDate Not Required The date from which the suspended recurring bill should resume normal billing again. If this parameter and the suspendNextBillingDate parameter is not set, the recurring bill will be suspended indefinitely or until the recurring plan is unsuspended (see unSuspendRecurring).
Example: 2017-06-05
suspendNextBillingDate Not Required The date that the recurring bill will run again (your customer will be charged on this date). If this parameter and the suspendEndDate parameter is not set, the recurring bill will be suspended indefinitely or until the recurring bill is unsuspended (see unSuspendRecurring).
Example: 2017-06-05


Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="unSuspendRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringUUID="2-47e69806-2fcd-11e7-92a6-005056b209e0" \
    -d suspendNextBillingDate="2017-06-06" \
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'unSuspendRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendNextBillingDate' => '2017-06-06',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'unSuspendRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringUUID': '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendNextBillingDate': '2017-06-06',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'unSuspendRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'suspendNextBillingDate' => '2017-06-06',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "unSuspendRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" },
                        { "suspendNextBillingDate", "2017-06-06" },                  
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "unSuspendRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" }, _
                { "suspendNextBillingDate", "2017-06-06" }, _                 
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "unSuspendRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0");
            params.put("suspendNextBillingDate", "2017-06-06");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    recurringUUID>2-86851d67-49b2-11e7-92a6-005056b209e0</recurringUUID>
    <cardID>LJBW20886734</cardID>
    <suspendStartDate>2017-06-06</suspendStartDate>
    <suspendEndDate>2017-08-01</suspendEndDate>
    <suspendNextBillingDate/>
    <customerName>Madi</customerName>
    <customerCountry>AU</customerCountry>
    <customerState>QLD</customerState>
    <customerCity>Brisbane</customerCity>
    <customerAddress>123 Test Street</customerAddress>
    <customerPostCode>4000</customerPostCode>
    <customerPhone/><customerEmail/>
    <paymentFrequency>cycle</paymentFrequency>
    <paymentCurrency>AUD</paymentCurrency>
    <paymentInterval>7</paymentInterval>
    <intervalType>days</intervalType>
    <paymentStartDate>2017-06-30</paymentStartDate>
    <amountType>fixed_amount</amountType>
    <countType>unlimited</countType>
    <paymentAmount>10.00</paymentAmount>
    <recurringStatus>Active</recurringStatus>
    <nextBillingDate>2017-08-08</nextBillingDate>
    <nextBillingAmount>10.00</nextBillingAmount>
    <nextBillingCurrency>AUD</nextBillingCurrency>
</mwResponse>

unSuspendRecurring


The unSuspendRecurring method is used to unsuspend a suspended recurring bill.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: unSuspendRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Recurring Parameters

Parameter Required Description
recurringUUID Required The value of this parameter is used to identify each recurring. It is returned by addRecurring.
Example: 2-f6b2a37a-2f99-11e7-92a6-005056b209e0

Recurring Parameters

Parameter Required Description
suspendEndDate Not Required The date from which the suspended recurring bill should resume normal billing again.
Example: 2017-06-05
suspendNextBillingDate Not Required The date that the recurring bill will run again (your customer will be charged on this date).
Example: 2017-06-05


Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="deleteRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringUUID="2-47e69806-2fcd-11e7-92a6-005056b209e0" \
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'deleteRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'deleteRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringUUID': '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'deleteRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "deleteRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" },                  
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "deleteRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" }, _                 
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "deleteRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
</mwResponse>

deleteRecurring


The deleteRecurring method is used to delete a recurring bill from the platform.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: deleteRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Recurring Parameters

Parameter Required Description
recurringUUID Required The value of this parameter is used to identify each recurring. It is returned by addRecurring.
Example: 2-f6b2a37a-2f99-11e7-92a6-005056b209e0

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="queryRecurring" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringUUID="2-47e69806-2fcd-11e7-92a6-005056b209e0" \
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'queryRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'queryRecurring',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringUUID': '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'queryRecurring',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringUUID' => '2-47e69806-2fcd-11e7-92a6-005056b209e0',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebClient()) {
            byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/", 
                    new System.Collections.Specialized.NameValueCollection() {
                        { "method", "queryRecurring" },
                        { "merchantUUID", "4a3cda44663c5" },
                        { "apiKey", "2h7eognq" },
                        { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" },                
                        { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
                    });
            String result = System.Text.Encoding.Default.GetString(response);
            Console.WriteLine(result);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Linq

Public Module Program
    Public Sub Main(args As String())
        Using client = New System.Net.WebClient()
            Dim response As Byte() = client.UploadValues(
            "https://api.merchantwarrior.com/post/", 
            New System.Collections.Specialized.NameValueCollection() From { _
                { "method", "queryRecurring" }, _
                { "merchantUUID", "4a3cda44663c5" }, _
                { "apiKey", "2h7eognq" }, _
                { "recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0" }, _               
                { "hash", "d0fb5716a2b85c743ed802bd5bd7284b" }, _
            })
            Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
            Console.WriteLine(result)
        End Using
    End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;

public class Program{

    public static void main(String[] args) {
        try{
            URL url = new URL("https://api.merchantwarrior.com/post/");
            Map<String, String> params = new LinkedHashMap<>();
            params.put("method", "queryRecurring");
            params.put("merchantUUID", "4a3cda44663c5");
            params.put("apiKey", "2h7eognq");
            params.put("recurringUUID", "2-47e69806-2fcd-11e7-92a6-005056b209e0");
            params.put("hash", "b55552ff426d7e3d4885465d27ea0062");

            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String, String> param : params.entrySet()) {
              if (postData.length() != 0) 
                postData.append('&');
              postData.append(param.getKey());
              postData.append('=');
              postData.append(param.getValue());
            }
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setDoOutput(true);

            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
            writer.write(postData.toString());
            writer.flush();

            BufferedReader reader = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while((line = reader.readLine()) != null){
                sb.append(line);
            }
            System.out.println(sb.toString());
            writer.close();
            reader.close();
        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }

}

Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<mwResponse>
    <responseCode>0</responseCode>
    <responseMessage>Operation successful</responseMessage>
    <recurringUUID>2-d04792e6-49b3-11e7-92a6-005056b209e0</recurringUUID>
    <cardID>LJBW20886734</cardID>
    <suspendStartDate/>
    <suspendEndDate/>
    <suspendNextBillingDate/>
    <customerName>Madi</customerName>
    <customerCountry>AU</customerCountry>
    <customerState>QLD</customerState>
    <customerCity>Brisbane</customerCity>
    <customerAddress>123 Test Street</customerAddress>
    <customerPostCode>4000</customerPostCode>
    <customerPhone/>
    <customerEmail/>
    <paymentFrequency>cycle</paymentFrequency>
    <paymentCurrency>AUD</paymentCurrency>
    <paymentInterval>7</paymentInterval>
    <intervalType>days</intervalType>
    <paymentStartDate>2017-06-30</paymentStartDate>
    <amountType>fixed_amount</amountType>
    <countType>unlimited</countType>
    <paymentAmount>10.00</paymentAmount>
    <recurringStatus>Active</recurringStatus>
    <nextBillingDate>2017-07-07</nextBillingDate>
    <nextBillingAmount>10.00</nextBillingAmount>
    <nextBillingCurrency>AUD</nextBillingCurrency>
</mwResponse>

queryRecurring


The queryRecurring method is used to query the details of an existing recurring bill.

Request-Parameters

API Method

Parameter Required Description
method Required This field is case sensitive.
Example: queryRecurring

Authentication Parameters

Parameter Required Description
merchantUUID Required The value of this parameter is provided to you by Merchant Warrior.
Example: 123456789abcd
apiKey Required The value of this parameter is provided to you by Merchant Warrior.
Example: 1a3b5c

Recurring Parameters

Parameter Required Description
recurringUUID Required The value of this parameter is used to identify each recurring. It is returned by addRecurring.
Example: 2-f6b2a37a-2f99-11e7-92a6-005056b209e0

Verification Hash

Parameter Required Description
hash Required The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Recurring Type Hash for information on how to construct the hash correctly.
Example: e9ddc296b76b3398934bfc06239073df
Valid length: 32 characters
Sample Request
curl -X POST https://api.merchantwarrior.com/post/ \ 
    -d method="addRecurringPlan" \
    -d merchantUUID="4a3cda44663c5" \
    -d apiKey="2h7eognq" \
    -d recurringPlanName="Gym membership" \
    -d recurringPlanDesc="Bill members $10 weekly" \    
    -d paymentCurrency="AUD" \
    -d paymentFrequency="cycle" \
    -d paymentInterval="7" \
    -d intervalType="days" \
    -d paymentStartDate="2017-06-30" \
    -d amountType="fixed_amount" \
    -d paymentAmount="10.00" \
    -d countType="unlimited" \          
    -d hash="b55552ff426d7e3d4885465d27ea0062"
require 'net/http'
require 'uri'

uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
  'method' => 'addRecurringPlan',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringPlanName' => 'Gym membership',
  'recurringPlanDesc' => 'Bill members $10 weekly',  
  'paymentCurrency' => 'AUD',
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts response.body
import requests

data = {
  'method': 'addRecurringPlan',
  'merchantUUID': '4a3cda44663c5',
  'apiKey': '2h7eognq',
  'recurringPlanName': 'Gym membership',
  'recurringPlanDesc': 'Bill members $10 weekly',
  'paymentCurrency': 'AUD',
  'paymentFrequency': 'cycle',
  'paymentInterval': '7',
  'intervalType': 'days',
  'paymentStartDate': '2017-06-30',
  'amountType': 'fixed_amount',
  'paymentAmount': '10.00',
  'countType': 'unlimited',
  'hash': 'b55552ff426d7e3d4885465d27ea0062'
}

r = requests.post('https://api.merchantwarrior.com/post/', data = data)

print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');

// Setup POST data
$postData = array (
  'method' => 'addRecurringPlan',
  'merchantUUID' => '4a3cda44663c5',
  'apiKey' => '2h7eognq',
  'recurringPlanName' => 'Gym membership',
  'recurringPlanDesc' => 'Bill members $10 weekly',  
  'paymentCurrency' => 'AUD',
  'paymentFrequency' => 'cycle',
  'paymentInterval' => '7',
  'intervalType' => 'days',
  'paymentStartDate' => '2017-06-30',
  'amountType' => 'fixed_amount',
  'paymentAmount' => '10.00',
  'countType' => 'unlimited',
  'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);

// Setup CURL defaults
$curl = curl_init();

// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));

// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);

// Check for CURL errors
if (isset($error) && strlen($error)) {
    throw new Exception("CURL Error: {$error}");
}

// Parse the XML
$xml = simplexml_load_string($response);

// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;

// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;

// Make the response a little more useable
$result = array (
  'status' => $status, 
  'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
  'responseData' => $xml
);

exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;

public class Program {
    public static void Main(string[] args) {
        using(var client = new System.Net.WebCl