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/capital.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"service": "capital",
"project": "node",
"generatedAt": "2026-04-15T07:56:29Z",
"openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
"automationCommitSha": "1ceda93a33430aa189b6141d5f6ea2e61051c7fd",
"libraryCommitSha": "e0c07e05d8c98b20f336ef0fa714fe95f4172c2f"
}
109 changes: 109 additions & 0 deletions src/services/capital/dynamicOffersApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* 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/capital/objectSerializer";
import { CalculateGrantOfferRequest } from "../../typings/capital/models";
import { CalculatedGrantOffer } from "../../typings/capital/models";
import { CreateGrantOfferRequest } from "../../typings/capital/models";
import { FinancingType } from "../../typings/capital/models";
import { GetDynamicOffersResponse } from "../../typings/capital/models";
import { GrantOffer } from "../../typings/capital/models";

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

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

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

/**
* @summary Calculate a preliminary offer for a selected financing amount
* @param id {@link string } The unique identifier of the dynamic offer from which the user selected the financing amount.
* @param calculateGrantOfferRequest {@link CalculateGrantOfferRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link CalculatedGrantOffer }
*/
public async calculatePreliminaryOfferFromDynamicOffer(id: string, calculateGrantOfferRequest: CalculateGrantOfferRequest, requestOptions?: IRequest.Options): Promise<CalculatedGrantOffer> {
const endpoint = `${this.baseUrl}/dynamicOffers/{id}/calculate`
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
const resource = new Resource(this, endpoint);

const request: CalculateGrantOfferRequest = ObjectSerializer.serialize(calculateGrantOfferRequest, "CalculateGrantOfferRequest");
const response = await getJsonResponse<CalculateGrantOfferRequest, CalculatedGrantOffer>(
resource,
request,
{ ...requestOptions, method: "POST" }
);

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

/**
* @summary Create a static offer for a selected financing amount
* @param id {@link string } The unique identifier of the dynamic offer from which the user selected the financing amount.
* @param createGrantOfferRequest {@link CreateGrantOfferRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link GrantOffer }
*/
public async createStaticOfferFromDynamicOffer(id: string, createGrantOfferRequest: CreateGrantOfferRequest, requestOptions?: IRequest.Options): Promise<GrantOffer> {
const endpoint = `${this.baseUrl}/dynamicOffers/{id}/grantOffer`
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
const resource = new Resource(this, endpoint);

const request: CreateGrantOfferRequest = ObjectSerializer.serialize(createGrantOfferRequest, "CreateGrantOfferRequest");
const response = await getJsonResponse<CreateGrantOfferRequest, GrantOffer>(
resource,
request,
{ ...requestOptions, method: "POST" }
);

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

/**
* @summary Get all available dynamic offers
* @param requestOptions {@link IRequest.Options }
* @param accountHolderId {@link string } (Required) The unique identifier of the account holder that the dynamic offer is for.
* @param financingType {@link FinancingType } The type of financing that the offer is for. If the value is not specified, returns all available types. Possible values: **businessFinancing**
* @return {@link GetDynamicOffersResponse }
*/
public async getAllDynamicOffers(accountHolderId: string, financingType?: FinancingType, requestOptions?: IRequest.Options): Promise<GetDynamicOffersResponse> {
const endpoint = `${this.baseUrl}/dynamicOffers`;
const resource = new Resource(this, endpoint);

const hasDefinedQueryParams = accountHolderId ?? financingType;
if(hasDefinedQueryParams) {
if(!requestOptions) requestOptions = {};
if(!requestOptions.params) requestOptions.params = {};
if(accountHolderId) requestOptions.params["accountHolderId"] = accountHolderId;
if(financingType) requestOptions.params["financingType"] = financingType;
}
const response = await getJsonResponse<string, GetDynamicOffersResponse>(
resource,
"",
{ ...requestOptions, method: "GET" }
);

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

}
10 changes: 5 additions & 5 deletions src/services/capital/grantOffersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export class GrantOffersApi extends Service {
}

/**
* @summary Get all available grant offers
* @summary Get all available static offers
* @param requestOptions {@link IRequest.Options }
* @param accountHolderId {@link string } The unique identifier of the account holder for which you want to get the available grant offers.
* @param accountHolderId {@link string } (Required) The unique identifier of the account holder for which you want to get the available static offers.
* @return {@link GrantOffers }
*/
public async getAllGrantOffers(accountHolderId?: string, requestOptions?: IRequest.Options): Promise<GrantOffers> {
public async getAllGrantOffers(accountHolderId: string, requestOptions?: IRequest.Options): Promise<GrantOffers> {
const endpoint = `${this.baseUrl}/grantOffers`;
const resource = new Resource(this, endpoint);

Expand All @@ -57,8 +57,8 @@ export class GrantOffersApi extends Service {
}

/**
* @summary Get the details of a grant offer
* @param id {@link string } The unique identifier of the grant offer.
* @summary Get the details of a static offer
* @param id {@link string } The unique identifier of the static offer.
* @param requestOptions {@link IRequest.Options }
* @return {@link GrantOffer }
*/
Expand Down
5 changes: 5 additions & 0 deletions src/services/capital/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Do not edit this class manually.
*/

import { DynamicOffersApi } from "./dynamicOffersApi";
import { GrantAccountsApi } from "./grantAccountsApi";
import { GrantOffersApi } from "./grantOffersApi";
import { GrantsApi } from "./grantsApi";
Expand All @@ -20,6 +21,10 @@ export default class CapitalAPI extends Service {
super(client);
}

public get DynamicOffersApi() {
return new DynamicOffersApi(this.client);
}

public get GrantAccountsApi() {
return new GrantAccountsApi(this.client);
}
Expand Down
15 changes: 11 additions & 4 deletions src/typings/capital/additionalBankIdentification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
* Do not edit this class manually.
*/

import { AdditionalBankIdentificationTypes } from "./additionalBankIdentificationTypes";


export class AdditionalBankIdentification {
/**
* The value of the additional bank identification.
*/
"code"?: string;
"type"?: AdditionalBankIdentificationTypes;
/**
* The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.
*/
"type"?: AdditionalBankIdentification.TypeEnum;

static readonly discriminator: string | undefined = undefined;

Expand All @@ -31,7 +32,7 @@ export class AdditionalBankIdentification {
{
"name": "type",
"baseName": "type",
"type": "AdditionalBankIdentificationTypes",
"type": "AdditionalBankIdentification.TypeEnum",
"format": ""
} ];

Expand All @@ -44,4 +45,10 @@ export class AdditionalBankIdentification {
}

export namespace AdditionalBankIdentification {
export enum TypeEnum {
AuBsbCode = 'auBsbCode',
CaRoutingNumber = 'caRoutingNumber',
GbSortCode = 'gbSortCode',
UsRoutingNumber = 'usRoutingNumber'
}
}
18 changes: 0 additions & 18 deletions src/typings/capital/additionalBankIdentificationTypes.ts

This file was deleted.

35 changes: 35 additions & 0 deletions src/typings/capital/calculateGrantOfferRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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";


export class CalculateGrantOfferRequest {
"amount": Amount;

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": "amount",
"baseName": "amount",
"type": "Amount",
"format": ""
} ];

static getAttributeTypeMap() {
return CalculateGrantOfferRequest.attributeTypeMap;
}

public constructor() {
}
}

97 changes: 97 additions & 0 deletions src/typings/capital/calculatedGrantOffer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* 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 { GrantOfferFee } from "./grantOfferFee";
import { Repayment } from "./repayment";


export class CalculatedGrantOffer {
/**
* The unique identifier of the account holder that the dynamic offer is for.
*/
"accountHolderId": string;
"amount": Amount;
/**
* The contract type of the offer. Possible values: * **loan** * **cashAdvance**
*/
"contractType": CalculatedGrantOffer.ContractTypeEnum;
/**
* The expiration date and time of the offer validity period.
*/
"expiresAt": Date;
"fee": GrantOfferFee;
"repayment": Repayment;
/**
* The starting date and time of the offer validity period.
*/
"startsAt": Date;

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": "accountHolderId",
"baseName": "accountHolderId",
"type": "string",
"format": ""
},
{
"name": "amount",
"baseName": "amount",
"type": "Amount",
"format": ""
},
{
"name": "contractType",
"baseName": "contractType",
"type": "CalculatedGrantOffer.ContractTypeEnum",
"format": ""
},
{
"name": "expiresAt",
"baseName": "expiresAt",
"type": "Date",
"format": "date-time"
},
{
"name": "fee",
"baseName": "fee",
"type": "GrantOfferFee",
"format": ""
},
{
"name": "repayment",
"baseName": "repayment",
"type": "Repayment",
"format": ""
},
{
"name": "startsAt",
"baseName": "startsAt",
"type": "Date",
"format": "date-time"
} ];

static getAttributeTypeMap() {
return CalculatedGrantOffer.attributeTypeMap;
}

public constructor() {
}
}

export namespace CalculatedGrantOffer {
export enum ContractTypeEnum {
CashAdvance = 'cashAdvance',
Loan = 'loan'
}
}
35 changes: 35 additions & 0 deletions src/typings/capital/createGrantOfferRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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";


export class CreateGrantOfferRequest {
"amount": Amount;

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": "amount",
"baseName": "amount",
"type": "Amount",
"format": ""
} ];

static getAttributeTypeMap() {
return CreateGrantOfferRequest.attributeTypeMap;
}

public constructor() {
}
}

Loading
Loading