Lookup and code lists
Lookup
Section titled “Lookup”When you’re not sure whether Slflo has something — before creating it, say — ask:
GET /lookup?entity=customer&external_ref=CUST-0042
curl -X GET 'https://api.slflo.com/api/integration/v1/lookup?entity=customer&external_ref=CUST-0042' \ -H 'Authorization: Bearer $SLFLO_TOKEN'Response
HTTP 200
{ "data": { "entity": "customer", "id": "C0000001", "number": "CUST-1", "external_ref": "CUST-0042", "external_number": null, "version": 9123, "exists": true }}entityiscustomer,branch,product,unit,price_list,warehouse,order,invoice,payment(orreceipt),return(orcredit_note).- Send
external_ref(yours) orid(ours), not both. - A miss — never known, another company’s, or deleted since — is
"exists": false, not a 404. - It needs a scope of the entity’s family: a customers scope for a customer or branch,
catalog:writefor a product or unit,prices:writefor a price list,catalog:writeor a stock scope for a warehouse, and the read or write scope for an order, invoice, payment or return.
Code lists
Section titled “Code lists”GET /reference/{kind} gives the codes our documents carry, so you can map them once. It needs
no scope.
kind |
Holds |
|---|---|
payment-methods |
What a payment’s method can be |
return-reasons |
What a return’s reason can be |
order-statuses, return-statuses, cheque-statuses |
Lifecycle states |
tax-codes |
VAT with the company’s rate |
currencies, units, warehouses, price-lists |
The company’s own rows, with your key beside ours |
Each item is {code, name: {en, ar}, id, external_ref, attributes}. An unknown kind answers 404
with the valid kinds.
Try it
Section titled “Try it”curl -s "$SLFLO_BASE/lookup?entity=product&external_ref=JUICE-1L" -H "Authorization: Bearer $SLFLO_TOKEN" | jq -c .datacurl -s "$SLFLO_BASE/reference/payment-methods" -H "Authorization: Bearer $SLFLO_TOKEN" | jq -r '.data[].code'Lookup by external_ref finds only keys an ERP has pushed or acked, not Slflo’s own codes. So
on a fresh sandbox the first answers "exists": false; after anyone pushes
PUT /products/JUICE-1L (which adopts the juice, whose code is the same) it answers with the
product’s id. The second lists CASH, CHEQUE, TRANSFER, INSTAPAY and WALLET.

