[BUG] Storefront API returns incorrect total

Zoran_Ilievski
Shopify Partner
8 0 2

Hello all.

Having a play around with the JS Buy SDK which utilizes the storefront API, I noticed the checkout returns the same totalPrice and subtotalPrice even after a discount is applied.

I used postman to directly query the storefront API via graphql in case it was a bug with the JS library and the result is the same.

As per the storefront API the subtotal is meant to be the price of the checkout before the addition of extra costs.

The response I receive is:

{
    "data": {
        "node": {
            "id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC9mNGZlOWU4ZjQzYzIzYTFmYWJjMDM4OGMxZWEzYzgwNT9rZXk9MGMxOGE2YTE0NDk0YzdiYWMyM2NmYzgyNjc2YmZkMzU=",
            "subtotalPrice": "74.28",
            "totalPrice": "74.28",
            "lineItems": {
                "edges": [
                    {
                        "node": {
                            "quantity": 1,
                            "variant": {
                                "price": "16.95"
                            }
                        }
                    },
                    {
                        "node": {
                            "quantity": 2,
                            "variant": {
                                "price": "37.95"
                            }
                        }
                    }
                ]
            }
        }
    }
}

 

This seemes like a bug to me and wanted to flag.

MihailStoica
Tourist
3 1 0

I really wish somebody will answer this question. I have the same problem

0 Likes