Incorrect `contextualPricing` using `companyLocationId`

Hi there,

I’ve got a Catalog with one product at price 10.00 assigned to a B2B market. When accessed through the storefront as a B2B customer the price displayed is 10, but when contextualPricing is requested in Admin API for companyLocationId it returns a different price.

query MyQuery {
  product(id: "gid://shopify/Product/7777278623798") {
    title
    publishedInContext(
      context: {companyLocationId: "gid://shopify/CompanyLocation/1866072118"}
    )
    variants(first: 10) {
      nodes {
        id
        contextualPricing(
          context: {companyLocationId: "gid://shopify/CompanyLocation/1866072118"}
        ) {
          price {
            amount
          }
          compare_at_price: compareAtPrice {
            amount
          }
        }
        compareAtPrice
        showUnitPrice
      }
    }
  }
}

Is there anything I am missing?

Thanks in advance

Hi @Alberto_Mur_Lopez

If the contextualPricing price is different from the Storefront, it is likely due to a price list or quantity pricing rule applied to the company location’s catalog.

Compare the price list and rules in the Admin API with what’s configured in the Shopify admin for the B2B market and company location. If you want to match the Storefront price, ensure you’re querying with the same context (companyLocationId, quantity, etc.) and that there are no additional price breaks or rules affecting the result.

Okey, you give me the clue. I have to pass the country along the companyIdLocation to get the correct price.

query MyQuery {
  product(id: "gid://shopify/Product/7777278623798") {
    title
    publishedInContext(
      context: {country: ES, companyLocationId: "gid://shopify/CompanyLocation/1866072118"}
    )
    variants(first: 10) {
      nodes {
        id
        contextualPricing(
          context: {country: ES, companyLocationId: "gid://shopify/CompanyLocation/1866072118"}
        ) {
          price {
            amount
          }
          compare_at_price: compareAtPrice {
            amount
          }
        }
        compareAtPrice
        showUnitPrice
      }
    }
  }
}

Thanks!