Square-Applied Order Taxes

Pricing options configured for an order affect the order's price calculation. In this topic, use the pricing option to ask Square to apply taxes based on taxes preconfigured for the catalog items.

Link to section

Overview

First, create the products you want to sell with taxes preconfigured. Then, create example orders to explore how having Square apply preconfigured taxes affects the order's pricing calculation:

  • Create an order for coffee. In the request, specify the pricing option for Square to apply preconfigured taxes. The taxes apply to all line items in the order.
  • Update the order to remove the Square-applied tax from specific line items.
  • Create an order with Square-applied taxes enabled, but block specific line items.

For more information, see Square applies taxes and discounts.

Link to section

Step 1: Create a coffee product for sale

Call BatchUpsertCatalogObjects to create two items in the catalog:

Batch upsert catalog objects

In the response, verify that the catalog objects are created. The coffee items (of the ITEM type) should have the tax_ids field showing the tax enabled on it.

You need the coffee item variation ID to place the coffee order in the next step.

Link to section

Step 2: Test Square-applied taxes

Link to section

Step 2.1: Create an order with Square-applied taxes enabled

Call CreateOrder to create an order for a cup of coffee. In the request, include pricing_options to enable auto_apply_taxes.

Create order

In the response, notice how pricing calculations are affected by Square's application of taxes preconfigured for the item. For example:

  • The line item includes applied_taxes, which identifies the taxes applied.
  • The order includes taxes, which provides details about the taxes applied.

The following example response shows a partial Order object with only the relevant fields:

Link to section

Step 2.2: Update an order to remove previously applied taxes

You can call UpdateOrder to remove specific taxes applied to specific line items. Add fields_to_clear to identify specific line items and specific taxes to remove. Update the preceding order by removing the specific taxes applied to the line item.

Make sure you provide the order ID, location ID, line item ID, and ID of the applied tax that you want to remove.

Update order

In the response, review the pricing calculation updates. For example:

  • The line item includes pricing_blocklists, showing that the taxes that are blocked from applying automatically.
  • The specific line item shows no taxes and the order pricing is updated accordingly.

The response shows the line item with specific taxes blocked that were previously applied.

Link to section

Step 2.3: Create an order with Square-applied taxes enabled, but block specific line items

Call CreateOrder to create an order for the coffee. In the request:

  • Specify pricing_options for Square-applied taxes.
  • For the specific line item, add pricing_blocklists and include the ID of the CatalogTax object to block it from having taxes applied by Square.

Make sure you provide the coffee item variation ID, location ID, and ID of the tax (you created in step 1) that you want to block from application by Square.

Create order

In the response, verify the pricing calculations. Because you blocked the line item from having taxes applied by Square, there are no taxes applied. The following is an example response fragment: