Skip to main content
All merchant endpoints require a valid Bearer token in the Authorization header.

List merchants

GET /v2/merchant_list Returns a paginated list of all DOSS-enabled merchants. The client sorts results by distance from the user’s GPS location and supports infinite scroll with fetchNextPage.

Query parameters

page
integer
The page number to fetch. Defaults to 1.

Response

data
object[]
Array of merchant objects for the current page.
current_page
integer
The current page number.
last_page
integer
The total number of pages available.
total
integer
Total number of merchant records across all pages.
curl https://dossapp.com/api/v2/merchant_list \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"

Usage in the app

The Merchant Locations screen uses useGetMethod with the merchant_list endpoint key. After fetching, the client:
  1. Calculates the distance from the user’s GPS coordinates to each merchant using the useDistance hook.
  2. Sorts the merchant array from nearest to furthest using lodash/sortBy.
  3. Applies a client-side name filter using lodash/filter when a search term is entered.
Merchant.jsx
const dat = map(data?.data, item => ({
  ...item,
  distance: calculateDistance(
    location?.coords?.latitude,
    location?.coords?.longitude,
    item.latitude,
    item.longitude,
  ),
}));

const sortedData = sortBy(dat, 'distance');

Build docs developers (and LLMs) love