Get all customers
curl --request GET \
--url https://api-production.fossapay.com/api/v1/customers \
--header 'x-api-key: <api-key>'import requests
url = "https://api-production.fossapay.com/api/v1/customers"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-production.fossapay.com/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-production.fossapay.com/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-production.fossapay.com/api/v1/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-production.fossapay.com/api/v1/customers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-production.fossapay.com/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"statusCode": 200,
"message": "Customers retrieved successfully",
"data": {
"result": [
{
"id": "11111111-1111-4111-8111-111111111111",
"businessId": "22222222-2222-4222-8222-222222222222",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"emailAddress": "john.doe@example.com",
"mobileNumber": "+2348012345678",
"dob": "1990-08-15",
"customerType": "individual",
"address": "123 Example Street",
"city": "Lagos",
"createdAt": "2026-01-08T21:39:52+01:00"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
}
{
"status": "error",
"statusCode": 401,
"message": "Invalid API key"
}
Customers
Get All Customers
Retrieve customers owned by the authenticated merchant
GET
/
api
/
v1
/
customers
Get all customers
curl --request GET \
--url https://api-production.fossapay.com/api/v1/customers \
--header 'x-api-key: <api-key>'import requests
url = "https://api-production.fossapay.com/api/v1/customers"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-production.fossapay.com/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-production.fossapay.com/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-production.fossapay.com/api/v1/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-production.fossapay.com/api/v1/customers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-production.fossapay.com/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"statusCode": 200,
"message": "Customers retrieved successfully",
"data": {
"result": [
{
"id": "11111111-1111-4111-8111-111111111111",
"businessId": "22222222-2222-4222-8222-222222222222",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"emailAddress": "john.doe@example.com",
"mobileNumber": "+2348012345678",
"dob": "1990-08-15",
"customerType": "individual",
"address": "123 Example Street",
"city": "Lagos",
"createdAt": "2026-01-08T21:39:52+01:00"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
}
{
"status": "error",
"statusCode": 401,
"message": "Invalid API key"
}
Overview
Retrieve a merchant-scoped, paginated list of customers. Results are ordered by the selected field and direction.Request
string
required
Your API key for authentication
Parameters
string
Sort direction:
asc or desc (default: desc). Values are case-insensitive.string
Field to sort by:
createdAt, firstName, lastName, emailAddress
(default: createdAt)string
Search term to filter customers by name or email
number
Number of customers to return per page (default: 10, max: 100)
number
Page number to retrieve (default: 1)
Response
string
Response status:
success or errornumber
HTTP status code (200 for successful retrieval)
string
Human-readable response message
object
Contains
result, an array of customer objects, and pagination, the page metadata.Response Example
{
"status": "success",
"statusCode": 200,
"message": "Customers retrieved successfully",
"data": {
"result": [
{
"id": "11111111-1111-4111-8111-111111111111",
"businessId": "22222222-2222-4222-8222-222222222222",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"emailAddress": "john.doe@example.com",
"mobileNumber": "+2348012345678",
"dob": "1990-08-15",
"customerType": "individual",
"address": "123 Example Street",
"city": "Lagos",
"createdAt": "2026-01-08T21:39:52+01:00"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
}
{
"status": "error",
"statusCode": 401,
"message": "Invalid API key"
}
Example
- cURL
- Node.js
curl -X GET "https://api-production.fossapay.com/api/v1/customers?sortOrder=desc&sortBy=createdAt&search=john&page=1&limit=10" \
-H "x-api-key: $FOSSAPAY_API_KEY"
const response = await fetch(
"https://api-production.fossapay.com/api/v1/customers?sortOrder=desc&sortBy=createdAt&search=john&page=1&limit=10",
{
method: "GET",
headers: {
"x-api-key": process.env.FOSSAPAY_API_KEY,
},
},
);
const customers = await response.json();
if (!response.ok) throw new Error(customers.message);
Errors
| Status | Typical cause |
|---|---|
401 | Missing or invalid API key |
422 | Invalid page, limit, sort field, or sort order |
Results are scoped to the merchant associated with
x-api-key. An empty result array is a successful response.Authorizations
Query Parameters
Case-insensitive. Values are normalized internally to ASC or DESC.
Available options:
asc, desc Available options:
createdAt, firstName, lastName, emailAddress Required range:
1 <= x <= 100Required range:
x >= 1
