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

Type Definition

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

FieldTypeDescription
idUUID!Unique identifier for the customer
customerIdString!Your application’s unique identifier for this customer
nameStringCustomer’s display name
emailStringCustomer’s email address
billingIdStringIdentifier in the billing provider (e.g., Stripe customer ID)
billingCurrencyCurrencyCustomer’s preferred billing currency
billingLinkUrlStringURL to the customer in the billing provider
additionalMetaDataJSONCustom metadata attached to the customer
createdAtDateTimeWhen the customer was created
updatedAtDateTime!When the customer was last updated
deletedAtDateTimeWhen the customer was archived (if applicable)
environmentIdUUID!The environment this customer belongs to

Payment Information

FieldTypeDescription
hasPaymentMethodBoolean!Whether the customer has a payment method attached
defaultPaymentMethodIdStringID of the default payment method
defaultPaymentMethodTypePaymentMethodTypeType of payment method (card, bank, etc.)
defaultPaymentMethodLast4DigitsStringLast 4 digits of the payment method
defaultPaymentExpirationMonthIntExpiration month of the payment method
defaultPaymentExpirationYearIntExpiration year of the payment method

Subscription Status

FieldTypeDescription
hasActiveSubscriptionBoolean!Whether the customer has any active subscription
hasActiveResourceBoolean!Whether the customer has any active resource
totalActiveSubscriptionFloat!Count of active subscriptions
subscriptions[CustomerSubscription!]List of customer’s subscriptions

Entitlements

FieldTypeDescription
eligibleForTrial[EligibleForTrial!]Plans the customer is eligible to trial
trialedPlans[TrialedPlan!]Plans the customer has already trialed
promotionalEntitlements[PromotionalEntitlement!]!Active promotional entitlements
totalActivePromotionalEntitlementsFloat!Count of active promotional entitlements

Integrations

FieldTypeDescription
couponCouponActive coupon applied to the customer
syncStates[SyncState!]Integration sync status
crmIdStringCustomer ID in CRM system
crmHubspotCompanyIdStringHubspot company ID
salesforceIdStringSalesforce customer ID
awsMarketplaceCustomerIdStringAWS Marketplace customer ID

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "customerId": "customer-123",
  "name": "Acme Corp",
  "email": "[email protected]",
  "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"
}