Update currency rate
Update an existing currency rate
Also accepts PATCH with the same body.
PUT
/
admin
/
api
/
v1
/
support
/
currencies
/
{currency_id}
/
rates
/
{id}
Update currency rate
curl --request PUT \
--url https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "2024-01-15",
"rate": 1.25,
"company_id": 1
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}"
payload = {
"name": "2024-01-15",
"rate": 1.25,
"company_id": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '2024-01-15', rate: 1.25, company_id: 1})
};
fetch('https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}', 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://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '2024-01-15',
'rate' => 1.25,
'company_id' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": null,
"name": "1996-01-25T00:00:00.000000Z",
"rate": "1.992991",
"inverse_rate": 0.501758412356102,
"currency_id": 800,
"company_id": 1410,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Currency rate updated successfully."
}{
"message": "Unauthenticated."
}{
"message": "Resource not found."
}{
"message": "The given data was invalid.",
"errors": {
"rate": [
"The rate field must be a number."
]
}
}Authorizations
An API token from Sign in, sent as Authorization: Bearer <token>. Tokens last 30 days.
Path Parameters
Body
application/json
Response
Success
⌘I
Update currency rate
curl --request PUT \
--url https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "2024-01-15",
"rate": 1.25,
"company_id": 1
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}"
payload = {
"name": "2024-01-15",
"rate": 1.25,
"company_id": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '2024-01-15', rate: 1.25, company_id: 1})
};
fetch('https://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}', 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://erp.arukz.com/admin/api/v1/support/currencies/{currency_id}/rates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '2024-01-15',
'rate' => 1.25,
'company_id' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": null,
"name": "1996-01-25T00:00:00.000000Z",
"rate": "1.992991",
"inverse_rate": 0.501758412356102,
"currency_id": 800,
"company_id": 1410,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Currency rate updated successfully."
}{
"message": "Unauthenticated."
}{
"message": "Resource not found."
}{
"message": "The given data was invalid.",
"errors": {
"rate": [
"The rate field must be a number."
]
}
}