Update a Currency

Update a Currency by ID

PUT https://api.moltin.com/v2/currencies/:id

Path Parameters

NameTypeDescription

id

string

The ID for the requested Currency

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

Request Body

NameTypeDescription

type

string

The type represents the object being returned. Always currency

code

string

The currency code. Example: YEN

enabled

boolean

Is this currency available for products? true or false

default

boolean

Is this the default currency? true or false

decimal_places

integer

How many decimal places the currency is formatted to

thousand_separator

string

The thousand separator character. Example: ,

decimal_point

string

The decimal point character. Example: .

format

string

Specify how the price currency is displayed. Example: "¥{price}"

exchange_rate

string

The exchange rate from the default currency

{
  "data": {
    "id": "190c3e9e-8006-4231-8c29-833fb4f6bff0",
    "type": "currency",
    "code": "YEN",
    "exchange_rate": 1.5,
    "format": "¥{price}",
    "decimal_point": ",",
    "thousand_separator": ".",
    "decimal_places": 2,
    "default": false,
    "enabled": true,
    "links": {
      "self":
        "https://api.moltin.com/currencies/190c3e9e-8006-4231-8c29-833fb4f6bff0"
    },
    "meta": {
      "timestamps": {
        "created_at": "2018-05-02T09:01:56.303640168Z",
        "updated_at": "2018-05-02T09:01:56.303641068Z"
      }
    }
  }
}
curl -X PUT https://api.moltin.com/v2/currencies/:id \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
       "data": {
         "type": "currency",
         "exchange_rate": 1.5
       }
     }'

Last updated