2,743
edits
No edit summary |
|||
(15 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=]]
Line 6 ⟶ 9:
#: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]]
▲==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 value of '''AccessToken'''.
<br/>
{{AOTGApiCodeSnippetTab
Line 24 ⟶ 23:
IRestResponse response = client.Execute(request);
</syntaxhighlight>
|Python=
|PHPcURL=
<syntaxhighlight lang="PHP">
Line 83:
===Response===
====Response Successful HTTP Request====
Id and Name will be used to retrieve the data▼
200 OK
====Response Successful Body====
<syntaxhighlight lang="json-object" highlight="2,3">
{
Line 94 ⟶ 97:
<br/>
==Check Status before Get Data==
===Code Snippets===
Line 161 ⟶ 165:
}}
====Response Status====
<syntaxhighlight lang="json-object" highlight="3">▼
▲ "RequestId": "a8ccd53f-75d8-4c99-262f-6f6201e61b74",
<br/>
==Get Data (Result)==
Line 221 ⟶ 220:
$request = new HttpRequest();
$request->setUrl('http://
$request->setMethod(HTTP_METH_GET);
Line 240 ⟶ 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 249 ⟶ 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\":[]}]",
"RequestParamJson": null,
"ResultStream": null,
Line 264 ⟶ 276:
}
</syntaxhighlight>
|-|▼
▲*'''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====
▲|-
[
{
Line 421 ⟶ 427:
]
</syntaxhighlight>
</tabber>
<br/>
|