Skip to content
Get started

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.

ParametersExpand Collapse
params CustomerListParams
CreatedFrom param.Field[Time]optional

Query param: Start date for filtering by created_at date.

formatdate-time
CreatedTo param.Field[Time]optional

Query param: End date for filtering by created_at date.

formatdate-time
Email param.Field[string]optional

Query param: Filter customers by email address.

ExternalID param.Field[string]optional

Query param: Filter by your system's external_id.

Name param.Field[string]optional

Query param: Filter customers by name (partial match).

PageNumber param.Field[int64]optional

Query param: Page number for paginated results. Starts at 1.

formatint32
PageSize param.Field[int64]optional

Query param: Number of results per page. Maximum: 1000.

formatint32
SearchText param.Field[string]optional

Query param: General search term to filter customers.

SortBy param.Field[CustomerListParamsSortBy]optional

Query param

const CustomerListParamsSortByName CustomerListParamsSortBy = "name"
const CustomerListParamsSortByCreatedAt CustomerListParamsSortBy = "created_at"
SortOrder param.Field[CustomerListParamsSortOrder]optional

Query param

const CustomerListParamsSortOrderAsc CustomerListParamsSortOrder = "asc"
const CustomerListParamsSortOrderDesc CustomerListParamsSortOrder = "desc"
Status param.Field[[]string]optional

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]optional

Query param: Filter by customer type individual or business.

const CustomerListParamsTypeIndividual CustomerListParamsType = "individual"
const CustomerListParamsTypeBusiness CustomerListParamsType = "business"
CorrelationID param.Field[string]optional

Header param: Optional client generated identifier to trace and debug a series of requests.

RequestID param.Field[string]optional

Header param: Optional client generated identifier to trace and debug a request.

StraddleAccountID param.Field[string]optional

Header param: For use by platforms to specify an account_id to set the scope of a request.

formatuuid
ReturnsExpand Collapse
type CustomerSummaryPagedV1Data struct{…}
ID string

Unique identifier for the customer.

formatuuid
CreatedAt Time

Timestamp of when the customer record was created.

formatdate-time
Email string

The customer's email address.

formatemail
Name string

Full name of the individual or business name.

Phone string

The customer's phone number in E.164 format.

Status string
One of the following:
const CustomerSummaryPagedV1DataStatusPending CustomerSummaryPagedV1DataStatus = "pending"
const CustomerSummaryPagedV1DataStatusReview CustomerSummaryPagedV1DataStatus = "review"
const CustomerSummaryPagedV1DataStatusVerified CustomerSummaryPagedV1DataStatus = "verified"
const CustomerSummaryPagedV1DataStatusInactive CustomerSummaryPagedV1DataStatus = "inactive"
const CustomerSummaryPagedV1DataStatusRejected CustomerSummaryPagedV1DataStatus = "rejected"
Type string
One of the following:
const CustomerSummaryPagedV1DataTypeIndividual CustomerSummaryPagedV1DataType = "individual"
const CustomerSummaryPagedV1DataTypeBusiness CustomerSummaryPagedV1DataType = "business"
UpdatedAt Time

Timestamp of the most recent update to the customer record.

formatdate-time
ExternalID stringoptional

Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems.

List customers

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)
}
{
  "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"
}
Returns Examples
{
  "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"
}