cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/forex \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"from_currency": "<string>",
"to_currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"rate": "<string>",
"scope_id": "<string>",
"start_date": "2023-11-07T05:31:56Z"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.fx_rates.create_fx_rate(from_currency="<value>", scope="tenant", to_currency="<value>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.fxRates.createFXRate({
fromCurrency: "<value>",
scope: "tenant",
toCurrency: "<value>",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.FXRates.CreateFXRate(ctx, types.CreateFXRateRequest{
FromCurrency: "<value>",
Scope: types.FXRateScopeTenant,
ToCurrency: "<value>",
})
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
Create an FX rate
Configure a fixed exchange rate at tenant, customer or subscription scope. Overrides need a tenant rate for the same pair.
POST
/
forex
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/forex \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"from_currency": "<string>",
"to_currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"rate": "<string>",
"scope_id": "<string>",
"start_date": "2023-11-07T05:31:56Z"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.fx_rates.create_fx_rate(from_currency="<value>", scope="tenant", to_currency="<value>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.fxRates.createFXRate({
fromCurrency: "<value>",
scope: "tenant",
toCurrency: "<value>",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.FXRates.CreateFXRate(ctx, types.CreateFXRateRequest{
FromCurrency: "<value>",
Scope: types.FXRateScopeTenant,
ToCurrency: "<value>",
})
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>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
FX rate to create
Response
Created
Show child attributes
Show child attributes
Available options:
tenant, customer, subscription Available options:
fixed, market Available options:
published, deleted, archived 
