AOTG API: Payment Method Lookup

From AutoCount Resource Center

Payment Method Lookup

Get a list of Payment Method in account book.

  • Payment method is used for selection of payment that is link to specific account.
  • Payment method is maintained in General Maintenance | Payment Method Maintenance.

API Method

Http Method: GET
Method: /api/public/v1/Lookup/PaymentMethodLookup
Content-Type: application/json
Parameters: None


Code Snippets

  • Add header of "SOTC_AUTH", and assign value of AccessToken.


<?php

$request = new HttpRequest();
$request->setUrl('http://aotg.cloud:8080/api/public/v1/Lookup/PaymentMethodLookup');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Content-Type' => 'application/json',
  'SOTC_AUTH' => 'SAMs1a36d2-a139-e911-b8b3-000aa03t3d'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

var client = new RestClient("http://aotg.cloud:8080/api/public/v1/Lookup/PaymentMethodLookup");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("SOTC_AUTH", "SAMs1a36d2-a139-e911-b8b3-000aa03t3d");
IRestResponse response = client.Execute(request);

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "8080",
  CURLOPT_URL => "http://aotg.cloud:8080/api/public/v1/Lookup/PaymentMethodLookup",
  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(
    "Content-Type: application/json",
    "SOTC_AUTH: SAMs1a36d2-a139-e911-b8b3-000aa03t3d",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

import requests

url = "http://aotg.cloud:8080/api/public/v1/Lookup/PaymentMethodLookup"

payload = ""
headers = {
    'SOTC_AUTH': "SAMs1a36d2-a139-e911-b8b3-000aa03t3d",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)


Response

Response Successful HTTP Request

200 OK

Response Successful Body

Sample data returns from PaymentMethodLookup.

[
    {
        "DataStructureVersion": 2,
        "Code": "CASH",
        "Description": "",
        "BankAccount": "320-0000",
        "PaymentType": "Cash",
        "IsActive": true,
        "CurrencyCode": "MYR"
    },
    {
        "DataStructureVersion": 2,
        "Code": "CHQ",
        "Description": "CHEQUE",
        "BankAccount": "310-B001",
        "PaymentType": "Cheque",
        "IsActive": true,
        "CurrencyCode": "MYR"
    },
    {
        "DataStructureVersion": 2,
        "Code": "BANK",
        "Description": "CHEQUE",
        "BankAccount": "310-B001",
        "PaymentType": "Cheque",
        "IsActive": true,
        "CurrencyCode": "MYR"
    }
]



See Also AOTG API


Go to menu

Go to top
Resources For AutoCount Software Developers