We call the API. We don't read the receipt data from our own DB.
Transaction data (TID, MID, date and time, card number, RRN, amount, STAN, batch, store name) comes from the cloud layer API (CLOUD_LAYER_API_BASE_URL). The endpoints are /transactions, /cardTransactions and /merchant/statusTransactions. We use the response from that API.
DB is used only for merchant details:
the merchant reference number from user_metadata
the business name and logo from the logged-in user
the fallback address from MerchantStore
The address is the one exception. It comes first from another cloud API (getStoresData), and the DB is only the fallback.


Headers, the same for every call
Plain Text
Authorization: <CLOUD_LAYER_API_KEY>
content-type: application/x-www-form-urlencoded
cache-control: no-cache
The code (makeCurlCall) sends the body as form data, even on the GET calls. It turns off SSL verification and sends a hardcoded cookie.
Step 1: undated lookups, tried in this order until the transaction_id matches
Plain Text
# 1. Provider 3curl -X POST "$BASE/transactions?merchantRefId=$MREF&provider_id=3" \
  -H "Authorization: $KEY" -H "content-type: application/x-www-form-urlencoded" \
  -d "merchantRefId=$MREF&provider_id=3"# 2. Provider 1curl -X POST "$BASE/transactions?merchantRefId=$MREF&provider_id=1" \
  -H "Authorization: $KEY" -H "content-type: application/x-www-form-urlencoded" \
  -d "merchantRefId=$MREF&provider_id=1"# 3. Card transactionscurl -X POST "$BASE/cardTransactions?merchantRefId=$MREF" \
  -H "Authorization: $KEY" -H "content-type: application/x-www-form-urlencoded" \
  -d "merchantRefId=$MREF"
The response is read as data.transactions[]. The code loops through it and picks the item where transaction_id == <clicked id>.
Step 2: date-range lookup, used only if step 1 finds nothing
The window is the transaction date ±1 day, or the last 30 days if no date is given.
Plain Text
for EP in statusTransactions cardTransactions staticTransactions; docurl -X GET "$BASE/merchant/$EP?merchantRefId=$MREF&status=success&start_date=2026-11-02T00:00&end_date=2026-11-04T23:59" \
  -H "Authorization: $KEY" -H "content-type: application/x-www-form-urlencoded" \
  -d "merchantRefId=$MREF&status=success&start_date=2026-11-02T00:00&end_date=2026-11-04T23:59"done


Step 3: address, a separate cloud call
This is getDevicesData(), followed by getStoresData($storeId). Both are at MerchantDashboardController.php:1320 and :1353. I haven't read their URLs yet. Tell me if you want those too.
$MREF is user_metadata.merchant_refrence_number for the logged-in merchant.