skip to content

API - Add New Payment

URL: GenerateNewPayment.php

Required Fields:

username
password
ClientID
PaymentDate (YYYY-MM-DD format)
PaymentAmount (9999.99 format)

Optional Fields:

PaymentMethod (Cash,EFT,Debit Order, Credit Card, Debit Card, or any other string value. Defaults to Cash)
ReferenceNumber (String value, max 30 chars)
Description (String value)
SendThankYou (true or false - will include the description in the proof of payment email sent)
EmailToClient (true or false)

Returns:

JSON array containing:

$array[url] - the url where the document can be downloaded
$array[invoice_nr] - the payout number
$array[email_url] - url to open to have the document emailed to the client

Example PHP code

$param['username'] = '';
$param['password'] = '';
$param['ClientID'] = '';
$param['PaymentDate'] = '2015-01-25'; 
$param['PaymentAmount'] = '199.99';
	
foreach ($param as $key => $val) {
  $request.= $key . '=' . urlencode($val);
  $request.= '&';
}
$request = substr($request, 0, -1); //remove trailing &

$url = 'https://www.invoicesonline.co.za/api/GenerateNewPayment.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //set the url
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //return as a variable
curl_setopt($ch, CURLOPT_POST, 1); //set POST method
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); //set the POST variables
$response = curl_exec($ch); //run the whole process and return the response

 

Updated: Tue, 16 August 2016