Calculate order not applying tax

I’m using the calculate order endpoint to calculate autoapplied taxes to an order. I’m including pricing options in the request, and we have a tax that is applied to all items in the Square dashboard, but the response doesn’t include the taxes.

Request:

{
    "idempotency_key": "1515ee78-3c3a-11ec-80e3-5bde92da8645",
    "order": {
        "location_id": "T753NGKW8NMQ2",
        "line_items": [
            {
                "quantity": "1",
                "catalog_object_id": "KW3IOUQMDNS7EDPWHQZBGFPN",
                "modifiers": [
                    {
                        "catalog_object_id": "ORGMYD5RS7XMWAM2T56LTMWY"
                    }
                ]
            }
        ],
        "discounts": []
    },
    "pricing_options": {
        "auto_apply_taxes": true
    }
}

Response:

{
    "order": {
        "location_id": "T753NGKW8NMQ2",
        "line_items": [
            {
                "uid": "kOUpq7spG57xnrT7c8aqN",
                "catalog_object_id": "KW3IOUQMDNS7EDPWHQZBGFPN",
                "catalog_version": 1635896309648,
                "quantity": "1",
                "name": "Cheese",
                "variation_name": "8\"",
                "base_price_money": {
                    "amount": 150,
                    "currency": "USD"
                },
                "modifiers": [
                    {
                        "uid": "Pjq37VYdB75KHEqL4nrb7C",
                        "base_price_money": {
                            "amount": 150,
                            "currency": "USD"
                        },
                        "total_price_money": {
                            "amount": 150,
                            "currency": "USD"
                        },
                        "name": "Yellow Cheese",
                        "catalog_object_id": "ORGMYD5RS7XMWAM2T56LTMWY",
                        "catalog_version": 1635896309648
                    }
                ],
                "gross_sales_money": {
                    "amount": 300,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 300,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 150,
                    "currency": "USD"
                },
                "item_type": "ITEM"
            }
        ],
        "created_at": "2021-11-03T00:08:35.564Z",
        "updated_at": "2021-11-03T00:08:35.564Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_discount_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_tip_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_money": {
            "amount": 300,
            "currency": "USD"
        },
        "total_service_charge_money": {
            "amount": 0,
            "currency": "USD"
        },
        "net_amounts": {
            "total_money": {
                "amount": 300,
                "currency": "USD"
            },
            "tax_money": {
                "amount": 0,
                "currency": "USD"
            },
            "discount_money": {
                "amount": 0,
                "currency": "USD"
            },
            "tip_money": {
                "amount": 0,
                "currency": "USD"
            },
            "service_charge_money": {
                "amount": 0,
                "currency": "USD"
            }
        }
    }
}

The tax that should be applied is ID JYT62F7GOMC73L5HHBDI2CF7
Merchant ID is 3Q0RFH0QMQBTM

What am I missing here?

Never mind, I can see now that the pricing options weren’t actually under the order in my request. Fixed it so it’s like this, and it works! Amazing what a night of sleep will do for one’s brain. :grinning_face_with_smiling_eyes:

{
    "idempotency_key": "1515ee78-3c3a-11ec-80e3-5bde92da8645",
    "order": {
        "location_id": "T753NGKW8NMQ2",
        "line_items": [
            {
                "quantity": "1",
                "catalog_object_id": "KW3IOUQMDNS7EDPWHQZBGFPN",
                "modifiers": [
                    {
                        "catalog_object_id": "ORGMYD5RS7XMWAM2T56LTMWY"
                    }
                ]
            }
        ],
        "discounts": [],
        "pricing_options": {
            "auto_apply_taxes": true
        }
    },
}

:wave: Was just going to mention that. Glad you figured it out. :slightly_smiling_face:

Not all orders would require taxes to be charged, I know the US has a bunch of different rules etc, but it is basically calculated by your location, as well as where the customer is. I just added something to the cart (cool prints btw!), Entered a Cali address, and taxes were applied.

Thanks for sharing this useful information.