AOTG API: Create AR Invoice: Difference between revisions

No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 20:
url = "http://aotg.cloud:8080/api/public/v1/ARInvoice/CreateARInvoice"
 
payload = "{\r\n \"DebtorCode\": \"300-A001\",\r\n \"Description\": \"AOTG IMPORT TEST A\",\r\n \"DocDate\": \"01-01-2019\",\r\n \"DocNo\": \"AOTG007\",\r\n \"JournalType\": \"SALES\",\r\n \"RefNo2\": \"AOTG Web API\",\r\n \"InclusiveTax\": true,\r\n \"Agent\": \"TOM\",\r\n \"CreditTerm\": \"Net 30 days\",\r\n \"CurrencyCode\": \"MYR\",\r\n \"DetailsLine\": [\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 1\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 350\r\n },\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 2\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 5\r\n }\r\n ]\r\n}"
headers = {
'SOTC_AUTH': "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d",
Line 58:
"DetailsLine": [
{
"LineState": 01,
"AccNo": "500-0000",
"Description": "AOTG Sales Detail 1",
Line 65:
},
{
"LineState": 01,
"AccNo": "500-0000",
"Description": "AOTG Sales Detail 2",
Line 89:
request.AddHeader("Content-Type", "application/json");
request.AddHeader("SOTC_AUTH", "SAMc13a36d2-a139-e911-b8b3-000d3aa04f3d");
request.AddParameter("undefined", "{\r\n \"DebtorCode\": \"300-A001\",\r\n \"Description\": \"AOTG IMPORT TEST A\",\r\n \"DocDate\": \"01-01-2019\",\r\n \"DocNo\": \"AOTG007\",\r\n \"JournalType\": \"SALES\",\r\n \"RefNo2\": \"AOTG Web API\",\r\n \"InclusiveTax\": true,\r\n \"Agent\": \"TOM\",\r\n \"CreditTerm\": \"Net 30 days\",\r\n \"CurrencyCode\": \"MYR\",\r\n \"DetailsLine\": [\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 1\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 350\r\n },\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 2\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 5\r\n }\r\n ]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
</syntaxhighlight>
Line 107:
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\r\n \"DebtorCode\": \"300-A001\",\r\n \"Description\": \"AOTG IMPORT TEST A\",\r\n \"DocDate\": \"01-01-2019\",\r\n \"DocNo\": \"AOTG007\",\r\n \"JournalType\": \"SALES\",\r\n \"RefNo2\": \"AOTG Web API\",\r\n \"InclusiveTax\": true,\r\n \"Agent\": \"TOM\",\r\n \"CreditTerm\": \"Net 30 days\",\r\n \"CurrencyCode\": \"MYR\",\r\n \"DetailsLine\": [\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 1\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 350\r\n },\r\n {\r\n \"LineState\": 01,\r\n \"AccNo\": \"500-0000\",\r\n \"Description\": \"AOTG Sales Detail 2\",\r\n \"Tax\": \"S-10\",\r\n \"Amount\": 5\r\n }\r\n ]\r\n}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
Line 148:
 
<br/>
 
==Get Status of the Create Debtor==
===Code Snippets===
Line 234 ⟶ 235:
 
====Response Status====
{{AOTGResponseStatus|"def14c1a-cdb5-4aa4-834d-0b9c1faa1532"}}
 
<br/>
 
==Use RESULT method to get the failed reason of Create Debtor request==
===Code Snippets===
Line 328 ⟶ 330:
<syntaxhighlight lang="json-object">
{
"RequestId": "2t2daceedef14c1a-59ddcdb5-4ac14aa4-85eb834d-450fc71ef78d0b9c1faa1532",
"RequestName": "CreateARInvoice",
"HostName": "---",
Line 363 ⟶ 365:
<syntaxhighlight lang="json-object">
{
"RequestId": "e760a918def14c1a-8d9bcdb5-47084aa4-9513834d-c510y01efa140b9c1faa1532",
"RequestName": "CreateARInvoice",
"HostName": "---",
Line 393 ⟶ 395:
</syntaxhighlight>
</tabber>
 
=====Unknown Sql Exception...=====
'''Unknonw Sql Exception''' is a general sql error. Therefore, the solution can be varied.<br/>
Line 401 ⟶ 404:
<syntaxhighlight lang="json-object">
{
"RequestId": "f2d14c1adef14c1a-cdb5-4aa4-834d-0b9c0fea1e500b9c1faa1532",
"RequestName": "CreateARInvoice",
"HostName": "---",