Skip to main content

Create a Currency

POST 

https://useast.api.elasticpath.com/v2/currencies

Create a currency.

Request

Responses

Created

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/currencies");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("[\n {\n \"data\": {\n \"code\": \"GBP\",\n \"decimal_places\": 2,\n \"decimal_point\": \".\",\n \"default\": true,\n \"enabled\": true,\n \"exchange_rate\": 1,\n \"format\": \"£{price}\",\n \"thousand_separator\": \",\",\n \"type\": \"currency\"\n }\n }\n]", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Body
[
  {
    "data": {
      "code": "GBP",
      "decimal_places": 2,
      "decimal_point": ".",
      "default": true,
      "enabled": true,
      "exchange_rate": 1,
      "format": "£{price}",
      "thousand_separator": ",",
      "type": "currency"
    }
  }
]
ResponseClear

Click the Send API Request button above and see the response here!