508 lines
19 KiB
Plaintext
508 lines
19 KiB
Plaintext
---
|
|
title: "Update Customer"
|
|
openapi: "openapi POST /v1/customers.update"
|
|
---
|
|
|
|
import { DynamicParamField } from "/components/dynamic-param-field.jsx";
|
|
import { DynamicResponseField } from "/components/dynamic-response-field.jsx";
|
|
import { DynamicResponseExample } from "/components/dynamic-response-example.jsx";
|
|
|
|
### Body Parameters
|
|
|
|
<DynamicParamField body="customer_id" type="string" required>
|
|
ID of the customer to update
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="name" type="string | null">
|
|
Customer's name
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="email" type="string | null">
|
|
Customer's email address
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="fingerprint" type="string | null">
|
|
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="metadata" type="object | null">
|
|
Additional metadata for the customer
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="stripe_id" type="string | null">
|
|
Stripe customer ID if you already have one
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="send_email_receipts" type="boolean">
|
|
Whether to send email receipts to this customer
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="new_customer_id" type="string">
|
|
New ID for the customer
|
|
</DynamicParamField>
|
|
|
|
|
|
### Response
|
|
|
|
<DynamicResponseField name="id" type="string | null">
|
|
Your unique identifier for the customer.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="name" type="string | null">
|
|
The name of the customer.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="email" type="string | null">
|
|
The email address of the customer.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="created_at" type="number">
|
|
Timestamp of customer creation in milliseconds since epoch.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="fingerprint" type="string | null">
|
|
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="stripe_id" type="string | null">
|
|
Stripe customer ID.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="env" type="'sandbox' | 'live'">
|
|
The environment this customer was created in.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="metadata" type="object">
|
|
The metadata for the customer.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="send_email_receipts" type="boolean">
|
|
Whether to send email receipts to the customer.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="subscriptions" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="plan" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="id" type="string" />
|
|
|
|
<DynamicResponseField name="name" type="string" />
|
|
|
|
<DynamicResponseField name="description" type="string | null" />
|
|
|
|
<DynamicResponseField name="group" type="string | null" />
|
|
|
|
<DynamicResponseField name="version" type="number" />
|
|
|
|
<DynamicResponseField name="add_on" type="boolean" />
|
|
|
|
<DynamicResponseField name="auto_enable" type="boolean" />
|
|
|
|
<DynamicResponseField name="price" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
<DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
<DynamicResponseField name="display" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="primary_text" type="string" />
|
|
|
|
<DynamicResponseField name="secondary_text" type="string" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="items" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="feature_id" type="string" />
|
|
|
|
<DynamicResponseField name="feature" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="id" type="string">
|
|
The ID of the feature, used to refer to it in other API calls like /track or /check.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="name" type="string | null">
|
|
The name of the feature.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="type" type="'static' | 'boolean' | 'single_use' | 'continuous_use' | 'credit_system'">
|
|
The type of the feature
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="display" type="object | null">
|
|
Singular and plural display names for the feature.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="singular" type="string">
|
|
The singular display name for the feature.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="plural" type="string">
|
|
The plural display name for the feature.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_schema" type="object[] | null">
|
|
Credit cost schema for credit system features.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="metered_feature_id" type="string">
|
|
The ID of the metered feature (should be a single_use feature).
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_cost" type="number">
|
|
The credit cost of the metered feature.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="archived" type="boolean | null">
|
|
Whether or not the feature is archived.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="included" type="number" />
|
|
|
|
<DynamicResponseField name="unlimited" type="boolean" />
|
|
|
|
<DynamicResponseField name="reset" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="price" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
<DynamicResponseField name="tiers" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="to" type="number" />
|
|
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
<DynamicResponseField name="billing_units" type="number" />
|
|
|
|
<DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'" />
|
|
|
|
<DynamicResponseField name="max_purchase" type="number | null" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="display" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="primary_text" type="string" />
|
|
|
|
<DynamicResponseField name="secondary_text" type="string" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="rollover" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="max" type="number | null" />
|
|
|
|
<DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'" />
|
|
|
|
<DynamicResponseField name="expiry_duration_length" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="proration" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="on_increase" type="'bill_immediately' | 'prorate_immediately' | 'prorate_next_cycle' | 'bill_next_cycle'" />
|
|
|
|
<DynamicResponseField name="on_decrease" type="'prorate' | 'prorate_immediately' | 'prorate_next_cycle' | 'none' | 'no_prorations'" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="free_trial" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="duration_length" type="number" />
|
|
|
|
<DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'" />
|
|
|
|
<DynamicResponseField name="card_required" type="boolean" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="created_at" type="number" />
|
|
|
|
<DynamicResponseField name="env" type="'sandbox' | 'live'" />
|
|
|
|
<DynamicResponseField name="archived" type="boolean" />
|
|
|
|
<DynamicResponseField name="base_variant_id" type="string | null" />
|
|
|
|
<DynamicResponseField name="customer_eligibility" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="trial_available" type="boolean" />
|
|
|
|
<DynamicResponseField name="scenario" type="'scheduled' | 'active' | 'new' | 'renew' | 'upgrade' | 'downgrade' | 'cancel' | 'expired' | 'past_due'" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="plan_id" type="string" />
|
|
|
|
<DynamicResponseField name="auto_enable" type="boolean" />
|
|
|
|
<DynamicResponseField name="add_on" type="boolean" />
|
|
|
|
<DynamicResponseField name="status" type="'active' | 'scheduled' | 'expired'" />
|
|
|
|
<DynamicResponseField name="past_due" type="boolean" />
|
|
|
|
<DynamicResponseField name="canceled_at" type="number | null" />
|
|
|
|
<DynamicResponseField name="expires_at" type="number | null" />
|
|
|
|
<DynamicResponseField name="trial_ends_at" type="number | null" />
|
|
|
|
<DynamicResponseField name="started_at" type="number" />
|
|
|
|
<DynamicResponseField name="current_period_start" type="number | null" />
|
|
|
|
<DynamicResponseField name="current_period_end" type="number | null" />
|
|
|
|
<DynamicResponseField name="quantity" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="purchases" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="plan" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="id" type="string" />
|
|
|
|
<DynamicResponseField name="name" type="string" />
|
|
|
|
<DynamicResponseField name="description" type="string | null" />
|
|
|
|
<DynamicResponseField name="group" type="string | null" />
|
|
|
|
<DynamicResponseField name="version" type="number" />
|
|
|
|
<DynamicResponseField name="add_on" type="boolean" />
|
|
|
|
<DynamicResponseField name="auto_enable" type="boolean" />
|
|
|
|
<DynamicResponseField name="price" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
<DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
<DynamicResponseField name="display" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="primary_text" type="string" />
|
|
|
|
<DynamicResponseField name="secondary_text" type="string" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="items" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="feature_id" type="string" />
|
|
|
|
<DynamicResponseField name="feature" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="id" type="string">
|
|
The ID of the feature, used to refer to it in other API calls like /track or /check.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="name" type="string | null">
|
|
The name of the feature.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="type" type="'static' | 'boolean' | 'single_use' | 'continuous_use' | 'credit_system'">
|
|
The type of the feature
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="display" type="object | null">
|
|
Singular and plural display names for the feature.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="singular" type="string">
|
|
The singular display name for the feature.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="plural" type="string">
|
|
The plural display name for the feature.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_schema" type="object[] | null">
|
|
Credit cost schema for credit system features.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="metered_feature_id" type="string">
|
|
The ID of the metered feature (should be a single_use feature).
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_cost" type="number">
|
|
The credit cost of the metered feature.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="archived" type="boolean | null">
|
|
Whether or not the feature is archived.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="included" type="number" />
|
|
|
|
<DynamicResponseField name="unlimited" type="boolean" />
|
|
|
|
<DynamicResponseField name="reset" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="price" type="object | null">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
<DynamicResponseField name="tiers" type="object[]">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="to" type="number" />
|
|
|
|
<DynamicResponseField name="amount" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" />
|
|
|
|
<DynamicResponseField name="interval_count" type="number" />
|
|
|
|
<DynamicResponseField name="billing_units" type="number" />
|
|
|
|
<DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'" />
|
|
|
|
<DynamicResponseField name="max_purchase" type="number | null" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="display" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="primary_text" type="string" />
|
|
|
|
<DynamicResponseField name="secondary_text" type="string" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="rollover" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="max" type="number | null" />
|
|
|
|
<DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'" />
|
|
|
|
<DynamicResponseField name="expiry_duration_length" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="proration" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="on_increase" type="'bill_immediately' | 'prorate_immediately' | 'prorate_next_cycle' | 'bill_next_cycle'" />
|
|
|
|
<DynamicResponseField name="on_decrease" type="'prorate' | 'prorate_immediately' | 'prorate_next_cycle' | 'none' | 'no_prorations'" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="free_trial" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="duration_length" type="number" />
|
|
|
|
<DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'" />
|
|
|
|
<DynamicResponseField name="card_required" type="boolean" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="created_at" type="number" />
|
|
|
|
<DynamicResponseField name="env" type="'sandbox' | 'live'" />
|
|
|
|
<DynamicResponseField name="archived" type="boolean" />
|
|
|
|
<DynamicResponseField name="base_variant_id" type="string | null" />
|
|
|
|
<DynamicResponseField name="customer_eligibility" type="object">
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="trial_available" type="boolean" />
|
|
|
|
<DynamicResponseField name="scenario" type="'scheduled' | 'active' | 'new' | 'renew' | 'upgrade' | 'downgrade' | 'cancel' | 'expired' | 'past_due'" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="plan_id" type="string" />
|
|
|
|
<DynamicResponseField name="expires_at" type="number | null" />
|
|
|
|
<DynamicResponseField name="started_at" type="number" />
|
|
|
|
<DynamicResponseField name="quantity" type="number" />
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="balances" type="object" />
|