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

# Customer

Represents a customer in the Stigg system. Customers are the primary billable entities that can have subscriptions, credits, and entitlements.

## Type Definition

```graphql theme={null}
type Customer {
  id: UUID!
  customerId: String!
  name: String
  email: String
  billingId: String
  billingCurrency: Currency
  billingLinkUrl: String
  additionalMetaData: JSON
  createdAt: DateTime
  updatedAt: DateTime!
  deletedAt: DateTime
  environmentId: UUID!

  # Payment information
  hasPaymentMethod: Boolean!
  defaultPaymentMethodId: String
  defaultPaymentMethodType: PaymentMethodType
  defaultPaymentMethodLast4Digits: String
  defaultPaymentExpirationMonth: Int
  defaultPaymentExpirationYear: Int

  # Subscription status
  hasActiveSubscription: Boolean!
  hasActiveResource: Boolean!
  totalActiveSubscription: Float!
  subscriptions: [CustomerSubscription!]

  # Entitlements
  eligibleForTrial: [EligibleForTrial!]
  trialedPlans: [TrialedPlan!]
  promotionalEntitlements: [PromotionalEntitlement!]!
  totalActivePromotionalEntitlements: Float!

  # Integrations
  coupon: Coupon
  syncStates: [SyncState!]
  crmId: String
  crmHubspotCompanyId: String
  crmHubspotCompanyUrl: String
  salesforceId: String
  awsMarketplaceCustomerId: String

  # Experiments
  excludeFromExperiment: Boolean
  experiment: Experiment
  experimentInfo: experimentInfo
  statistics: CustomerStatistics
}
```

## Fields

| Field                | Type        | Description                                                   |
| -------------------- | ----------- | ------------------------------------------------------------- |
| `id`                 | `UUID!`     | Unique identifier for the customer                            |
| `customerId`         | `String!`   | Your application's unique identifier for this customer        |
| `name`               | `String`    | Customer's display name                                       |
| `email`              | `String`    | Customer's email address                                      |
| `billingId`          | `String`    | Identifier in the billing provider (e.g., Stripe customer ID) |
| `billingCurrency`    | `Currency`  | Customer's preferred billing currency                         |
| `billingLinkUrl`     | `String`    | URL to the customer in the billing provider                   |
| `additionalMetaData` | `JSON`      | Custom metadata attached to the customer                      |
| `createdAt`          | `DateTime`  | When the customer was created                                 |
| `updatedAt`          | `DateTime!` | When the customer was last updated                            |
| `deletedAt`          | `DateTime`  | When the customer was archived (if applicable)                |
| `environmentId`      | `UUID!`     | The environment this customer belongs to                      |

### Payment Information

| Field                             | Type                | Description                                        |
| --------------------------------- | ------------------- | -------------------------------------------------- |
| `hasPaymentMethod`                | `Boolean!`          | Whether the customer has a payment method attached |
| `defaultPaymentMethodId`          | `String`            | ID of the default payment method                   |
| `defaultPaymentMethodType`        | `PaymentMethodType` | Type of payment method (card, bank, etc.)          |
| `defaultPaymentMethodLast4Digits` | `String`            | Last 4 digits of the payment method                |
| `defaultPaymentExpirationMonth`   | `Int`               | Expiration month of the payment method             |
| `defaultPaymentExpirationYear`    | `Int`               | Expiration year of the payment method              |

### Subscription Status

| Field                     | Type                                                                        | Description                                      |
| ------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------ |
| `hasActiveSubscription`   | `Boolean!`                                                                  | Whether the customer has any active subscription |
| `hasActiveResource`       | `Boolean!`                                                                  | Whether the customer has any active resource     |
| `totalActiveSubscription` | `Float!`                                                                    | Count of active subscriptions                    |
| `subscriptions`           | [`[CustomerSubscription!]`](/api-and-sdks/api-reference/types/subscription) | List of customer's subscriptions                 |

### Entitlements

| Field                                | Type                         | Description                              |
| ------------------------------------ | ---------------------------- | ---------------------------------------- |
| `eligibleForTrial`                   | `[EligibleForTrial!]`        | Plans the customer is eligible to trial  |
| `trialedPlans`                       | `[TrialedPlan!]`             | Plans the customer has already trialed   |
| `promotionalEntitlements`            | `[PromotionalEntitlement!]!` | Active promotional entitlements          |
| `totalActivePromotionalEntitlements` | `Float!`                     | Count of active promotional entitlements |

### Integrations

| Field                      | Type                                                 | Description                           |
| -------------------------- | ---------------------------------------------------- | ------------------------------------- |
| `coupon`                   | [`Coupon`](/api-and-sdks/api-reference/types/coupon) | Active coupon applied to the customer |
| `syncStates`               | `[SyncState!]`                                       | Integration sync status               |
| `crmId`                    | `String`                                             | Customer ID in CRM system             |
| `crmHubspotCompanyId`      | `String`                                             | Hubspot company ID                    |
| `salesforceId`             | `String`                                             | Salesforce customer ID                |
| `awsMarketplaceCustomerId` | `String`                                             | AWS Marketplace customer ID           |

## Example Response

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "customerId": "customer-123",
  "name": "Acme Corp",
  "email": "billing@acme.com",
  "billingId": "cus_abc123",
  "billingCurrency": "USD",
  "hasPaymentMethod": true,
  "hasActiveSubscription": true,
  "totalActiveSubscription": 1,
  "additionalMetaData": {
    "company_size": "enterprise",
    "industry": "technology"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-20T15:45:00Z"
}
```

## Related Types

* [CustomerSubscription](/api-and-sdks/api-reference/types/subscription) - Customer's subscription details
* [Coupon](/api-and-sdks/api-reference/types/coupon) - Discount coupon type
* [Entitlement](/api-and-sdks/api-reference/types/entitlement) - Feature entitlement type

## Related Operations

* [Get Customer](/api-and-sdks/api-reference/queries/get-customer) - Fetch a single customer
* [List Customers](/api-and-sdks/api-reference/queries/list-customers) - Query customers
* [Provision Customer](/api-and-sdks/api-reference/mutations/provision-customer) - Create customer with subscription
* [Update Customer](/api-and-sdks/api-reference/mutations/update-customer) - Update customer details
