> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tolt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Customer

> This endpoint retrieves a customer.

## Base URL `https://api.tolt.com`

<br />

### Query Parameters

<ParamField body="expand" type="array - optional">
  Specify which related objects to include in the response. Valid values are
  **'partner'** and **'program'**. Use **expand\[]=partner** or
  **expand\[]=program** to include the related objects.
</ParamField>

<ParamField body="include" type="array - optional">
  Specify which related objects to include in the response. Valid values are
  **'stats'**. Use **include\[]=stats** to include the related objects.
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique identifier for the customer, `uuid` or prefixed with `cust_`
</ResponseField>

<ResponseField name="email" type="string">
  Your unique identifier for the customer
</ResponseField>

<ResponseField name="partner_id" type="string">
  ID of the referring partner
</ResponseField>

<ResponseField name="name" type="string">
  Customer's name
</ResponseField>

<ResponseField name="customer_id" type="string">
  Your internal customer identifier
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of when the customer was created
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp of when the customer became active
</ResponseField>

<ResponseField name="status" type="string">
  Current status of the customer (e.g., 'lead', 'trialing', 'active',
  'canceled')
</ResponseField>

<ResponseField name="program_id" type="string">
  Program ID the customer belongs to
</ResponseField>

<ResponseField name="organization_id" type="string">
  Organization ID
</ResponseField>

<ResponseField name="partner" type="object">
  <Expandable title="partner" defaultOpen={false}>
    Partner details when expanded:

    <ResponseField name="id" type="string">
      Unique identifier for the partner
    </ResponseField>

    <ResponseField name="first_name" type="string">
      Partner's first name
    </ResponseField>

    <ResponseField name="last_name" type="string">
      Partner's last name
    </ResponseField>

    <ResponseField name="email" type="string">
      Partner's email address
    </ResponseField>

    <ResponseField name="company_name" type="string">
      Partner's company name
    </ResponseField>

    <ResponseField name="status" type="string">
      Partner's status. Valid values are: 'active', 'pending', 'suspended',
      'rejected'.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the partner was created
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="program" type="object">
  <Expandable title="program" defaultOpen={false}>
    Program details when expanded:

    <ResponseField name="id" type="string">
      Unique identifier for the program
    </ResponseField>

    <ResponseField name="status" type="string">
      Program status
    </ResponseField>

    <ResponseField name="name" type="string">
      Program name
    </ResponseField>

    <ResponseField name="product_name" type="string">
      Name of the product
    </ResponseField>

    <ResponseField name="subdomain" type="string">
      Program's subdomain
    </ResponseField>

    <ResponseField name="type" type="string">
      Program type (e.g., 'public')
    </ResponseField>

    <ResponseField name="currency_code" type="string">
      Three-letter ISO currency code
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the program was created
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="stats" type="object">
  <Expandable title="stats" defaultOpen={false}>
    An object containing the customer's statistics:

    <ResponseField name="total_revenue" type="integer">
      Total revenue generated in cents
    </ResponseField>

    <ResponseField name="total_commission" type="integer">
      Total commission generated in cents
    </ResponseField>

    <ResponseField name="total_orders" type="integer">
      Total number of orders
    </ResponseField>

    <ResponseField name="last_order_at" type="string">
      ISO 8601 timestamp of the last order
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X GET 'https://api.tolt.com/v1/customers/cust_dK9bzRGn46BhVgNFHD6fDgXW' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d ''
  ```

  ```bash cURL - Expand & Include theme={"system"}
  curl -X GET 'https://api.tolt.com/v1/customers/cust_dK9bzRGn46BhVgNFHD6fDgXW?expand[]=partner&expand[]=program&include[]=stats' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d ''
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"system"}
  {
    "success": true,
    "data": {
      "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW",
      "email": "customer@email.com",
      "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
      "name": "Jim Halpert",
      "customer_id": "jim_halpert_789",
      "created_at": "2025-01-15T14:30:00.000Z",
      "updated_at": "2025-01-15T15:00:00.000Z",
      "status": "active",
      "program_id": "prg_YRsbPDAKhWfdqJbFACheh",
      "organization_id": "org_JE3mfYNL9ci7sFaJazAv2"
    }
  }
  ```

  ```json Expand & Include Response theme={"system"}
  {
    "success": true,
    "data": {
      "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW",
      "email": "customer@email.com",
      "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
      "name": "Jim Halpert",
      "customer_id": "jim_halpert_789",
      "created_at": "2025-01-15T14:30:00.000Z",
      "updated_at": "2025-01-15T15:00:00.000Z",
      "status": "active",
      "program_id": "prg_YRsbPDAKhWfdqJbFACheh",
      "organization_id": "org_JE3mfYNL9ci7sFaJazAv2",
      "partner": {
        "id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
        "first_name": "Michael",
        "last_name": "Scott",
        "email": "michael.scott@dundermifflin.com",
        "company_name": "Dunder Mifflin",
        "status": "active",
        "created_at": "2025-01-13T10:06:11.251Z"
      },
      "program": {
        "id": "prg_YRsbPDAKhWfdqJbFACheh",
        "status": "active",
        "name": "Tolt's Partnership Program",
        "product_name": "Tolt",
        "subdomain": "affiliates",
        "type": "public",
        "currency_code": "USD",
        "created_at": "2024-03-05T10:28:08.984+00:00"
      },
      "stats": {
        "total_revenue": 99900,
        "total_commission": 19980,
        "total_orders": 3,
        "last_order_at": "2025-01-20T09:15:32.000Z"
      }
    }
  }
  ```
</ResponseExample>
