const customer = await stiggClient.provisionCustomer({
customerId: 'customer-test-id',
name: 'My very first customer', // optional
email: 'john@example.com', // optional - billing email address
couponId: 'coupon-test-id', // optional
subscriptionParams: { // optional - pass null to skip initial subscription
planId: 'plan-basic',
resourceId: 'resource-01', // optional, required for multiple subscription for same product
billableFeatures: [{ // optional, required for subscriptions with per unit pricing
featureId:'feature-01-templates',
quantity: 2
}],
billingPeriod: 'MONTHLY', // optional, relevant only for paid subscriptions
addons: [{ // optional
addonId: 'addon-extra-stuff',
quantity: 1,
}],
promotionCode: 'STIGG30', // optional
billingCountryCode:'DK', // optional, required for price localization, must be in the ISO-3166-1 format
metadata: { // optional
key: 'value',
},
billingInformation: {
taxPercentage: 17,// optional. taxRate will be created if not exists
}
},
billingInfo: { // optional
language: 'en',
timezone: 'America/New_York',
customerName: "The name of the customer for the billing provider",
billingAddress: {
country: 'US', // must be in the ISO-3166-1 format
city: 'New York',
state: 'NY',
addressLine1: '123 Main Street',
addressLine2: 'Apt. 1',
phoneNumber: '+1 212-499-5321',
postalCode: '10164',
},
shippingAddress: {
country: 'US', // must be in the ISO-3166-1 format
city: 'New York',
state: 'NY',
addressLine1: '123 Main Street',
addressLine2: 'Apt. 1',
phoneNumber: '+1 212-499-5321',
postalCode: '10164',
},
taxIds: [
{ type: "au_abn", value: "12345678912" },
{ type: "us_ein", value: "12-3456789" }
],
invoiceCustomFields: {
lorem: "ipsum",
acme: "co"
},
paymentMethodId: "pm_1LcBMDAnAO1PFouUusJSmaPu",
currency: "usd",
metadata: { // optional - metadata that will be stored in the billing solution
hello: "world"
}
},
metadata: { // optional - metadata that will be stored in Stigg
key: "value",
}
});