Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Create

Set a customer billing configuration
client.v1.customers.billingConfig.create(BillingConfigCreateParamsparams, RequestOptionsoptions?): void
post/v1/customers/{customer_id}/billing-config/{billing_provider_type}

Set the billing configuration for a given customer.

Parameters
paramscustomer_idstringbilling_provider_typeunionbilling_provider_customer_idstringaws_product_codestringaws_regionunionstripe_collection_methodunionBillingConfigCreateParams
Hide ParametersShow Parameters
customer_idstring

Path param:

formatuuid
billing_provider_typeunion
"aws_marketplace" | "stripe" | "netsuite" | 5 more

Path param: The billing provider (e.g. stripe)

Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
billing_provider_customer_idstring

Body param: The customer ID in the billing provider's system. For Azure, this is the subscription ID.

aws_product_codestring
optional

Body param:

aws_regionunion
optional
"af-south-1" | "ap-east-1" | "ap-northeast-1" | 22 more

Body param:

Hide ParametersShow Parameters
"af-south-1"
"ap-east-1"
"ap-northeast-1"
"ap-northeast-2"
"ap-northeast-3"
"ap-south-1"
"ap-southeast-1"
"ap-southeast-2"
"ca-central-1"
"cn-north-1"
"cn-northwest-1"
"eu-central-1"
"eu-north-1"
"eu-south-1"
"eu-west-1"
"eu-west-2"
"eu-west-3"
"me-south-1"
"sa-east-1"
"us-east-1"
"us-east-2"
"us-gov-east-1"
"us-gov-west-1"
"us-west-1"
"us-west-2"
stripe_collection_methodunion
optional
"charge_automatically" | "send_invoice"

Body param:

Hide ParametersShow Parameters
"charge_automatically"
"send_invoice"
import Metronome from '@metronome/sdk';

const client = new Metronome({
  bearerToken: 'My Bearer Token',
});

await client.v1.customers.billingConfig.create({
  customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
  billing_provider_type: 'stripe',
  billing_provider_customer_id: 'cus_AJ6y20bjkOOayM',
  stripe_collection_method: 'charge_automatically',
});