visit
Examples are written in node.js but can easily be converted to any language Stripe’s API supports.
Contact Stripe’s support and ask them to enable the usage of the
pay_immediately
flag for you for the purpose of integrating AvaTax.For AvaTax to integrate with Stripe, you have to give AvaTax to a chance to catch new invoices and add the sales tax to the invoice. You do this by sending the attribute
pay_immediately = false
upon subscription creation. This flag is not well documented anywhere and is disabled by default. Avalara do , but it’s easy to miss.Only
Address_PostalCode
and Address_Country
are mandatory but you can add to make the tax calculation more accurate.const stripe = require('stripe')(STRIPE_KEY);
const customer = await stripe.customers.update(
CUSTOMER_ID,
{ metadata: {
'Address_PostalCode': '10001', // Valid Postal Code
'Address_Country': 'US' // ISO-3166-1 alpha-2 Country Code
}
}
);
When you create the subscription, add the attribute
pay_immediately
with the value false.const stripe = require('stripe')(STRIPE_KEY);
const subscription = await stripe.subscriptions.create({
customer: CUSTOMER_ID,
items: [
{price: PRICE_ID},
],
pay_immediately: false
});