Blog

Share this post on Twitter

Native support for taxes and shipping

Rasmus Rygaard on June 21, 2016

In the past year, we’ve added deeper support for representing products and orders to the core Stripe API. By working with products and orders, we can start to remove a lot of the unnecessary complexity that companies currently deal with—manually calculating taxes, figuring out shipping costs, or even just keeping product and inventory data in sync with all their systems:

Calculating taxes

Working with customers across many countries can often translate to maintaining complex lists of rules for taxes (state taxes, VAT, GST, and more). Until today, we’d left calculating taxes as an exercise for the reader. Now, we’ll help automatically calculate taxes—just supply your customer’s address when creating an order. (You can also specify a customer object and we’ll look up the address.) Here’s a quick example of creating an order:


  curl https://api.stripe.com/v1/orders \
     -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
     -d items[][parent]=sku_8XOBjVaulB0SWy \
     -d customer=cus_4A5UNnP8WgZa91 \
     -d currency=usd

  {
    "id": "or_17pkOFDAu10Yox5ReR89xhT1",
    "object": "order",
    "amount": 7524,
    ...
    "items": [
      {
        "object": "order_item",
        "amount": 525,
        "description": "CA STATE TAX (PC040100)",
        "type": "tax",
        ...
      },
      ...
    ]
  }
  

As you can see, the response includes the total for the order, including the tax required for that particular customer. To make this work, we’ve partnered closely with both Avalara and TaxJar to build integrations that effectively take care of the calculations for you. They also take on the work of maintaining a canonical (and extensive!) database of tax rules.

This works for customers in any country and you’ll also be able to view detailed reports, which include liability calculations to help with your tax reporting.

If you’re interested, we’ve put together guides to getting started with both Avalara and TaxJar. You can enable either integration from your Dashboard.

Calculating shipping costs

Relatedly, calculating shipping also used to require maintaining lists of fees for different products, carriers, and countries. Now, instead of building your own lookup system for shipping costs, we can use the weight and dimension info from your product to automatically return shipping costs when you create an order. Of course, you’ll also need to specify your origin location and the destination address.

To start, we’re working with EasyPost and Shippo to power accurate shipping cost lookups across major carriers like UPS, FedEx, DHL, and more. You can activate the integration in your Dashboard.

Sync product feeds with Stripe

The taxes and shipping calculations rely on having up-to-date product info in Stripe. Currently, many Stripe users either manually add their products to Stripe via the Dashboard or through a repeating upload using the API. To help, we’re now also adding support to automatically keep your products in sync with Stripe using a product feed.

We’re starting by adding support for importing Google Product Feeds as well as Linkshare Data Feeds. (If you retarget customers via display networks, you likely already have a product feed in a format Stripe can parse.)

You can manually import your products to get started and schedule a daily or weekly import depending on how frequently you update your feed.


We hope these updates will help simplify your work to calculate shipping and taxes. Since these integrations are built on Stripe’s open platform, we expect to add more partners for taxes, shipping, and many other features in the future to make running your business on Stripe even easier.

As always, let us know if you have questions or feedback!