对于启用了多种货币和货币切换器的BigCommerce商店,有没有办法在前端获得货币汇率?
当选择另一种货币时,它会使用查询字符串参数重新加载页面,但如果费率本身在某处显示,我在文档中找不到。
答案 0 :(得分:1)
端点如下。它们受产品oAuth权限的约束。
OAuth: /stores/{store_hash}/v2/currencies
Basic: /api/v2/currencies
此端点的GET响应示例:
{
"id": 3,
"is_default": "False",
"date_created": "Thu, 11 Sep 2014 17:10:12 +0000",
"date_modified": "Thu, 08 Jan 2015 15:12:48 +0000",
"country_iso2": "AU"
"currency_code": "AUD",
"currency_exchange_rate": "1.3885600000",
"auto_update": "False",
"location": "left",
"token": "$",
"decimal_token": ".",
"thousands_token": ",",
"decimal_places": 2
}
PUT / POSTable字段的示例:
{
"country_iso2": "AU"
"currency_code": "AUD",
"currency_exchange_rate": "1.3885600000",
"auto_update": "False",
"location": "left",
"token": "$",
"decimal_token": ".",
"thousands_token": ",",
"decimal_places": 2
}
我建议不要从店面运行此API请求。我建议使用heroku或其他第三方服务器或使用现有的应用程序服务发出请求并将值返回到店面,以免暴露API密钥。