AOTG API: Create AR Invoice: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==<DRAFT>== |
|||
Incompleted! |
|||
<br/><br/> |
|||
==Create AR Invoice== |
==Create AR Invoice== |
||
Add a new AR Invoice to account book |
Add a new AR Invoice to account book |
||
Line 263: | Line 258: | ||
|Python= |
|Python= |
||
<syntaxhighlight lang="Python"> |
<syntaxhighlight lang="Python"> |
||
import requests |
|||
url = "http://aotg.cloud:8080/api/public/v1/Result/CreateARInvoice/def14c1a-cdb5-4aa4-834d-0b9c1faa1532/result" |
|||
payload = "" |
|||
headers = { |
|||
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d", |
|||
'cache-control': "no-cache" |
|||
} |
|||
response = requests.request("GET", url, data=payload, headers=headers) |
|||
print(response.text) |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|PHPHttp= |
|PHPHttp= |
||
<syntaxhighlight lang="PHP"> |
<syntaxhighlight lang="PHP"> |
||
<?php |
|||
$request = new HttpRequest(); |
|||
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Result/CreateARInvoice/def14c1a-cdb5-4aa4-834d-0b9c1faa1532/result'); |
|||
$request->setMethod(HTTP_METH_GET); |
|||
$request->setHeaders(array( |
|||
'cache-control' => 'no-cache', |
|||
'SOTC_AUTH' => 'SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d' |
|||
)); |
|||
try { |
|||
$response = $request->send(); |
|||
echo $response->getBody(); |
|||
} catch (HttpException $ex) { |
|||
echo $ex; |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|RestSharp= |
|RestSharp= |
||
<syntaxhighlight lang="C#"> |
<syntaxhighlight lang="C#"> |
||
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/Result/CreateARInvoice/def14c1a-cdb5-4aa4-834d-0b9c1faa1532/result"); |
|||
var request = new RestRequest(Method.GET); |
|||
request.AddHeader("cache-control", "no-cache"); |
|||
request.AddHeader("SOTC_AUTH", "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d"); |
|||
IRestResponse response = client.Execute(request); |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
|PHPcURL= |
|PHPcURL= |
||
<syntaxhighlight lang="PHP"> |
<syntaxhighlight lang="PHP"> |
||
<?php |
|||
$curl = curl_init(); |
|||
curl_setopt_array($curl, array( |
|||
CURLOPT_PORT => "8080", |
|||
CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Result/CreateARInvoice/def14c1a-cdb5-4aa4-834d-0b9c1faa1532/result", |
|||
CURLOPT_RETURNTRANSFER => true, |
|||
CURLOPT_ENCODING => "", |
|||
CURLOPT_MAXREDIRS => 10, |
|||
CURLOPT_TIMEOUT => 30, |
|||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
|||
CURLOPT_CUSTOMREQUEST => "GET", |
|||
CURLOPT_POSTFIELDS => "", |
|||
CURLOPT_HTTPHEADER => array( |
|||
"SOTC_AUTH: SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d", |
|||
"cache-control: no-cache" |
|||
), |
|||
)); |
|||
$response = curl_exec($curl); |
|||
$err = curl_error($curl); |
|||
curl_close($curl); |
|||
if ($err) { |
|||
echo "cURL Error #:" . $err; |
|||
} else { |
|||
echo $response; |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
}} |
}} |
||
Line 313: | Line 374: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
</tabber> |
</tabber> |
||
=====Transaction date 02/05/2020 is not in the maintained Fiscal Year Range |
=====Transaction date 02/05/2020 is not in the maintained Fiscal Year Range...===== |
||
<tabber> |
<tabber> |
||
Body= |
Body= |
||
Line 349: | Line 410: | ||
</tabber> |
</tabber> |
||
=====Unknown Sql Exception...===== |
=====Unknown Sql Exception...===== |
||
'''Unknonw Sql Exception''' is a general sql error. Therefore, the solution can be varied.<br/> |
|||
One of the reason this error was thrown is when "CurrencyCode" is not included in the json.<br/> |
|||
Below error was fixed after adding '''"CurrencyCode": "MYR"'''. |
|||
<tabber> |
<tabber> |
||
Body= |
Body= |
||
<syntaxhighlight lang="json-object"> |
<syntaxhighlight lang="json-object"> |
||
{ |
{ |
||
"RequestId": " |
"RequestId": "ffd14c1a-cdb5-4aa4-834d-0b9c0fea1e50", |
||
"RequestName": "CreateARInvoice", |
"RequestName": "CreateARInvoice", |
||
"HostName": "---", |
"HostName": "---", |