GET
/
customers
package main

import(
	"context"
	dubgo "github.com/dubinc/dub-go"
	"github.com/dubinc/dub-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := dubgo.New(
        dubgo.WithSecurity("DUB_API_KEY"),
    )

    res, err := s.Customers.List(ctx, operations.GetCustomersRequest{
        PageSize: dubgo.Float64(50),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
[
  {
    "id": "<string>",
    "externalId": "<string>",
    "name": "<string>",
    "email": "<string>",
    "avatar": "<string>",
    "country": "<string>",
    "sales": 123,
    "saleAmount": 123,
    "createdAt": "<string>",
    "link": {
      "id": "<string>",
      "domain": "<string>",
      "key": "<string>",
      "shortLink": "<string>",
      "url": "<string>",
      "programId": "<string>"
    },
    "programId": "<string>",
    "partner": {
      "id": "<string>",
      "name": "<string>",
      "email": "<string>",
      "image": "<string>"
    },
    "discount": {
      "id": "<string>",
      "amount": 123,
      "type": "percentage",
      "maxDuration": 123,
      "description": "<string>",
      "couponId": "<string>",
      "couponTestId": "<string>",
      "partnersCount": 123
    }
  }
]

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

email
string

A case-sensitive filter on the list based on the customer's email field. The value must be a string. Takes precedence over externalId.

externalId
string

A case-sensitive filter on the list based on the customer's externalId field. The value must be a string. Takes precedence over search.

A search query to filter customers by email, externalId, or name. If email or externalId is provided, this will be ignored.

country
string

A filter on the list based on the customer's country field.

A filter on the list based on the customer's linkId field (the referral link ID).

includeExpandedFields
boolean

Whether to include expanded fields on the customer (link, partner, discount).

sortBy
enum<string>
default:createdAt

The field to sort the customers by. The default is createdAt.

Available options:
createdAt,
saleAmount
sortOrder
enum<string>
default:desc

The sort order. The default is desc.

Available options:
asc,
desc
page
number
default:1

The page number for pagination.

Required range: x > 0
Example:

1

pageSize
number
default:100

The number of items per page.

Required range: 0 < x <= 100
Example:

50

Response

200
application/json

The list of customers.

The response is of type object[].