How to search using API?

I found it’s not easy when search a customer or supplier.

Currently I have to pull index.json using curl to retrieve all keys then go into each key.json for details. It will take long time if there are hundreds of customers…

Are there easy way to search using the API?

Thanks.

1 Like

What are you searching for?

Ok, we are testing POS integration with Manager.

For example:

Order 50000005 sold and total $200 paid, there are two items on the receipt, Service 1 for $150 and Service 2 for $50.

Service 2 is from an external supplier (example Name: Bestau, Code: BEST), I want to record $50 Account Payable to the supplier’s account.

So, I will have to search in the supplier type to get the key of the supplier.

  1. visit the index.json of Supplier type to get the key of all suppliers. (PHP curl)

  2. loop into each key.json to find the match of

    {
    “Name”: “Bestau”,
    “Code”: “BEST”
    }

  3. return the key of the supplier account: 85e5bfdd-d2b2-457e-8a2e-d01f9a4896c6

  4. Then I post JSON data below to Manager API to generate the receipt.

    {
    “Date”: “2017-02-04”,
    “DebitAccount”: “aec25988-68b0-5888-afe5-8881be53fb7b”,
    “Description”: “Order 500000005”,
    “Lines”: [
    {
    “Description”: “Service 1”,
    “TaxCode”: “8cf9d118-3142-4d9c-82ee-b57a0e22c809”,
    “Qty”: 1.0,
    “Item”: “fba39684-35cb-5e0c-9165-fc1027f1eb77”,
    “Amount”: 150.00
    },
    {
    “Description”: “Service 2”,
    “Account”: “85e5bfdd-d2b2-457e-8a2e-d01f9a4896c6”,
    “TaxCode”: “10d8f8dc-db1e-4c87-9480-a696f59aeddf”,
    “Amount”: 50.00
    }
    ],
    “Reference”: “500000005”,
    “Payer”: “TEST”,
    “BankClearStatus”: “Cleared”
    }

During the process above, I found to locate the key of the supplier will take 90% of the processing time overall. So if I can use a search in step 1 or 2, like Name=Bestau or Code=BEST to locate the supplier key quicker, that will be great.

Any idea?