New Shopify Certification now available: Liquid Storefronts for Theme Developers

we have prices, for products, in different currencies, where are these accessible via REST API

Solved
happy_shopper
Tourist
7 1 0

we have prices, for products, in different currencies, where are these accessible via REST API

Accepted Solution (1)
happy_shopper
Tourist
7 1 0

This is an accepted solution.

found the solution, it required a magic header in the request
Requires the header 'X-Shopify-Api-Features': 'include-presentment-prices'.

View solution in original post

Replies 4 (4)
garyrgilbert
Shopify Partner
378 38 151

 

Wouldn't that be in the product variant?  

 

 

/admin/api/2022-01/variants/{id}.json

 

product->variant->presentment_prices[]

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
happy_shopper
Tourist
7 1 0

This is an accepted solution.

found the solution, it required a magic header in the request
Requires the header 'X-Shopify-Api-Features': 'include-presentment-prices'.

garyrgilbert
Shopify Partner
378 38 151

 

Hi, According to the documentation you don't need to include that header. As I mentioned in my post the presentment prices are automatically returned using the REST API,

 

The linke below even indicates that.

https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#[get]/admin/api/2022-01/product...

 

if you don't specify which presentment currencies you want it should always return all.

 

/admin/api/2022-01/products/632910392/variants.json?presentment_currencies=USD,CAD

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
pachocastillosr
Visitor
3 0 1

Hi, what if you don't have presentment prices and you just have 1 price.
Rest api (/admin/api/2023-07/products.json) returns this variant object:

 

{
product_id: 8547966910779,
id: 45891642589499,
title: S,
price: 75000.00,
sku: ,
position: 1,
inventory_policy: deny,
compare_at_price: null,
fulfillment_service: manual,
inventory_management: shopify,
option1: S,
option2: null,
option3: null,
created_at: 2023-07-24T10:35:14-05:00,
updated_at: 2023-07-24T10:35:14-05:00,
taxable: false,
barcode: ,
grams: 1000,
image_id: 42429068542267,
weight: 1,
weight_unit: kg,
inventory_item_id: 47938406547771,
inventory_quantity: 2,
old_inventory_quantity: 2,
requires_shipping: true,
admin_graphql_api_id: gid://shopify/ProductVariant/45891642589499}

 

 How can I get the currency of that price with rest api?