首页 > 解决方案 > 如何在使用 API 下订单之前更改货币代码

问题描述

我需要更改报价货币以从移动应用程序订购。我尝试通过以下 API 将报价货币从 GBP 转换为 USD,但没有成功。它只是将产品添加到购物车,我不知道这是更改货币代码的正确方法。帮我解决这个问题。提前致谢

URL : /rest/V1/carts/mine
Method : PUT
Payload : 
    {
"quote": {
"id": 627,
"items": [
  {
    "sku": "DISS",
    "qty": 1,
    "quote_id": "627"
  }
],
"customer": {
  "id": 9,
  "email": "sample@gmail.com",
  "firstname": "fname",
  "lastname": "lname"
},
"billing_address": {
  "region": "",
  "region_id": 0,
  "region_code": "",
  "country_id": "GB",
  "street": [
    "strrret"
  ],
  "telephone": "44",
  "postcode": "",
  "city": "city",
  "firstname": "fname",
  "lastname": "lname",
  "email": "sample@gmail.com"

},
"currency": {
  "global_currency_code": "GBP",
  "base_currency_code": "GBP",
  "store_currency_code": "GBP",
  "quote_currency_code": "USD",
  "store_to_base_rate": 1,
  "store_to_quote_rate": 1,
  "base_to_global_rate": 1,
  "base_to_quote_rate": 1.34
},
"customer_is_guest": false 
} 
}

标签: magento2currencyrest

解决方案


推荐阅读