What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Not Getting correct pricing in storefront api

Not Getting correct pricing in storefront api

himanshusatija
Visitor
3 0 0

We just updated international pricing(fixed price for different countries) on our store on some pages we are fetching data using storefront API but in the storefront API, we are getting old price. Can you please guide me on this so I can fetch the correct price? We got "Shopify international pricing - early access. 
https://help.shopify.com/en/manual/payments/shopify-payments/multi-currency/international-pricing
I just want to know how can I fetch these prices in storefront API?



Replies 2 (2)

PaulNewton
Shopify Partner
7481 661 1571

Is this the product.price or a property on a variant.

Possibly just a cache issue and may clear after a while which seems to tend to happen with sub sub sub properties of an object.

Can you confirm through the standard API that the price is changed?

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


himanshusatija
Visitor
3 0 0

It's on product Variant. I'm not sure if I'm calling the correct key for the new International Pricing scheme.
API Call :- 

{
  collectionByHandle(handle: "the-oca-low-mens") {
    title
    products(first: 2) {
      edges {
        node {
          id
          title
          alternativeTitle: metafield(namespace: "c_f", key: "name") {
            value
          }
          priceRange {
            minVariantPrice {
              amount
              currencyCode
            }
            maxVariantPrice {
              amount
            }
          }
          variants(first: 1) {
            edges {
              node {
                price
                presentmentPrices(first: 10) {
                  edges {
                    node {
                      price {
                        amount
                        currencyCode
                      }
                      compareAtPrice {
                        amount
                        currencyCode
                      }
                    }
                  }
                }
                
                id
                sku
                title
              }
            }
          }
        }
      }
    }
  }
}

Response :- 

{
  "data": {
    "collectionByHandle": {
      "title": "The OCA Low (PLP)",
      "products": {
        "edges": [
          {
            "node": {
              "id": "gid://shopify/Product/",
              "title": "",
              "alternativeTitle": {
                "value": "Grey Canvas"
              },
              "priceRange": {
                "minVariantPrice": {
                  "amount": "10900.0",
                  "currencyCode": "AUD"
                },
                "maxVariantPrice": {
                  "amount": "10900.0"
                }
              },
              "variants": {
                "edges": [
                  {
                    "node": {
                      "price": "109.00",
                      "presentmentPrices": {
                        "edges": [
                          {
                            "node": {
                              "price": {
                                "amount": "109.0",
                                "currencyCode": "AUD"
                              },
                              "compareAtPrice": {
                                "amount": "0.0",
                                "currencyCode": "AUD"
                              }
                            }
                          },
                          {
                            "node": {
                              "price": {
                                "amount": "68.25",
                                "currencyCode": "EUR"
                              },
                              "compareAtPrice": {
                                "amount": "0.0",
                                "currencyCode": "EUR"
                              }
                            }
                          },
                          {
                            "node": {
                              "price": {
                                "amount": "65.25",
                                "currencyCode": "GBP"
                              },
                              "compareAtPrice": {
                                "amount": "0.0",
                                "currencyCode": "GBP"
                              }
                            }
                          }
                        ]
                      },
                      "id": "gid://shopify/ProductVariant/",
                      "sku": "",
                      "title": ""
                    }
                  }
                ]
              }
            }
          },
            }
          }
        ]
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 39,
      "actualQueryCost": 25,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1975,
        "restoreRate": 100
      }
    }
  }
}