GET
/
customers
/
{id}
require 'dub'


s = ::OpenApiSDK::Dub.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: "DUB_API_KEY",
  )
)


req = ::OpenApiSDK::Operations::GetCustomerRequest.new(
  id: "<id>",
)
    
res = s.customers.get(req)

if ! res.object.nil?
  # handle response
end
{
  "id": "<string>",
  "externalId": "<string>",
  "name": "<string>",
  "email": "<string>",
  "avatar": "<string>",
  "country": "<string>",
  "createdAt": "<string>",
  "link": {
    "id": "<string>",
    "domain": "<string>",
    "key": "<string>",
    "shortLink": "<string>",
    "programId": "<string>"
  },
  "partner": {
    "id": "<string>",
    "name": "<string>",
    "email": "<string>",
    "image": "<string>"
  },
  "discount": {
    "id": "<string>",
    "couponId": "<string>",
    "couponTestId": "<string>",
    "amount": 123,
    "type": "percentage",
    "duration": 123,
    "interval": "month"
  }
}

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.
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).

externalId
string
required

Unique identifier for the customer in the client's app.

name
string
required

Name of the customer.

createdAt
string
required

The date the customer was created.

email
string | null

Email of the customer.

avatar
string | null

Avatar URL of the customer.

country
string | null

Country of the customer.

partner
object | null
discount
object | null