Create
Create a customer
v1.customers.create(CustomerCreateParams**kwargs) -> dataCustomerCustomerCreateResponse
post/v1/customers
Create a new customer
Parameters
namestr
This will be truncated to 160 characters if the provided name is longer.
billing_configbilling_provider_customer_idstrbilling_provider_typeliteralaws_is_subscription_productboolaws_product_codestraws_regionliteralstripe_collection_methodliteralBillingConfig
optional
custom_fieldsDict[str, str]
optional
Dict[str, str]
customer_billing_provider_configurationsiterable
optional
billing_providerliteralconfigurationDict[str, object]delivery_methodliteraldelivery_method_idstrIterable[CustomerBillingProviderConfiguration]
external_idstr
optional
(deprecated, use ingest_aliases instead) an alias that can be used to refer to this customer in usage events
minLength1
maxLength128
ingest_aliaseslist
optional
List[str]
Aliases that can be used to refer to this customer in usage events
Returns
CustomerCreateResponseclass
from metronome import Metronome
client = Metronome(
bearer_token="My Bearer Token",
)
customer = client.v1.customers.create(
name="Example, Inc.",
customer_billing_provider_configurations=[{
"billing_provider": "stripe",
"delivery_method": "direct_to_billing_provider",
"configuration": {
"stripe_customer_id": "cus_123",
"stripe_collection_method": "charge_automatically",
},
}],
ingest_aliases=["[email protected]"],
)
print(customer.data)
200 Example
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"external_id": "external_id",
"ingest_aliases": [
"string"
],
"name": "name",
"custom_fields": {
"foo": "string"
}
}
}