Tax Prices not included in response

Created on 4 May 2023, over 1 year ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

The JSON:API does not response with any information about tax. At the moment i have configured EU VAT and i also maintained a tax_rate field on the product variation. what a get as response is, e.g. "de|reduced", but withtout any information about the percentage or a price with and without tax.

Proposed resolution

Include caluclated price with tax, which aso respects tax setting "prices include taxes"

Does anybody else reveive tax information and i have a misonfiguration in drupal commerce + json:api or is this a missing feature?

πŸ’¬ Support request
Status

Active

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany gooddev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gooddev
  • πŸ‡ΊπŸ‡ΈUnited States dobe

    I believe this is found in order_total in the attributes for the order. In the adjustments array. There should be tax and shipping rates auto calculated there. Unless the tax is configured so it is unable to meet the conditions for the current order.

    {
        "subtotal": {
            "number": "30581",
            "currency_code": "USD",
            "formatted": "$30,581.00"
        },
        "adjustments": [
            {
                "type": "tax",
                "label": "Tax",
                "amount": {
                    "number": "1731.00",
                    "currency_code": "USD",
                    "formatted": "$1,731.00"
                },
                "total": {
                    "number": "1731.00",
                    "currency_code": "USD",
                    "formatted": "$1,731.00"
                },
                "percentage": 0.06,
                "source_id": "florida_tax|default|c06cae22-5e0e-451a-a640-2b27367b8835",
                "included": true,
                "locked": false
            }
        ],
        "total": {
            "number": "30581.000000",
            "currency_code": "USD",
            "formatted": "$30,581.00"
        }
    }
  • πŸ‡ΊπŸ‡ΈUnited States dobe

    I do notice that the order total doesn't include the taxes which I think may be a bug?

  • πŸ‡ΊπŸ‡ΈUnited States dobe

    Even if the store has: "Prices are entered with taxes included." checked that just makes the price of each item less. So subtotal and total is being calculated incorrectly. Each item seems to be calculated incorrectly as well. This may be an issue with commerce itself on how it calculates these values. I have had nothing but issues surrounding taxes lol...

  • πŸ‡ΊπŸ‡ΈUnited States dobe

    If I unset: "Display taxes of this type inclusive in product prices." on the Tax Type and have the checkbox on the store unchecked. The unit price of each item and the subtotal and order total all seem correct. My issues may have something to do with: https://www.drupal.org/project/commerce/issues/3143935 β†’

Production build 0.71.5 2024