Initiate Request

To begin the PayWeb3 integration process, the merchant sends a detailed request to the PayWeb initiate endpoint.

📘

All field names must be UPPERCASE as specified below.

Request Endpoint

POST https://secure.paygate.co.za/payweb3/initiate.trans

Sample request:

<?php

// Encryption key set in the Merchant Access Portal
$encryptionKey = 'secret';

$DateTime = new DateTime();

$data = array(
    'PAYGATE_ID'        => 10011072130,
    'REFERENCE'         => 'pgtest_123456789',
    'AMOUNT'            => 3299,
    'CURRENCY'          => 'ZAR',
    'RETURN_URL'        => 'https://my.return.url/page',
    'TRANSACTION_DATE'  => $DateTime->format('Y-m-d H:i:s'),
    'LOCALE'            => 'en-za',
    'COUNTRY'           => 'ZAF',
    'EMAIL'             => '[email protected]',
);

$checksum = md5(implode('', $data) . $encryptionKey);
$data['CHECKSUM'] = $checksum;

$fieldsString = http_build_query($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://secure.paygate.co.za/payweb3/initiate.trans');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsString);
$result = curl_exec($ch);
curl_close($ch);
?>
const axios = require('axios');
const crypto = require('crypto');

// Encryption key set in the Merchant Access Portal
const encryptionKey = 'secret';

const data = {
  PAYGATE_ID: '10011072130',
  REFERENCE: 'pgtest_123456789',
  AMOUNT: 3299,
  CURRENCY: 'ZAR',
  RETURN_URL: 'https://my.return.url/page',
  TRANSACTION_DATE: new Date().toISOString().replace('T', ' ').substring(0, 19),
  LOCALE: 'en-za',
  COUNTRY: 'ZAF',
  EMAIL: '[email protected]'
};

// Generate checksum
const checksumString = Object.values(data).join('') + encryptionKey;
data.CHECKSUM = crypto.createHash('md5').update(checksumString).digest('hex');

// Send the request
axios.post('https://secure.paygate.co.za/payweb3/initiate.trans', new URLSearchParams(data).toString(), {
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Referer': 'yourdomain.com' // Replace with your actual domain
  }
})
.then(response => {
  console.log('Response:', response.data);
})
.catch(error => {
  console.error('Error:', error);
});
📘

See the list of supported locale and country codes.

Request Fields

FieldDescriptionTypeRequirement
PAYGATE_IDYour PayGate ID – assigned by PayGatevarchar(20)
REFERENCEYour internal reference for the transactionvarchar(110)
AMOUNTAmount in cents (e.g. 32.99 = 3299)varchar(20)
CURRENCYCurrency code (e.g. ZAR)varchar(5)
RETURN_URLWhere the customer should be redirected after paymentvarchar(255)
TRANSACTION_DATEUTC-formatted timestamp of the transactiondatetime
LOCALECustomer locale (e.g. en-za)varchar(5)☑️
COUNTRYCountry code (e.g. ZAF)varchar(5)☑️
EMAILCustomer email address for confirmationvarchar(255)
PAY_METHODRestrict to a specific payment methodvarchar(5)🚫
PAY_METHOD_DETAILDetail for the payment method (if applicable)varchar(45)🚫
NOTIFY_URLURL to receive a real-time responsetext☑️
USER1Custom field 1 – must be included in CHECKSUM if usedvarchar(255)☑️
USER2Custom field 2varchar(255)☑️
USER3Custom field 3varchar(255)☑️
VAULTSet to 1 to tokenise card using PayVaulttinyint(3)☑️
VAULT_IDToken to use a saved card (if PayVault is enabled)varchar(40)☑️
CHECKSUMMD5 hash of all fields + encryption keyvarchar(40)

Sample Response (Success)

The Initiate request returns standard HTTP POST data structured like this:

PAYGATE_ID=10011072130
&PAY_REQUEST_ID=23B785AE-C96C-32AF-4879-D2C9363DB6E8
&REFERENCE=pgtest_123456789
&CHECKSUM=b41a77f83a275a849f23e30b4666e837

Response Fields

FieldDescriptionType
PAYGATE_IDSame PayGate ID sent in the requestvarchar(20)
PAY_REQUEST_IDGUID generated for this transactionvarchar(36)
REFERENCESame reference value sent in the requestvarchar(110)
CHECKSUMMD5 hash of the response fieldsvarchar(32)

For possible errors returned in the response, see: PayWeb3 Error Codes