GET
/
customers
/
{id}
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.Get(ctx, operations.GetCustomerRequest{
        ID: "<id>",
    })
    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

Path Parameters

id
string
required

The unique ID of the customer. You may use either the customer's id on Dub (obtained via /customers endpoint) or their externalId (unique ID within your system, prefixed with ext_, e.g. ext_123).

Query Parameters

includeExpandedFields
boolean

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

Response

200
application/json

The customer object.

The response is of type object.