Plans
Plans describe the available spread and commission groups which a project can enroll their accounts into.
To list available plans the getPlans()
method can be used within the admin.brand
namespace. The method accepts a
brand id and an optional array of server ids to filter the results by.
import { BrandPlanDto } from '@tradrapi/trading-sdk';
const brandId = 1;
const serversIds = [1, 2, 3];
const result: BrandPlanDto = await tradrApi.admin.brand.getPlans(brandId, serversIds);
The result will be in the format of a BrandPlanDto
object as follows:
interface SpreadPlan {
/** The id of the plan */
id: number;
/** The name of the plan */
name: string;
/** The server the plan belongs to */
server: Server;
}
interface CommissionPlan {
/** The id of the plan */
id: number;
/** The name of the plan */
name: string;
/** The server the plan belongs to */
server: Server;
}
interface BrandPlanDto {
/** The spread plans available for the brand */
spreadPlans: SpreadPlan[];
/** The commission plans available for the brand */
commissionPlans: CommissionPlan[];
}