Can not get presentment_currencies from Shopify admin rest API

Viewed 156

I'm following the doc to get products with presentment_currencies. However, although I have set TWD & USD as currencies in my store. Still can not get the data from Shopify API.

I'm using nodejs and the code below:

const client: any = new ShopifyAPI.Shopify.Clients.Rest(
      shopName,
      accessToken
    );

client.get({
    path: 'products',
    query: {
        presentment_currencies: 'TWD,USD',
    },
})

The return data still don't have presentment_currencies.

1 Answers

I found that we should add an extra headers on the API header. So, the correct code will be:

client.get({
          path: 'products',
          query: {
            presentment_currencies: 'TWD,USD',
          },
          extraHeaders: {
            'X-Shopify-Api-Features': 'include-presentment-prices',
          },
        })

I found the extra headers here.

Related