## Create `client.V1.Customers.New(ctx, body) (*V1CustomerNewResponse, error)` **post** `/v1/customers` Create a new customer ### Parameters - **body:** `V1CustomerNewParams` - **Name:** `param.Field[string]` This will be truncated to 160 characters if the provided name is longer. - **BillingConfig:** `param.Field[V1CustomerNewParamsBillingConfig]` - **BillingProviderCustomerID:** `string` - **BillingProviderType:** `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - `V1CustomerNewParamsBillingConfigBillingProviderType` - **AwsIsSubscriptionProduct:** `bool` True if the aws_product_code is a SAAS subscription product, false otherwise. - **AwsProductCode:** `string` - **AwsRegion:** `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - `V1CustomerNewParamsBillingConfigAwsRegion` - **StripeCollectionMethod:** `V1CustomerNewParamsBillingConfigStripeCollectionMethod` - `V1CustomerNewParamsBillingConfigStripeCollectionMethod` - `V1CustomerNewParamsBillingConfigStripeCollectionMethod` - **CustomFields:** `param.Field[map[string, string]]` - **CustomerBillingProviderConfigurations:** `param.Field[[]V1CustomerNewParamsCustomerBillingProviderConfiguration]` - **BillingProvider:** `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` The billing provider set for this configuration. - `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProvider` - **Configuration:** `map[string, unknown]` Configuration for the billing provider. The structure of this object is specific to the billing provider and delivery provider combination. Defaults to an empty object, however, for most billing provider + delivery method combinations, it will not be a valid configuration. - **DeliveryMethod:** `V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethod` The method to use for delivering invoices to this customer. If not provided, the `delivery_method_id` must be provided. - `V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethod` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethod` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethod` - `V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethod` - **DeliveryMethodID:** `string` ID of the delivery method to use for this customer. If not provided, the `delivery_method` must be provided. - **ExternalID:** `param.Field[string]` (deprecated, use ingest_aliases instead) an alias that can be used to refer to this customer in usage events - **IngestAliases:** `param.Field[[]string]` Aliases that can be used to refer to this customer in usage events ### Returns - Not supported - **Data:** `Customer` ### Example ```go package main import ( "context" "fmt" "github.com/Metronome-Industries/metronome-go" "github.com/Metronome-Industries/metronome-go/option" ) func main() { client := metronome.NewClient( option.WithBearerToken("My Bearer Token"), ) customer, err := client.V1.Customers.New(context.TODO(), metronome.V1CustomerNewParams{ Name: metronome.F("Example, Inc."), CustomerBillingProviderConfigurations: metronome.F([]metronome.V1CustomerNewParamsCustomerBillingProviderConfiguration{metronome.V1CustomerNewParamsCustomerBillingProviderConfiguration{ BillingProvider: metronome.F(metronome.V1CustomerNewParamsCustomerBillingProviderConfigurationsBillingProviderStripe), DeliveryMethod: metronome.F(metronome.V1CustomerNewParamsCustomerBillingProviderConfigurationsDeliveryMethodDirectToBillingProvider), Configuration: metronome.F(map[string]interface{}{ "stripe_customer_id": "cus_123", "stripe_collection_method": "charge_automatically", }), }}), IngestAliases: metronome.F([]string{"team@example.com"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customer.Data) } ```