## List customers `client.Customers.List(ctx, params) (*PageNumberSchema[CustomerSummaryPagedV1Data], error)` **get** `/v1/customers` Lists or searches customers connected to your account. All supported query parameters are optional. If none are provided, the response will include all customers connected to your account. This endpoint supports advanced sorting and filtering options. ### Parameters - `params CustomerListParams` - `CreatedFrom param.Field[Time]` Query param: Start date for filtering by `created_at` date. - `CreatedTo param.Field[Time]` Query param: End date for filtering by `created_at` date. - `Email param.Field[string]` Query param: Filter customers by `email` address. - `ExternalID param.Field[string]` Query param: Filter by your system's `external_id`. - `Name param.Field[string]` Query param: Filter customers by `name` (partial match). - `PageNumber param.Field[int64]` Query param: Page number for paginated results. Starts at 1. - `PageSize param.Field[int64]` Query param: Number of results per page. Maximum: 1000. - `SearchText param.Field[string]` Query param: General search term to filter customers. - `SortBy param.Field[CustomerListParamsSortBy]` Query param - `const CustomerListParamsSortByName CustomerListParamsSortBy = "name"` - `const CustomerListParamsSortByCreatedAt CustomerListParamsSortBy = "created_at"` - `SortOrder param.Field[CustomerListParamsSortOrder]` Query param - `const CustomerListParamsSortOrderAsc CustomerListParamsSortOrder = "asc"` - `const CustomerListParamsSortOrderDesc CustomerListParamsSortOrder = "desc"` - `Status param.Field[[]string]` Query param: Filter customers by their current `status`. - `const CustomerListParamsStatusPending CustomerListParamsStatus = "pending"` - `const CustomerListParamsStatusReview CustomerListParamsStatus = "review"` - `const CustomerListParamsStatusVerified CustomerListParamsStatus = "verified"` - `const CustomerListParamsStatusInactive CustomerListParamsStatus = "inactive"` - `const CustomerListParamsStatusRejected CustomerListParamsStatus = "rejected"` - `Types param.Field[[]string]` Query param: Filter by customer type `individual` or `business`. - `const CustomerListParamsTypeIndividual CustomerListParamsType = "individual"` - `const CustomerListParamsTypeBusiness CustomerListParamsType = "business"` - `CorrelationID param.Field[string]` Header param: Optional client generated identifier to trace and debug a series of requests. - `RequestID param.Field[string]` Header param: Optional client generated identifier to trace and debug a request. - `StraddleAccountID param.Field[string]` Header param: For use by platforms to specify an `account_id` to set the scope of a request. ### Returns - `type CustomerSummaryPagedV1Data struct{…}` - `ID string` Unique identifier for the customer. - `CreatedAt Time` Timestamp of when the customer record was created. - `Email string` The customer's email address. - `Name string` Full name of the individual or business name. - `Phone string` The customer's phone number in E.164 format. - `Status string` - `const CustomerSummaryPagedV1DataStatusPending CustomerSummaryPagedV1DataStatus = "pending"` - `const CustomerSummaryPagedV1DataStatusReview CustomerSummaryPagedV1DataStatus = "review"` - `const CustomerSummaryPagedV1DataStatusVerified CustomerSummaryPagedV1DataStatus = "verified"` - `const CustomerSummaryPagedV1DataStatusInactive CustomerSummaryPagedV1DataStatus = "inactive"` - `const CustomerSummaryPagedV1DataStatusRejected CustomerSummaryPagedV1DataStatus = "rejected"` - `Type string` - `const CustomerSummaryPagedV1DataTypeIndividual CustomerSummaryPagedV1DataType = "individual"` - `const CustomerSummaryPagedV1DataTypeBusiness CustomerSummaryPagedV1DataType = "business"` - `UpdatedAt Time` Timestamp of the most recent update to the customer record. - `ExternalID string` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. ### Example ```go package main import ( "context" "fmt" "github.com/straddleio/straddle-go" "github.com/straddleio/straddle-go/option" ) func main() { client := straddle.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.Customers.List(context.TODO(), straddle.CustomerListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "dev@stainless.com", "name": "name", "phone": "+46991022", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id" } ], "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z", "max_page_size": 0, "page_number": 0, "page_size": 0, "sort_by": "sort_by", "sort_order": "asc", "total_items": 0, "total_pages": 0 }, "response_type": "object" } ```