cURL
curl --request PUT \
--url https://api.tirdad.ai/v1/forex/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"rate": "<string>",
"start_date": "2023-11-07T05:31:56Z"
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.fx_rates.update_fx_rate(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.fxRates.updateFXRate("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.FXRates.UpdateFXRate(ctx, "<id>", types.UpdateFXRateRequest{})
if err != nil {
log.Fatal(err)
}
if res.FXRateResponse != nil {
// handle response
}
}{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"from_currency": "<string>",
"id": "<string>",
"metadata": {},
"rate": "<string>",
"scope": "tenant",
"scope_id": "<string>",
"source": "fixed",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"to_currency": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}FX Rates
Update an FX rate
Update a rate’s value, validity window (overrides only) or metadata. Scope, scope_id and the currency pair are immutable.
PUT
/
forex
/
{id}
cURL
curl --request PUT \
--url https://api.tirdad.ai/v1/forex/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"rate": "<string>",
"start_date": "2023-11-07T05:31:56Z"
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.fx_rates.update_fx_rate(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.fxRates.updateFXRate("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.FXRates.UpdateFXRate(ctx, "<id>", types.UpdateFXRateRequest{})
if err != nil {
log.Fatal(err)
}
if res.FXRateResponse != nil {
// handle response
}
}{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"from_currency": "<string>",
"id": "<string>",
"metadata": {},
"rate": "<string>",
"scope": "tenant",
"scope_id": "<string>",
"source": "fixed",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"tenant_id": "<string>",
"to_currency": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
FX rate fields to update
Response
OK