URL: getClients_JSON.php
to use as JSON, append ?apiformat=json to the URL, then send through all variables as a JSON encoded string.
username
password
JSON encoded array of all clients in the following format:
$array[client_id][field_name] = field_value;
client_id: ID of the client - unique to this business, but not globally unique (when using this client id, the business id is always also required)
client_invoice_name
client_account_number
client_vat_nr
client_phone_nr
client_phone_nr2
client_fax_nr
client_mobile_nr
client_email
contact_name
contact_surname
client_postal_address1
client_postal_address2
client_postal_address3
client_postal_address4
client_physical_address1
client_physical_address2
client_physical_address3
client_physical_address4
client_notes - max 10,000 characters - Notes on the client (should not be made visible to the client)
active - 1 or 0
balance - decimal(20,2) - current balance of the client
opening_balance - decimal(20,2) - initial balance of the client, should always be deducted from the current balance, in order to obtain the true current balance
customerzone_link - link to the customer zone
$param['username'] = '';
$param['password'] = '';
$url = 'https://www.jobcardsonline.co.za/api/getClients_JSON.php?apiformat=json';
$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, json_encode($param)); //set the POST variables
$response = curl_exec($ch); //run the whole process and return the response
Updated: Thu, 21 September 2023