curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"source_currency_code": "<string>",
"source_currency_exponent": 123,
"target_currency_code": "<string>",
"target_currency_exponent": 123,
"direction": "<string>",
"rate": "<string>",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}End an exchange rate
Stops an exchange rate from today, so a new rate can replace it.
curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/exchange-rates/{exchangeRate}/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"source_currency_code": "<string>",
"source_currency_exponent": 123,
"target_currency_code": "<string>",
"target_currency_exponent": 123,
"direction": "<string>",
"rate": "<string>",
"valid_from": "2023-12-25",
"valid_to": "2023-12-25",
"created_by": "<string>",
"created_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}exchange_rates.close
Conditions
- The accounting module must be included in the plan of the organization.
- Exchange rates belong to the organization, not to a book.
- The caller needs an accounting access grant on the organization’s own book (a grant on a company book is not enough). This is checked before validation.
- A rate that is already closed cannot be closed again.
- A rate that has not started yet (valid_from in the future) cannot be closed; delete it instead.
- Sets valid_to to today. The rate still applies today; from tomorrow no rate exists for that pair and direction until a new one starting after today is created, and conversions that need it are refused.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the exchange rate (27-character KSUID).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, source_currency_code, source_currency_exponent, target_currency_code, target_currency_exponent, direction, rate, valid_from, valid_to, created_by, created_by_type, created_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Response
Resource (only with response=resource).
Identifier of the exchange rate (27-character KSUID).
Three-letter code of the currency converted from.
Number of decimal places of the source currency (divide an amount in minor units by 10 to this power).
Three-letter code of the currency converted to.
Number of decimal places of the target currency.
Money flow the rate applies to: incoming (money received) or outgoing (money paid out, such as refunds).
Exchange rate: how many units of the target currency one unit of the source currency is worth, as an exact decimal string with no trailing zeros.
First day the rate applies (YYYY-MM-DD).
Last day the rate applies (YYYY-MM-DD); null while the rate is open-ended.
Identifier of the member or agent account that created the rate; null when it could not be identified.
Type of the creator (member or agent account); null when unknown.
Date and time the record was created (ISO 8601, UTC).