Skip to main content
Creates a new customer and optionally provisions an initial subscription in a single operation.

Mutation

mutation ProvisionCustomer($input: ProvisionCustomerInput!) {
  provisionCustomer(input: $input) {
    customer {
      customerId
      name
      email
      billingId
      createdAt
    }
    subscription {
      subscriptionId
      status
      plan {
        refId
        displayName
      }
      trialEndDate
    }
    entitlements {
      feature {
        refId
        displayName
      }
      isGranted
      usageLimit
    }
    subscriptionDecisionStrategy
  }
}

Parameters

input
ProvisionCustomerInput
required
Input for provisioning a customer

Return Type

Returns a ProvisionedCustomer object with:
FieldTypeDescription
customerCustomerThe created customer
subscriptionCustomerSubscriptionThe created subscription (if requested)
entitlements[Entitlement]Resulting entitlements
subscriptionDecisionStrategySubscriptionDecisionStrategyHow subscription was determined

Examples

Basic Customer Creation

{
  "input": {
    "customerId": "customer-123",
    "name": "Acme Corp",
    "email": "[email protected]"
  }
}

Customer with Free Plan

{
  "input": {
    "customerId": "customer-123",
    "name": "Acme Corp",
    "email": "[email protected]",
    "subscriptionParams": {
      "planId": "plan-free"
    }
  }
}

Customer with Trial

{
  "input": {
    "customerId": "customer-123",
    "name": "Acme Corp",
    "email": "[email protected]",
    "subscriptionParams": {
      "planId": "plan-pro",
      "trialConfig": {
        "duration": 14,
        "units": "DAYS"
      }
    }
  }
}

Customer with Addons

{
  "input": {
    "customerId": "customer-123",
    "name": "Acme Corp",
    "subscriptionParams": {
      "planId": "plan-pro",
      "billingPeriod": "ANNUAL",
      "addons": [
        { "addonId": "addon-seats", "quantity": 10 }
      ]
    }
  }
}

Common Use Cases

Create customer when user signs up, optionally with a free or trial plan.
Provision customer when anonymous user converts to registered.
Create organization customer with initial subscription during onboarding.