Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sdk-generation-log/foreignexchange.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"service": "foreignexchange",
"project": "node",
"generatedAt": "2026-10-01T14:42:10Z",
"openapiCommitSha": "45520ee6246d7e3d8074c3c5c5e991e65c2c02d6",
"automationCommitSha": "5d96c9a6b53a7052671a48c3ab6eb109bec1550b",
"libraryCommitSha": "457353822a6b1e7afe1e06a10eff5508005bc8dd"
}
24 changes: 24 additions & 0 deletions src/services/foreignExchange/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { RatesApi } from "./ratesApi";

import Service from "../../service";
import Client from "../../client";

export default class ForeignExchangeAPI extends Service {

public constructor(client: Client) {
super(client);
}

public get RatesApi() {
return new RatesApi(this.client);
}
}
53 changes: 53 additions & 0 deletions src/services/foreignExchange/ratesApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";

import { ObjectSerializer } from "../../typings/foreignExchange/objectSerializer";
import { CalculateRateRequest } from "../../typings/foreignExchange/models";
import { CalculateRateResponse } from "../../typings/foreignExchange/models";

/**
* API handler for RatesApi
*/
export class RatesApi extends Service {

private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/fx/api/v1";
private baseUrl: string;

public constructor(client: Client){
super(client);
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}

/**
* @summary Calculate amount in a different currency
* @param calculateRateRequest {@link CalculateRateRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link CalculateRateResponse }
*/
public async calculate(calculateRateRequest: CalculateRateRequest, requestOptions?: IRequest.Options): Promise<CalculateRateResponse> {
const endpoint = `${this.baseUrl}/rates/calculate`;
const resource = new Resource(this, endpoint);

const request: CalculateRateRequest = ObjectSerializer.serialize(calculateRateRequest, "CalculateRateRequest");
const response = await getJsonResponse<CalculateRateRequest, CalculateRateResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);

return ObjectSerializer.deserialize(response, "CalculateRateResponse");
}

}
46 changes: 46 additions & 0 deletions src/typings/foreignExchange/amount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export class Amount {
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
*/
"currency": string;
/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*/
"value": number;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "currency",
"baseName": "currency",
"type": "string",
"format": ""
},
{
"name": "value",
"baseName": "value",
"type": "number",
"format": "int64"
} ];

static getAttributeTypeMap() {
return Amount.attributeTypeMap;
}

public constructor() {
}
}

42 changes: 42 additions & 0 deletions src/typings/foreignExchange/calculateRateRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { CalculateRateRequestItem } from "./calculateRateRequestItem";

/**
* The request to calculate an amount in a different currency.
*/


export class CalculateRateRequest {
/**
* An array of objects, where each object defines a currency and value for which you want to perform an exchange calculation.
*/
"exchangeCalculations": Array<CalculateRateRequestItem>;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "exchangeCalculations",
"baseName": "exchangeCalculations",
"type": "Array<CalculateRateRequestItem>",
"format": ""
} ];

static getAttributeTypeMap() {
return CalculateRateRequest.attributeTypeMap;
}

public constructor() {
}
}

67 changes: 67 additions & 0 deletions src/typings/foreignExchange/calculateRateRequestItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { Amount } from "./amount";
import { ExchangeSide } from "./exchangeSide";
import { RateType } from "./rateType";

/**
* The request parameters required to calculate an amount in a different currency.
*/


export class CalculateRateRequestItem {
"exchangeSide": ExchangeSide;
"sourceAmount": Amount;
/**
* The currency to which you want to convert the source amount.
*/
"targetCurrency": string;
"type": RateType;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "exchangeSide",
"baseName": "exchangeSide",
"type": "ExchangeSide",
"format": ""
},
{
"name": "sourceAmount",
"baseName": "sourceAmount",
"type": "Amount",
"format": ""
},
{
"name": "targetCurrency",
"baseName": "targetCurrency",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
"type": "RateType",
"format": ""
} ];

static getAttributeTypeMap() {
return CalculateRateRequestItem.attributeTypeMap;
}

public constructor() {
}
}

export namespace CalculateRateRequestItem {
}
42 changes: 42 additions & 0 deletions src/typings/foreignExchange/calculateRateResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { CalculateRateResponseItem } from "./calculateRateResponseItem";

/**
* The response returned when you calculate an amount in a different currency.
*/


export class CalculateRateResponse {
/**
* An array of objects, where each object returns a currency and value for which you performed an exchange calculation. You can use the calculated amounts in your payment requests.
*/
"exchangeCalculations"?: Array<CalculateRateResponseItem>;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "exchangeCalculations",
"baseName": "exchangeCalculations",
"type": "Array<CalculateRateResponseItem>",
"format": ""
} ];

static getAttributeTypeMap() {
return CalculateRateResponse.attributeTypeMap;
}

public constructor() {
}
}

76 changes: 76 additions & 0 deletions src/typings/foreignExchange/calculateRateResponseItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { Amount } from "./amount";

/**
* The response parameters returned when you calculate an amount in a different currency.
*/


export class CalculateRateResponseItem {
/**
* The exchange rate to convert the source currency to the target currency. This includes Adyen\'s markup.
*/
"appliedExchangeRate"?: number;
/**
* The operation performed on the source amount. Possible values: * **buy** * **sell**
*/
"exchangeSide"?: string;
"sourceAmount"?: Amount | null;
"targetAmount"?: Amount | null;
/**
* The type of transaction. Possible values: * **splitPayment**: for payments * **splitRefund**: for refunds
*/
"type"?: string;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "appliedExchangeRate",
"baseName": "appliedExchangeRate",
"type": "number",
"format": ""
},
{
"name": "exchangeSide",
"baseName": "exchangeSide",
"type": "string",
"format": ""
},
{
"name": "sourceAmount",
"baseName": "sourceAmount",
"type": "Amount | null",
"format": ""
},
{
"name": "targetAmount",
"baseName": "targetAmount",
"type": "Amount | null",
"format": ""
},
{
"name": "type",
"baseName": "type",
"type": "string",
"format": ""
} ];

static getAttributeTypeMap() {
return CalculateRateResponseItem.attributeTypeMap;
}

public constructor() {
}
}

Loading
Loading