Create
Create a customer
client.v1.customers.create(CustomerCreateParamsbody, RequestOptionsoptions?): dataCustomerCustomerCreateResponse
post/v1/customers
Create a new customer
Parameters
bodynamestringbilling_configBillingConfigcustom_fieldsRecord<string, string>customer_billing_provider_configurationsarrayexternal_idstringingest_aliasesarrayCustomerCreateParams
Returns
CustomerCreateResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
const customer = await 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]'],
});
console.log(customer.data);
200 Example
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"external_id": "external_id",
"ingest_aliases": [
"string"
],
"name": "name",
"custom_fields": {
"foo": "string"
}
}
}