AOTG API: Get List of Debtor: Difference between revisions

(Created page with " ==Get a list of Debtor== Get all customers in account book. {{AOTGApiMethodsSpec|GET|/api/public/v1/Debtor}} <br/> ==Code Snippets== *Add header of "SOTC_AUTH", and assign va...")
 
 
(16 intermediate revisions by the same user not shown)
Line 1:
 
==Get a list of Debtor==
Get all customers in account book.
{{AOTGApiMethodsSpec|GET|/api/public/v1/Debtor|Params=None}}
==API Request Flow==
[[File:AOTGApiRequestFlow.png|link=]]
#Submit request for Debtor list
#:Obtain '''Id''' and '''Name''' from the response
#To check if the requested data is ready, use the '''Id''' to check status [Optional]
#:When the data is ready for retrieve, the '''Status''' is '''"Completed"'''.
#[[AOTG_API:_Get_List_of_Debtor#Get_Data_.28Result.29|Use '''Result''' method to get data]]
<br/>
==Code Snippets==
*Add header of '''"SOTC_AUTH"''', and assign value of '''AccessToken'''.
<br/>
{{AOTGApiCodeSnippetTab
Line 17 ⟶ 23:
IRestResponse response = client.Execute(request);
</syntaxhighlight>
|Python=
|PHPcURL=
<syntaxhighlight lang="PHP">
Line 76 ⟶ 83:
 
===Response===
====Response Successful HTTP Request====
Id and Name will be used to retrieve the data
200 OK
====Response Successful Body====
'''Id''' and '''Name''' willare be usedrequired to retrieve theresult (data).
<syntaxhighlight lang="json-object" highlight="2,3">
{
Line 87 ⟶ 97:
 
<br/>
 
==Check Status before Get Data==
===Code Snippets===
Line 154 ⟶ 165:
}}
 
====Response Status====
"RequestId": {{AOTGResponseStatus|"a8ccd53f-75d8-4c99-262f-6f6201e61b74",}}
Status shows the data is ready for retrieve.
 
<syntaxhighlight lang="json-object" highlight="3">
{
"RequestId": "a8ccd53f-75d8-4c99-262f-6f6201e61b74",
"Status": "Completed"
}
</syntaxhighlight>
<br/>
==Get Data (Result)==
Line 214 ⟶ 220:
 
$request = new HttpRequest();
$request->setUrl('http://smeonthecloudaotg.comcloud:8080/api/public/v1/Result/GetDebtorList/a8ccd53f-75d8-4c99-262f-6f6201e61b74/result');
$request->setMethod(HTTP_METH_GET);
 
Line 233 ⟶ 239:
}}
 
====Response From Result====
=====Response Successful HTTP Request=====
*The '''Id''' can be used for DELETE and GET debtor record.
200 OK
=====Response Successful Body=====
*The value "{[!MzAwLUEwMDE!]}" is the '''Id''' in '''ResultJson''' can be used for Update, DELETE and GET debtor record.
*'''ResultJson''' holds the array of debtor(s).
<tabber>
Body=
<syntaxhighlight lang="json-object">
{
Line 242 ⟶ 254:
"IPAddress": "---",
"RequestTypeName": "Debtor",
"ResultJson": "[{\"Id\":\"{[!MzAwLUEwMDE!]}\",\"AccNo\":\"300-A001\",\"CompanyName\":\"ABC CUSTOMER\",\"RegisterNo\":\"\",\"Description\":\"ABC CUSTOMER\",\"InvoiceAddress\":{\"Contact\":\"Mr.Tan\",\"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\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":15650.00,\"IsActive\":true,\"CurrencyCode\":\"MYR\",\"CurrencySymbol\":\"RM\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]},{\"Id\":\"{[!MzAwLVUwMDE!]}\",\"AccNo\":\"300-U001\",\"CompanyName\":\"USD CUSTOMER\",\"RegisterNo\":\"\",\"Description\":\"USD CUSTOMER\",\"InvoiceAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"DeliverAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":0.0,\"IsActive\":true,\"CurrencyCode\":\"USD\",\"CurrencySymbol\":\"USD\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]},{\"Id\":\"{[!MzAwLVMwMDE!]}\",\"AccNo\":\"300-S001\",\"CompanyName\":\"SGD CUSTOMER\",\"RegisterNo\":\"\",\"Description\":\"SGD CUSTOMER\",\"InvoiceAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"DeliverAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":190.00,\"IsActive\":true,\"CurrencyCode\":\"SGD\",\"CurrencySymbol\":\"SGD\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]}]",
\"CurrencyCode\":\"MYR\",\"CurrencySymbol\":\"RM\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,
\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]},{\"Id\":\"{[!MzAwLVUwMDE!]}\",\"AccNo\":\"300-U001\",\"CompanyName\":\"USD CUSTOMER\",
\"RegisterNo\":\"\",\"Description\":\"USD CUSTOMER\",\"InvoiceAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"DeliverAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",
\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":0.0,\"IsActive\":true,\"CurrencyCode\":\"USD\",\"CurrencySymbol\":\"USD\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,
\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]},{\"Id\":\"{[!MzAwLVMwMDE!]}\",\"AccNo\":\"300-S001\",\"CompanyName\":\"SGD CUSTOMER\",\"RegisterNo\":\"\",\"Description\":\"SGD CUSTOMER\",\"InvoiceAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"DeliverAddress\":{\"Contact\":\"\",\"Fax\":\"\",\"Phone\":\"\",\"Address1\":\"\",\"Address2\":\"\",\"Address3\":\"\",\"Address4\":\"\"},\"SalesAgent\":\"\",\"CreditTerm\":\"C.O.D.\",\"CreditLimit\":30000.00,\"NatureOfBusiness\":\"\",
\"WebURL\":\"\",\"EmailAddress\":\"\",\"Outstanding\":190.00,\"IsActive\":true,\"CurrencyCode\":\"SGD\",\"CurrencySymbol\":\"SGD\",\"BlockExceedCreditLimit\":false,\"TaxCode\":\"\",\"TaxRegistrationNo\":null,\"IsTaxRegistered\":null,
\"GSTStatusVerifiedDate\":null,\"IsInclusiveTax\":false,\"Area\":null,\"PriceCategory\":null,\"DetailDiscount\":\"\",\"SalesExemptionNo\":\"\",\"SalesExemptionExpiryDate\":null,\"BranchList\":null,\"TaxExemptionList\":[]}]",
"RequestParamJson": null,
"ResultStream": null,
Line 257 ⟶ 276:
}
</syntaxhighlight>
|-|
 
====Readable of ResultJson====
*'''ResultJson''' holds the array of debtor(s).
Highlighted shows the '''Id''' of the debtor which is the identifier of the debtor that is generated by AOTG.
 
<syntaxhighlight lang="json-object" highlight="3,51,99" line>
====Readable ResultJson====
Click '''Expand''' to view the data in readable format.
{|class="wikitable mw-collapsible mw-collapsed"
|
|-
|
<syntaxhighlight lang="json-object">
[
{
Line 414 ⟶ 427:
]
</syntaxhighlight>
</tabber>
|}
 
<br/>