---
updatedAt: 2025-08-12T18:55:16.000Z
agentTools:
  projectIndex: https://docs.staxpayments.com/llms.txt
---

# Find all Customer

Retrieve a list of customers associated with a merchant's account.

The **Find All Customers** endpoint retrieves a list of customers associated with a merchant's account. This includes all stored customer records that can be filtered, sorted, and searched using flexible query parameters. If no matching customers are found, the `data` array in the response will be empty.

***

## Key Features

* **Retrieve All Customers**: Access a comprehensive list of customer records tied to the merchant account.
* **Search and Filter**: Supports advanced filtering by fields such as name, email, company, and custom keywords.
* **Sorting Options**: Allows sorting results by specific attributes like `firstname` or `created_at` in ascending or descending order.
* **Integration with Update Customer**: Use the Update a Customer endpoint to modify customer details retrieved from this endpoint.

***

## Usage Notes

### Query Parameters

| Parameter    | Type   | Description                                   | Example                                     |
| ------------ | ------ | --------------------------------------------- | ------------------------------------------- |
| `firstname`  | string | Filter customers by first name.               | `/customer?firstname=James`                 |
| `lastname`   | string | Filter customers by last name.                | `/customer?lastname=Wilson`                 |
| `email`      | string | Search customers by email.                    | `/customer?email=@abc.com`                  |
| `reference`  | string | Search by a custom reference field.           | `/customer?reference=order123`              |
| `keywords[]` | array  | Search across multiple fields using keywords. | `/customer?keywords[]=James&keywords[]=123` |

<br />

### Sorting and Ordering Parameters

| Parameter | Type   | Description                                                     | Example                                |
| --------- | ------ | --------------------------------------------------------------- | -------------------------------------- |
| `sort`    | string | Attribute to sort by (e.g., `firstname`, `lastname`).           | `/customer?sort=firstname&order=ASC`   |
| `order`   | string | Sorting order, either ascending (`ASC`) or descending (`DESC`). | `/customer?sort=created_at&order=DESC` |

***

## Response Structure

| Code | Response              | Description                                    |
| ---- | --------------------- | ---------------------------------------------- |
| 200  | Success               | Returns a list of matching customer records.   |
| 400  | Bad Request           | Invalid query parameters or malformed request. |
| 401  | Unauthorized          | API key invalid or missing.                    |
| 500  | Internal Server Error | An unexpected error occurred on the server.    |

***

## Important Considerations

**Keyword Searches**: Using the `keywords[]` parameter performs a broad search across most customer fields but can be slower, especially with large datasets.

**Empty Results**: If no customers match the query, the `data` array in the response will be empty, and the `total` will be 0.

**Sorting Defaults**: If no `sort` parameter is provided, results are ordered by `created_at` in descending order (`DESC`) by default.

**Pagination**: For larger datasets, consider implementing pagination for better performance.

***

## Best Practices

* Use targeted filters (e.g., `email` or `reference`) to narrow down results for faster response times.
* Combine multiple query parameters to refine searches, such as `/customer?firstname=James&email=@example.com`.
* When using `keywords[]`, limit the number of terms for optimal performance.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "stax-api",
    "version": "0.1"
  },
  "servers": [
    {
      "url": "https://apiprod.fattlabs.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "API key for merchant-level operations. Provides access to merchant-specific endpoints including transactions, payments, customer management, and merchant account settings. This key is scoped to a single merchant account and cannot access partner-level functionality."
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/customer": {
      "get": {
        "summary": "Find all Customer",
        "description": "Retrieve a list of customers associated with a merchant's account.",
        "operationId": "find-all-customers",
        "parameters": [
          {
            "name": "firstname",
            "in": "query",
            "description": "Max: 255. Required if no lastname, email, company supplied",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lastname",
            "in": "query",
            "description": "Max: 255. Required if no firstname, email, company supplied",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Max: 255. Required if no firstname, lastname, company supplied",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "company",
            "in": "query",
            "description": "Max: 255. Required if no firstname, lastname, email supplied",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "description": "Matching regex: /[0-9]{10,15}/",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_1",
            "in": "query",
            "description": "Max: 255",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_2",
            "in": "query",
            "description": "Max: 255",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_city",
            "in": "query",
            "description": "Max: 255",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_state",
            "in": "query",
            "description": "Max: 2",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_zip",
            "in": "query",
            "description": "Max: 16",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address_country",
            "in": "query",
            "description": "Max: 3",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "notes",
            "in": "query",
            "description": "Max: 21844.  For internal notes only; not visible to customers in invoices or communications.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "description": "Max: 255. This field is for the merchant's internal use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "files",
            "in": "query",
            "description": "Array of strings(50) where each index is a valid file_id",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "cc_emails",
            "in": "query",
            "description": "Array of strings(255) where each index is a valid email address",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "cc_sms",
            "in": "query",
            "description": "Array of strings(255) where each index is a valid email address",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "allow_invoice_credit_card_payments",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "keywords[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"total\": 2,\n  \"per_page\": 50,\n  \"current_page\": 1,\n  \"last_page\": 1,\n  \"next_page_url\": null,\n  \"prev_page_url\": null,\n  \"from\": 1,\n  \"to\": 2,\n  \"data\": [\n    {\n      \"id\": \"5ff4e048-c9f3-4993-81be-f7253d132c19\",\n      \"firstname\": \"John\",\n      \"lastname\": \"Smith\",\n      \"company\": \"ABC INC\",\n      \"email\": \"john@abc.com\",\n      \"cc_emails\": null,\n      \"phone\": \"1234567898\",\n      \"address_1\": \"123 Rite Way\",\n      \"address_2\": \"Unit 12\",\n      \"address_city\": \"Orlando\",\n      \"address_state\": \"FL\",\n      \"address_zip\": \"32801\",\n      \"address_country\": \"USA\",\n      \"notes\": \"\",\n      \"reference\": \"\",\n      \"options\": null,\n      \"created_at\": \"2016-04-26 13:52:10\",\n      \"updated_at\": \"2016-04-26 13:52:10\",\n      \"deleted_at\": null,\n      \"gravatar\": \"//www.gravatar.com/avatar/144fa42eb34883ecb00cbc3f81a060a1\",\n      \"has_address\": true,\n      \"missing_address_components\": []\n    },\n    {\n      \"id\": \"c20db54e-4078-46d9-9c09-2287612c8840\",\n      \"firstname\": \"John\",\n      \"lastname\": \"Smith\",\n      \"company\": \"ABC INC\",\n      \"email\": \"john@abc.com\",\n      \"cc_emails\": null,\n      \"phone\": \"1234567898\",\n      \"address_1\": \"123 Rite Way\",\n      \"address_2\": \"Unit 12\",\n      \"address_city\": \"Orlando\",\n      \"address_state\": \"FL\",\n      \"address_zip\": \"32801\",\n      \"notes\": \"\",\n      \"reference\": \"\",\n      \"options\": null,\n      \"created_at\": \"2016-04-25 15:24:03\",\n      \"updated_at\": \"2016-04-25 15:24:03\",\n      \"deleted_at\": null,\n      \"gravatar\": \"//www.gravatar.com/avatar/144fa42eb34883ecb00cbc3f81a060a1\",\n      \"has_address\": true,\n      \"missing_address_components\": []\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "example": 2,
                      "default": 0
                    },
                    "per_page": {
                      "type": "integer",
                      "example": 50,
                      "default": 0
                    },
                    "current_page": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "last_page": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "next_page_url": {},
                    "prev_page_url": {},
                    "from": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "to": {
                      "type": "integer",
                      "example": 2,
                      "default": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "5ff4e048-c9f3-4993-81be-f7253d132c19"
                          },
                          "firstname": {
                            "type": "string",
                            "example": "John"
                          },
                          "lastname": {
                            "type": "string",
                            "example": "Smith"
                          },
                          "company": {
                            "type": "string",
                            "example": "ABC INC"
                          },
                          "email": {
                            "type": "string",
                            "example": "john@abc.com"
                          },
                          "cc_emails": {},
                          "phone": {
                            "type": "string",
                            "example": "1234567898"
                          },
                          "address_1": {
                            "type": "string",
                            "example": "123 Rite Way"
                          },
                          "address_2": {
                            "type": "string",
                            "example": "Unit 12"
                          },
                          "address_city": {
                            "type": "string",
                            "example": "Orlando"
                          },
                          "address_state": {
                            "type": "string",
                            "example": "FL"
                          },
                          "address_zip": {
                            "type": "string",
                            "example": "32801"
                          },
                          "address_country": {
                            "type": "string",
                            "example": "USA"
                          },
                          "notes": {
                            "type": "string",
                            "example": ""
                          },
                          "reference": {
                            "type": "string",
                            "example": ""
                          },
                          "options": {},
                          "created_at": {
                            "type": "string",
                            "example": "2016-04-26 13:52:10"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2016-04-26 13:52:10"
                          },
                          "deleted_at": {},
                          "gravatar": {
                            "type": "string",
                            "example": "//www.gravatar.com/avatar/144fa42eb34883ecb00cbc3f81a060a1"
                          },
                          "has_address": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "missing_address_components": {
                            "type": "array"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```