<?php
$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Debtor');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'SOTC_AUTH' => 'SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d',
'Content-Type' => 'application/json'
));
$request->setBody('{
"Id": "{[!MzAwLUEwMDI!]}",
"CompanyName": "AutoCount On The Go",
"RegisterNo": "",
"Description": "AOTG Team",
"InvoiceAddress": {
"Contact": "Mr.Lee",
"Fax": "",
"Phone": "02111373",
"Address1": "1/2, PINE STREET,",
"Address2": "CENTURY ROAD,",
"Address3": "SELANGOR",
"Address4": "50000 MALAYSIA"
},
"DeliverAddress": {
"Contact": "Mr.Tan",
"Fax": "",
"Phone": "02111373",
"Address1": "1/2, PINE STREET,",
"Address2": "Delivery CENTURY ROAD,",
"Address3": "SELANGOR",
"Address4": "50000 MALAYSIA"
},
"CreditTerm": "C.O.D.",
"CreditLimit": 30000,
"WebURL": "",
"EmailAddress": "",
"IsActive": true,
"CurrencyCode": "MYR",
"IsTaxRegistered": null,
"IsInclusiveTax": false
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}