Get a Currency

get
Get a Currency by ID

https://api.moltin.com/v2/currencies/:id
Request
Response
Path Parameters
id
required
string
The ID for the requested Currency
Headers
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"data": {
"id": "451b94f8-0536-4580-91e1-68bad2f05925",
"type": "currency",
"code": "GBP",
"exchange_rate": 1,
"format": "£{price}",
"decimal_point": ".",
"thousand_separator": ",",
"decimal_places": 0,
"default": false,
"enabled": true,
"links": {
"self":
"https://api.moltin.com/currencies/451b94f8-0536-4580-91e1-68bad2f05925"
},
"meta": {
"timestamps": {
"created_at": "2017-09-27T08:48:01.821Z",
"updated_at": "2018-04-24T19:19:40.941Z"
}
}
}
}
cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/currencies/:id \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const id = 'XXXX'
Moltin.Currencies.Get(id).then(currency => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
let id = "XXXX"
moltin.currency.get(forID: id) { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}