How to enable per-product currency pricing and set prices via Backend API (swell-node)? #638
Unanswered
dexterdotbuzz
asked this question in
Help
Replies: 1 comment
-
|
Try to update "purchase_options.standard": Set the price for the base currency (USD in my store) and set the price for each currency you want to update (including the base currency) in the $currency section (USD and EUR in my store). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm using swell-node v6.0.3 with "Priced" multi-currency (not conversion-based).
My store has 7 currencies enabled (USD base + TWD, CAD, SGD, EUR, JPY, KRW), all set
to Kind: Priced.
I need to programmatically set per-product currency prices for ~83 products. I've
tried two approaches — neither fully works:
Approach 1: Writing to currencies field
await swell.put('/products/{id}', {
id: productId,
currencies: {
EUR: { price: 388.95 },
TWD: { price: 14300 },
JPY: { price: 71200 },
KRW: { price: 672000 },
},
});
Result: The currencies field is stored (confirmed via GET), and prices show correctly
in the dashboard only for currencies already enabled on the product. But this
doesn't enable a currency on the product — JPY and KRW don't appear in the product's
pricing section until I manually check them in the dashboard's currency dropdown.
Approach 2: PUT with ?currency=JPY query param
await swell.request('put',
/products/${productId}?currency=JPY, {price: 71200,
});
Result: Returns the correct price in the response, but overwrites the product's base
currency context. After setting multiple currencies sequentially, only the last one
persists.
My questions:
JPY/KRW in the dashboard's currency dropdown)
product in one request?
seems to strip $-prefixed fields.
Beta Was this translation helpful? Give feedback.
All reactions