---
title: Page through and search customers
slug: amberflo-api/page-through-and-search-customers
createdAt: 2024-11-07T15:10:16.978Z
---

{
  "id": "xjm6PmaD9FRdc8LtqyFuj",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/customers/paging",
    "servers": [
      {
        "url": "https://app.amberflo.io/customers/paging"
      }
    ],
    "name": "Page through and search customers",
    "description": "<p>This endpoint allows you to page through the list of customers, filter, sort and search customers.</p>\n<p>For more details, see <a>Searching, Paging, and Sorting</a>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "limit",
          "type": "integer<int32>",
          "description": "Maximum number of customers per page."
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "integer<int32>",
          "description": "Page number."
        },
        {
          "kind": "optional",
          "name": "isAscending",
          "type": "boolean",
          "description": ""
        },
        {
          "kind": "optional",
          "name": "sort",
          "type": "string",
          "description": "Which field to sort the customers by."
        },
        {
          "kind": "optional",
          "name": "search",
          "type": "string",
          "description": "<p>Filter customers by searching for the provided string in <code>customerName</code>, <code>customerId</code> and <code>customerEmail</code>.</p>"
        },
        {
          "kind": "optional",
          "name": "enabled",
          "type": "boolean",
          "description": "<p>If set, filter customers by their status: enabled (<code>true</code>) or disabled (<code>false</code>).</p>"
        },
        {
          "kind": "optional",
          "name": "idlist",
          "type": "array",
          "description": "Comma separated list of `customerId`s to retrieve.\n\nWhen providing this parameter, the others are ignored.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "lifecycleStage",
          "type": "string",
          "description": "Filter customers by lifecycle stage."
        },
        {
          "kind": "optional",
          "name": "deletedCustomers",
          "type": "string",
          "description": "<p>Filter customers based on their deleted state. By default deleted customers will not be included in the response.</p>\n<ul>\n<li><code>INCLUDE</code> - includes deleted customers in the results.</li>\n<li><code>EXCLUDE</code> - does not include deleted customers in the results.</li>\n<li><code>ONLY</code> - returns only deleted customers in the results.</li>\n</ul>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "metadata.customer.paging.CustomerPagingResponse.out",
            "schema": [
              {
                "name": "metadata",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/metadata.customer.paging.CustomerPagingMetadata.out",
                "customType": "metadata.customer.paging.CustomerPagingMetadata.out",
                "schema": [
                  {
                    "name": "limit",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Maximum number of customers per page.",
                    "example": 0
                  },
                  {
                    "name": "page",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Page number.",
                    "example": 0
                  },
                  {
                    "name": "isAscending",
                    "kind": "optional",
                    "type": "boolean",
                    "example": ""
                  },
                  {
                    "name": "sort",
                    "kind": "optional",
                    "type": "string",
                    "description": "Which field to sort the customers by.",
                    "example": ""
                  },
                  {
                    "name": "search",
                    "kind": "optional",
                    "type": "string",
                    "description": "Filter customers by searching for the provided string in `customerName`, `customerId` and `customerEmail`.",
                    "example": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "If set, filter customers by their status: enabled (`true`) or disabled (`false`).",
                    "example": ""
                  },
                  {
                    "name": "idlist",
                    "kind": "optional",
                    "type": "array",
                    "description": "Comma separated list of `customerId`s to retrieve.\n\nWhen providing this parameter, the others are ignored.",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "lifecycleStage",
                    "kind": "optional",
                    "type": "string",
                    "description": "Filter customers by lifecycle stage.",
                    "modelRef": "#/components/schemas/metadata.customer.CustomerLifecycleStage.out",
                    "customType": "metadata.customer.CustomerLifecycleStage.out",
                    "schema": []
                  },
                  {
                    "name": "deletedCustomers",
                    "kind": "optional",
                    "type": "string",
                    "description": "Filter customers based on their deleted state. By default deleted customers will not be included in the response.\n\n- `INCLUDE` - includes deleted customers in the results.\n- `EXCLUDE` - does not include deleted customers in the results.\n- `ONLY` - returns only deleted customers in the results.",
                    "modelRef": "#/components/schemas/metadata.customer.paging.DeletedCustomers.out",
                    "customType": "metadata.customer.paging.DeletedCustomers.out",
                    "schema": []
                  },
                  {
                    "name": "totalRowCount",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Total number of customers.",
                    "example": 0
                  },
                  {
                    "name": "filteredRowCount",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Total number of customers after applying the filters.",
                    "example": 0
                  },
                  {
                    "name": "totalFilteredPages",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Total number of pages, after applying the filters.",
                    "example": 0
                  }
                ]
              },
              {
                "name": "items",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/metadata.customer.CustomerDetails.out",
                "customType": "metadata.customer.CustomerDetails.out[]",
                "schema": [
                  {
                    "name": "createTime",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Creation time in [Unix time](https://en.wikipedia.org/wiki/Unix_time) (milliseconds)",
                    "example": 0
                  },
                  {
                    "name": "updateTime",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Update time in [Unix time](https://en.wikipedia.org/wiki/Unix_time) (milliseconds)",
                    "example": 0
                  },
                  {
                    "name": "deleteTime",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "customerId",
                    "kind": "required",
                    "type": "string",
                    "description": "Id of the customer, as it exists in your system.",
                    "example": ""
                  },
                  {
                    "name": "customerName",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the customer, as it exists in your system.",
                    "example": ""
                  },
                  {
                    "name": "customerEmail",
                    "kind": "optional",
                    "type": "string",
                    "description": "Email of the customer, as it exists in your system.",
                    "example": ""
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": "Description of the customer.",
                    "example": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "deprecated": true,
                    "description": "Determines whether the customer is active or not. Setting it to false deactivates the customer. Only relevant when updating a customer.\n\nNote that this field is superseded by the `lifecycleStage` one, which allows finer grained control. When `enabled = false` means `lifecycleStage = OFFBOARDED`, other lifecycle stages mean `enabled = true` and vice-versa.",
                    "example": ""
                  },
                  {
                    "name": "test",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Determines whether the customer is a test customer. Can only be set once during creation. Test customers can be excluded from certain operations.\n\nDefaults to `false`.",
                    "example": ""
                  },
                  {
                    "name": "lifecycleStage",
                    "kind": "optional",
                    "type": "string",
                    "description": "The lifecycle stage of a customer. The lifecycle stage of a customer determines which features of the system are enabled for it.\n\nValid lifecycle stages are:\n- `ONBOARDING` - Only usage is tracked.\n- `TRAIL` - Both usage and billing data are tracked but customer will not be charged.\n- `ACTIVE` - Both usage and billing data are tracked and customer will be charged.\n- `OFFBOARDED` - Only usage is tracked.\n\nDefault: `ACTIVE`",
                    "modelRef": "#/components/schemas/metadata.customer.CustomerLifecycleStage.out",
                    "customType": "metadata.customer.CustomerLifecycleStage.out",
                    "schema": []
                  },
                  {
                    "name": "deactivateTimeStamp",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "traits",
                    "kind": "optional",
                    "type": "map",
                    "description": "Reference metadata to integrate with external systems like billing.\n\nThe following traits are used by Amberflo:\n- `stripeId` for [integrating with Stripe](doc:stripe);\n- `awsm.customerIdentifier` for [integrating with AWS Marketplace](doc:associating-customers-with-aws-marketplace);\n- `currency` for the customer's currency, following the ISO standard.\n",
                    "example": "",
                    "customType": "map<string, string>",
                    "schema": []
                  },
                  {
                    "name": "address",
                    "kind": "optional",
                    "type": "object",
                    "description": "Tax address of the customer.",
                    "modelRef": "#/components/schemas/metadata.customer.CustomerAddress.out",
                    "customType": "metadata.customer.CustomerAddress.out",
                    "schema": [
                      {
                        "name": "verified",
                        "kind": "optional",
                        "type": "boolean",
                        "example": ""
                      },
                      {
                        "name": "line1",
                        "kind": "required",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "state",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "city",
                        "kind": "required",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "postalCode",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "country",
                        "kind": "required",
                        "type": "string",
                        "example": ""
                      }
                    ]
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/metadata.customer.paging.CustomerPagingResponse.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://app.amberflo.io/customers/paging \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/customers/paging\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customers/paging\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customers/paging\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful request\n{\n  \"metadata\": {\n    \"limit\": \"\",\n    \"page\": \"\",\n    \"isAscending\": false,\n    \"sort\": \"\",\n    \"search\": \"\",\n    \"enabled\": false,\n    \"idlist\": [\n      \"\"\n    ],\n    \"lifecycleStage\": \"\",\n    \"deletedCustomers\": \"\",\n    \"totalRowCount\": \"\",\n    \"filteredRowCount\": \"\",\n    \"totalFilteredPages\": \"\"\n  },\n  \"items\": [\n    {\n      \"createTime\": \"\",\n      \"updateTime\": \"\",\n      \"deleteTime\": \"\",\n      \"customerId\": \"\",\n      \"customerName\": \"\",\n      \"customerEmail\": \"\",\n      \"description\": \"\",\n      \"enabled\": false,\n      \"test\": false,\n      \"lifecycleStage\": \"\",\n      \"deactivateTimeStamp\": \"\",\n      \"traits\": \"\",\n      \"address\": {\n        \"verified\": false,\n        \"line1\": \"\",\n        \"state\": \"\",\n        \"city\": \"\",\n        \"postalCode\": \"\",\n        \"country\": \"\"\n      }\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "kKbMPnzwQ6mcbfUsEjIWp",
      "type": "paragraph",
      "children": [
        {
          "text": "This endpoint allows you to page through the list of customers, filter, sort and search customers."
        }
      ]
    },
    {
      "id": "3hecgDf6dYzhPPO6eZqW_",
      "type": "paragraph",
      "children": [
        {
          "text": "For more details, see "
        },
        {
          "id": "abk9aAYr3l_RWoM6FMSht",
          "type": "link",
          "data": {
            "href": "doc:paging-and-sorting-in-customer-api"
          },
          "children": [
            {
              "text": "Searching, Paging, and Sorting"
            }
          ]
        },
        {
          "text": "."
        }
      ]
    }
  ]
}