From 098cc8b0883e230dc3a7ce3fe27daece4878b68f Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:34 +0530 Subject: [PATCH 1/6] feat(models): add new model classes for ipo-orders --- src/model/IpoApplyData.js | 53 +++++++ src/model/IpoApplyRequest.js | 85 ++++++++++ src/model/IpoApplyResponse.js | 60 +++++++ src/model/IpoBidRequest.js | 65 ++++++++ src/model/IpoCancelData.js | 61 +++++++ src/model/IpoCancelResponse.js | 60 +++++++ src/model/IpoDetailsData.js | 8 + src/model/IpoInvestorType.js | 61 +++++++ src/model/IpoListingData.js | 8 + src/model/IpoOrderBid.js | 77 +++++++++ src/model/IpoOrderData.js | 237 ++++++++++++++++++++++++++++ src/model/IpoOrderDetailResponse.js | 60 +++++++ src/model/IpoOrderResponse.js | 67 ++++++++ 13 files changed, 902 insertions(+) create mode 100644 src/model/IpoApplyData.js create mode 100644 src/model/IpoApplyRequest.js create mode 100644 src/model/IpoApplyResponse.js create mode 100644 src/model/IpoBidRequest.js create mode 100644 src/model/IpoCancelData.js create mode 100644 src/model/IpoCancelResponse.js create mode 100644 src/model/IpoInvestorType.js create mode 100644 src/model/IpoOrderBid.js create mode 100644 src/model/IpoOrderData.js create mode 100644 src/model/IpoOrderDetailResponse.js create mode 100644 src/model/IpoOrderResponse.js diff --git a/src/model/IpoApplyData.js b/src/model/IpoApplyData.js new file mode 100644 index 0000000..dce764a --- /dev/null +++ b/src/model/IpoApplyData.js @@ -0,0 +1,53 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoApplyData model module. + * @module model/IpoApplyData + * @version v0 + */ +export class IpoApplyData { + /** + * Constructs a new IpoApplyData. + * @alias module:model/IpoApplyData + * @class + */ + constructor() { + } + + /** + * Constructs a IpoApplyData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoApplyData} obj Optional instance to populate. + * @return {module:model/IpoApplyData} The populated IpoApplyData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoApplyData(); + if (data.hasOwnProperty('order_id')) + obj.orderId = ApiClient.convertToType(data['order_id'], Object); + } + return obj; + } +} + +/** + * Application id created for this IPO application. Pass this as order_id to the get-order and cancel-order APIs + * @member {Object} orderId + */ +IpoApplyData.prototype.orderId = undefined; + diff --git a/src/model/IpoApplyRequest.js b/src/model/IpoApplyRequest.js new file mode 100644 index 0000000..3fd5d70 --- /dev/null +++ b/src/model/IpoApplyRequest.js @@ -0,0 +1,85 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoApplyRequest model module. + * @module model/IpoApplyRequest + * @version v0 + */ +export class IpoApplyRequest { + /** + * Constructs a new IpoApplyRequest. + * @alias module:model/IpoApplyRequest + * @class + * @param id {Object} IPO id (slug) to apply for, as returned in `id` by the IPO listing and details APIs + * @param upi {Object} UPI id used to block the application amount + * @param category {Object} Investor category to apply under. Must be one the issue accepts — see `investors[].category` in the IPO details API + * @param bids {Object} List of bids for the application (1 to 3 bids) + */ + constructor(id, upi, category, bids) { + this.id = id; + this.upi = upi; + this.category = category; + this.bids = bids; + } + + /** + * Constructs a IpoApplyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoApplyRequest} obj Optional instance to populate. + * @return {module:model/IpoApplyRequest} The populated IpoApplyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoApplyRequest(); + if (data.hasOwnProperty('id')) + obj.id = ApiClient.convertToType(data['id'], Object); + if (data.hasOwnProperty('upi')) + obj.upi = ApiClient.convertToType(data['upi'], Object); + if (data.hasOwnProperty('category')) + obj.category = ApiClient.convertToType(data['category'], Object); + if (data.hasOwnProperty('bids')) + obj.bids = ApiClient.convertToType(data['bids'], Object); + } + return obj; + } +} + +/** + * IPO id (slug) to apply for, as returned in `id` by the IPO listing and details APIs + * @member {Object} id + */ +IpoApplyRequest.prototype.id = undefined; + +/** + * UPI id used to block the application amount + * @member {Object} upi + */ +IpoApplyRequest.prototype.upi = undefined; + +/** + * Investor category to apply under. Must be one the issue accepts — see `investors[].category` in the IPO details API + * @member {Object} category + */ +IpoApplyRequest.prototype.category = undefined; + +/** + * List of bids for the application (1 to 3 bids) + * @member {Object} bids + */ +IpoApplyRequest.prototype.bids = undefined; + diff --git a/src/model/IpoApplyResponse.js b/src/model/IpoApplyResponse.js new file mode 100644 index 0000000..47298e3 --- /dev/null +++ b/src/model/IpoApplyResponse.js @@ -0,0 +1,60 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; +import {IpoApplyData} from './IpoApplyData'; + +/** + * The IpoApplyResponse model module. + * @module model/IpoApplyResponse + * @version v0 + */ +export class IpoApplyResponse { + /** + * Constructs a new IpoApplyResponse. + * @alias module:model/IpoApplyResponse + * @class + */ + constructor() { + } + + /** + * Constructs a IpoApplyResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoApplyResponse} obj Optional instance to populate. + * @return {module:model/IpoApplyResponse} The populated IpoApplyResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoApplyResponse(); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + if (data.hasOwnProperty('data')) + obj.data = IpoApplyData.constructFromObject(data['data']); + } + return obj; + } +} + +/** + * @member {Object} status + */ +IpoApplyResponse.prototype.status = undefined; + +/** + * @member {module:model/IpoApplyData} data + */ +IpoApplyResponse.prototype.data = undefined; + diff --git a/src/model/IpoBidRequest.js b/src/model/IpoBidRequest.js new file mode 100644 index 0000000..4ccdf13 --- /dev/null +++ b/src/model/IpoBidRequest.js @@ -0,0 +1,65 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoBidRequest model module. + * @module model/IpoBidRequest + * @version v0 + */ +export class IpoBidRequest { + /** + * Constructs a new IpoBidRequest. + * @alias module:model/IpoBidRequest + * @class + * @param quantity {Object} Number of shares bid for. Must be a multiple of the IPO's `lot_size` and at least its `minimum_quantity` + * @param price {Object} Bid price per share, in whole rupees — decimals are not accepted. Must sit within the IPO's price band, or equal its `cut_off_price` + */ + constructor(quantity, price) { + this.quantity = quantity; + this.price = price; + } + + /** + * Constructs a IpoBidRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoBidRequest} obj Optional instance to populate. + * @return {module:model/IpoBidRequest} The populated IpoBidRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoBidRequest(); + if (data.hasOwnProperty('quantity')) + obj.quantity = ApiClient.convertToType(data['quantity'], Object); + if (data.hasOwnProperty('price')) + obj.price = ApiClient.convertToType(data['price'], Object); + } + return obj; + } +} + +/** + * Number of shares bid for. Must be a multiple of the IPO's `lot_size` and at least its `minimum_quantity` + * @member {Object} quantity + */ +IpoBidRequest.prototype.quantity = undefined; + +/** + * Bid price per share, in whole rupees — decimals are not accepted. Must sit within the IPO's price band, or equal its `cut_off_price` + * @member {Object} price + */ +IpoBidRequest.prototype.price = undefined; + diff --git a/src/model/IpoCancelData.js b/src/model/IpoCancelData.js new file mode 100644 index 0000000..35ca536 --- /dev/null +++ b/src/model/IpoCancelData.js @@ -0,0 +1,61 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoCancelData model module. + * @module model/IpoCancelData + * @version v0 + */ +export class IpoCancelData { + /** + * Constructs a new IpoCancelData. + * @alias module:model/IpoCancelData + * @class + */ + constructor() { + } + + /** + * Constructs a IpoCancelData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoCancelData} obj Optional instance to populate. + * @return {module:model/IpoCancelData} The populated IpoCancelData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoCancelData(); + if (data.hasOwnProperty('order_id')) + obj.orderId = ApiClient.convertToType(data['order_id'], Object); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + } + return obj; + } +} + +/** + * Application id that was cancelled + * @member {Object} orderId + */ +IpoCancelData.prototype.orderId = undefined; + +/** + * Free-text message returned by the IPO service for the cancellation request + * @member {Object} status + */ +IpoCancelData.prototype.status = undefined; + diff --git a/src/model/IpoCancelResponse.js b/src/model/IpoCancelResponse.js new file mode 100644 index 0000000..971d6cf --- /dev/null +++ b/src/model/IpoCancelResponse.js @@ -0,0 +1,60 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; +import {IpoCancelData} from './IpoCancelData'; + +/** + * The IpoCancelResponse model module. + * @module model/IpoCancelResponse + * @version v0 + */ +export class IpoCancelResponse { + /** + * Constructs a new IpoCancelResponse. + * @alias module:model/IpoCancelResponse + * @class + */ + constructor() { + } + + /** + * Constructs a IpoCancelResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoCancelResponse} obj Optional instance to populate. + * @return {module:model/IpoCancelResponse} The populated IpoCancelResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoCancelResponse(); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + if (data.hasOwnProperty('data')) + obj.data = IpoCancelData.constructFromObject(data['data']); + } + return obj; + } +} + +/** + * @member {Object} status + */ +IpoCancelResponse.prototype.status = undefined; + +/** + * @member {module:model/IpoCancelData} data + */ +IpoCancelResponse.prototype.data = undefined; + diff --git a/src/model/IpoDetailsData.js b/src/model/IpoDetailsData.js index 8e3b7bc..e8836bd 100644 --- a/src/model/IpoDetailsData.js +++ b/src/model/IpoDetailsData.js @@ -92,6 +92,8 @@ export class IpoDetailsData { obj.registrarInfo = IpoRegistrarInfo.constructFromObject(data['registrar_info']); if (data.hasOwnProperty('total_subscription')) obj.totalSubscription = ApiClient.convertToType(data['total_subscription'], Object); + if (data.hasOwnProperty('investors')) + obj.investors = ApiClient.convertToType(data['investors'], Object); } return obj; } @@ -227,3 +229,9 @@ IpoDetailsData.prototype.registrarInfo = undefined; */ IpoDetailsData.prototype.totalSubscription = undefined; +/** + * Investor categories the issue accepts + * @member {Object} investors + */ +IpoDetailsData.prototype.investors = undefined; + diff --git a/src/model/IpoInvestorType.js b/src/model/IpoInvestorType.js new file mode 100644 index 0000000..2393ddb --- /dev/null +++ b/src/model/IpoInvestorType.js @@ -0,0 +1,61 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoInvestorType model module. + * @module model/IpoInvestorType + * @version v0 + */ +export class IpoInvestorType { + /** + * Constructs a new IpoInvestorType. + * @alias module:model/IpoInvestorType + * @class + */ + constructor() { + } + + /** + * Constructs a IpoInvestorType from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoInvestorType} obj Optional instance to populate. + * @return {module:model/IpoInvestorType} The populated IpoInvestorType instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoInvestorType(); + if (data.hasOwnProperty('category')) + obj.category = ApiClient.convertToType(data['category'], Object); + if (data.hasOwnProperty('description')) + obj.description = ApiClient.convertToType(data['description'], Object); + } + return obj; + } +} + +/** + * Investor category the issue accepts. Pass this value as category when applying + * @member {Object} category + */ +IpoInvestorType.prototype.category = undefined; + +/** + * Human-readable name of the category; null when the IPO service does not provide one + * @member {Object} description + */ +IpoInvestorType.prototype.description = undefined; + diff --git a/src/model/IpoListingData.js b/src/model/IpoListingData.js index 82356dc..6b5e373 100644 --- a/src/model/IpoListingData.js +++ b/src/model/IpoListingData.js @@ -64,6 +64,8 @@ export class IpoListingData { obj.biddingEndDate = ApiClient.convertToType(data['bidding_end_date'], Object); if (data.hasOwnProperty('total_subscription')) obj.totalSubscription = ApiClient.convertToType(data['total_subscription'], Object); + if (data.hasOwnProperty('investors')) + obj.investors = ApiClient.convertToType(data['investors'], Object); } return obj; } @@ -134,3 +136,9 @@ IpoListingData.prototype.biddingEndDate = undefined; */ IpoListingData.prototype.totalSubscription = undefined; +/** + * Investor categories the issue accepts. Empty when the listing data carries none — the IPO details API is the authoritative source + * @member {Object} investors + */ +IpoListingData.prototype.investors = undefined; + diff --git a/src/model/IpoOrderBid.js b/src/model/IpoOrderBid.js new file mode 100644 index 0000000..84e8e79 --- /dev/null +++ b/src/model/IpoOrderBid.js @@ -0,0 +1,77 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoOrderBid model module. + * @module model/IpoOrderBid + * @version v0 + */ +export class IpoOrderBid { + /** + * Constructs a new IpoOrderBid. + * @alias module:model/IpoOrderBid + * @class + */ + constructor() { + } + + /** + * Constructs a IpoOrderBid from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoOrderBid} obj Optional instance to populate. + * @return {module:model/IpoOrderBid} The populated IpoOrderBid instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoOrderBid(); + if (data.hasOwnProperty('quantity')) + obj.quantity = ApiClient.convertToType(data['quantity'], Object); + if (data.hasOwnProperty('price')) + obj.price = ApiClient.convertToType(data['price'], Object); + if (data.hasOwnProperty('amount')) + obj.amount = ApiClient.convertToType(data['amount'], Object); + if (data.hasOwnProperty('message')) + obj.message = ApiClient.convertToType(data['message'], Object); + } + return obj; + } +} + +/** + * Number of shares bid for + * @member {Object} quantity + */ +IpoOrderBid.prototype.quantity = undefined; + +/** + * Bid price per share + * @member {Object} price + */ +IpoOrderBid.prototype.price = undefined; + +/** + * Value of the bid, quantity x price + * @member {Object} amount + */ +IpoOrderBid.prototype.amount = undefined; + +/** + * Message from the exchange for this bid, when one was returned + * @member {Object} message + */ +IpoOrderBid.prototype.message = undefined; + diff --git a/src/model/IpoOrderData.js b/src/model/IpoOrderData.js new file mode 100644 index 0000000..43d4017 --- /dev/null +++ b/src/model/IpoOrderData.js @@ -0,0 +1,237 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; + +/** + * The IpoOrderData model module. + * @module model/IpoOrderData + * @version v0 + */ +export class IpoOrderData { + /** + * Constructs a new IpoOrderData. + * @alias module:model/IpoOrderData + * @class + */ + constructor() { + } + + /** + * Constructs a IpoOrderData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoOrderData} obj Optional instance to populate. + * @return {module:model/IpoOrderData} The populated IpoOrderData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoOrderData(); + if (data.hasOwnProperty('id')) + obj.id = ApiClient.convertToType(data['id'], Object); + if (data.hasOwnProperty('symbol')) + obj.symbol = ApiClient.convertToType(data['symbol'], Object); + if (data.hasOwnProperty('exchange')) + obj.exchange = ApiClient.convertToType(data['exchange'], Object); + if (data.hasOwnProperty('request_id')) + obj.requestId = ApiClient.convertToType(data['request_id'], Object); + if (data.hasOwnProperty('order_id')) + obj.orderId = ApiClient.convertToType(data['order_id'], Object); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + if (data.hasOwnProperty('order_status')) + obj.orderStatus = ApiClient.convertToType(data['order_status'], Object); + if (data.hasOwnProperty('payment_status')) + obj.paymentStatus = ApiClient.convertToType(data['payment_status'], Object); + if (data.hasOwnProperty('category')) + obj.category = ApiClient.convertToType(data['category'], Object); + if (data.hasOwnProperty('issue_type')) + obj.issueType = ApiClient.convertToType(data['issue_type'], Object); + if (data.hasOwnProperty('reason')) + obj.reason = ApiClient.convertToType(data['reason'], Object); + if (data.hasOwnProperty('upi')) + obj.upi = ApiClient.convertToType(data['upi'], Object); + if (data.hasOwnProperty('upi_amount_blocked')) + obj.upiAmountBlocked = ApiClient.convertToType(data['upi_amount_blocked'], Object); + if (data.hasOwnProperty('nse_submitted_date')) + obj.nseSubmittedDate = ApiClient.convertToType(data['nse_submitted_date'], Object); + if (data.hasOwnProperty('bse_submitted_date')) + obj.bseSubmittedDate = ApiClient.convertToType(data['bse_submitted_date'], Object); + if (data.hasOwnProperty('mandate_approved_date')) + obj.mandateApprovedDate = ApiClient.convertToType(data['mandate_approved_date'], Object); + if (data.hasOwnProperty('rejection_date')) + obj.rejectionDate = ApiClient.convertToType(data['rejection_date'], Object); + if (data.hasOwnProperty('mandate_rejection_date')) + obj.mandateRejectionDate = ApiClient.convertToType(data['mandate_rejection_date'], Object); + if (data.hasOwnProperty('cancel_requested_date')) + obj.cancelRequestedDate = ApiClient.convertToType(data['cancel_requested_date'], Object); + if (data.hasOwnProperty('cancel_accepted_date')) + obj.cancelAcceptedDate = ApiClient.convertToType(data['cancel_accepted_date'], Object); + if (data.hasOwnProperty('units_allotted')) + obj.unitsAllotted = ApiClient.convertToType(data['units_allotted'], Object); + if (data.hasOwnProperty('bids')) + obj.bids = ApiClient.convertToType(data['bids'], Object); + if (data.hasOwnProperty('created_at')) + obj.createdAt = ApiClient.convertToType(data['created_at'], Object); + if (data.hasOwnProperty('last_updated_at')) + obj.lastUpdatedAt = ApiClient.convertToType(data['last_updated_at'], Object); + } + return obj; + } +} + +/** + * Reference id of the IPO the application was placed against + * @member {Object} id + */ +IpoOrderData.prototype.id = undefined; + +/** + * Trading symbol of the issuer + * @member {Object} symbol + */ +IpoOrderData.prototype.symbol = undefined; + +/** + * Exchange the application was submitted to. Casing follows the exchange feed and may vary + * @member {Object} exchange + */ +IpoOrderData.prototype.exchange = undefined; + +/** + * Id of the request that created the application + * @member {Object} requestId + */ +IpoOrderData.prototype.requestId = undefined; + +/** + * Application id. Pass this as order_id to the get-order and cancel-order APIs + * @member {Object} orderId + */ +IpoOrderData.prototype.orderId = undefined; + +/** + * Lifecycle stage of the application. Known values: awaiting_mandate, ipo_allotted, ipo_not_allotted, application_deleted + * @member {Object} status + */ +IpoOrderData.prototype.status = undefined; + +/** + * Outcome of the application. Known values: success, allotted, not_allotted + * @member {Object} orderStatus + */ +IpoOrderData.prototype.orderStatus = undefined; + +/** + * State of the UPI mandate backing the application. Known values: pending, mandate_accepted + * @member {Object} paymentStatus + */ +IpoOrderData.prototype.paymentStatus = undefined; + +/** + * Investor category the application was placed under. IND (individual) and HNI can be applied for; EMP appears on employee-quota applications + * @member {Object} category + */ +IpoOrderData.prototype.category = undefined; + +/** + * Issue type of the IPO. `regular` is a mainboard issue + * @member {Object} issueType + */ +IpoOrderData.prototype.issueType = undefined; + +/** + * Free-text reason from the exchange or registrar explaining the current status + * @member {Object} reason + */ +IpoOrderData.prototype.reason = undefined; + +/** + * UPI id the mandate was raised against + * @member {Object} upi + */ +IpoOrderData.prototype.upi = undefined; + +/** + * Amount blocked in the applicant's bank account for this application, as a decimal string. Absent until the mandate is accepted + * @member {Object} upiAmountBlocked + */ +IpoOrderData.prototype.upiAmountBlocked = undefined; + +/** + * When the application was submitted to NSE, in yyyy-MM-dd'T'HH:mm:ss; null if not submitted there + * @member {Object} nseSubmittedDate + */ +IpoOrderData.prototype.nseSubmittedDate = undefined; + +/** + * When the application was submitted to BSE, in yyyy-MM-dd'T'HH:mm:ss; null if not submitted there + * @member {Object} bseSubmittedDate + */ +IpoOrderData.prototype.bseSubmittedDate = undefined; + +/** + * When the UPI mandate was approved; null until approved + * @member {Object} mandateApprovedDate + */ +IpoOrderData.prototype.mandateApprovedDate = undefined; + +/** + * When the application was rejected; null unless rejected + * @member {Object} rejectionDate + */ +IpoOrderData.prototype.rejectionDate = undefined; + +/** + * When the UPI mandate was rejected; null unless rejected + * @member {Object} mandateRejectionDate + */ +IpoOrderData.prototype.mandateRejectionDate = undefined; + +/** + * When cancellation was requested; null unless a cancellation was raised + * @member {Object} cancelRequestedDate + */ +IpoOrderData.prototype.cancelRequestedDate = undefined; + +/** + * When cancellation was accepted; null unless the cancellation completed + * @member {Object} cancelAcceptedDate + */ +IpoOrderData.prototype.cancelAcceptedDate = undefined; + +/** + * Shares allotted. 0 until allotment completes, and on applications that were not allotted + * @member {Object} unitsAllotted + */ +IpoOrderData.prototype.unitsAllotted = undefined; + +/** + * Bids placed in this application + * @member {Object} bids + */ +IpoOrderData.prototype.bids = undefined; + +/** + * When the application was created, in yyyy-MM-dd'T'HH:mm:ss + * @member {Object} createdAt + */ +IpoOrderData.prototype.createdAt = undefined; + +/** + * When the application was last updated, in yyyy-MM-dd'T'HH:mm:ss + * @member {Object} lastUpdatedAt + */ +IpoOrderData.prototype.lastUpdatedAt = undefined; + diff --git a/src/model/IpoOrderDetailResponse.js b/src/model/IpoOrderDetailResponse.js new file mode 100644 index 0000000..b617049 --- /dev/null +++ b/src/model/IpoOrderDetailResponse.js @@ -0,0 +1,60 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; +import {IpoOrderData} from './IpoOrderData'; + +/** + * The IpoOrderDetailResponse model module. + * @module model/IpoOrderDetailResponse + * @version v0 + */ +export class IpoOrderDetailResponse { + /** + * Constructs a new IpoOrderDetailResponse. + * @alias module:model/IpoOrderDetailResponse + * @class + */ + constructor() { + } + + /** + * Constructs a IpoOrderDetailResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoOrderDetailResponse} obj Optional instance to populate. + * @return {module:model/IpoOrderDetailResponse} The populated IpoOrderDetailResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoOrderDetailResponse(); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + if (data.hasOwnProperty('data')) + obj.data = IpoOrderData.constructFromObject(data['data']); + } + return obj; + } +} + +/** + * @member {Object} status + */ +IpoOrderDetailResponse.prototype.status = undefined; + +/** + * @member {module:model/IpoOrderData} data + */ +IpoOrderDetailResponse.prototype.data = undefined; + diff --git a/src/model/IpoOrderResponse.js b/src/model/IpoOrderResponse.js new file mode 100644 index 0000000..2345bdc --- /dev/null +++ b/src/model/IpoOrderResponse.js @@ -0,0 +1,67 @@ +/* + * OpenAPI definition + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: v0 + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 3.0.66 + * + * Do not edit the class manually. + * + */ +import {ApiClient} from '../ApiClient'; +import {IpoMetaData} from './IpoMetaData'; + +/** + * The IpoOrderResponse model module. + * @module model/IpoOrderResponse + * @version v0 + */ +export class IpoOrderResponse { + /** + * Constructs a new IpoOrderResponse. + * @alias module:model/IpoOrderResponse + * @class + */ + constructor() { + } + + /** + * Constructs a IpoOrderResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/IpoOrderResponse} obj Optional instance to populate. + * @return {module:model/IpoOrderResponse} The populated IpoOrderResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IpoOrderResponse(); + if (data.hasOwnProperty('status')) + obj.status = ApiClient.convertToType(data['status'], Object); + if (data.hasOwnProperty('data')) + obj.data = ApiClient.convertToType(data['data'], Object); + if (data.hasOwnProperty('meta_data')) + obj.metaData = IpoMetaData.constructFromObject(data['meta_data']); + } + return obj; + } +} + +/** + * @member {Object} status + */ +IpoOrderResponse.prototype.status = undefined; + +/** + * @member {Object} data + */ +IpoOrderResponse.prototype.data = undefined; + +/** + * @member {module:model/IpoMetaData} metaData + */ +IpoOrderResponse.prototype.metaData = undefined; + From 993ae9f3d1530786ef697dbbca27aa4a60102f1c Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:43 +0530 Subject: [PATCH 2/6] feat(api): add ipo-orders endpoints to IPOApi --- src/api/IPOApi.js | 191 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/src/api/IPOApi.js b/src/api/IPOApi.js index f54a87d..cef455d 100644 --- a/src/api/IPOApi.js +++ b/src/api/IPOApi.js @@ -14,8 +14,13 @@ */ import {ApiClient} from "../ApiClient"; import {ApiGatewayErrorResponse} from '../model/ApiGatewayErrorResponse'; +import {IpoApplyRequest} from '../model/IpoApplyRequest'; +import {IpoApplyResponse} from '../model/IpoApplyResponse'; +import {IpoCancelResponse} from '../model/IpoCancelResponse'; import {IpoDetailsResponse} from '../model/IpoDetailsResponse'; import {IpoListingResponse} from '../model/IpoListingResponse'; +import {IpoOrderDetailResponse} from '../model/IpoOrderDetailResponse'; +import {IpoOrderResponse} from '../model/IpoOrderResponse'; /** * IPO service. @@ -36,6 +41,100 @@ export class IPOApi { this.apiClient = apiClient || ApiClient.instance; } + /** + * Callback function to receive the result of the applyForIpo operation. + * @callback moduleapi/IPOApi~applyForIpoCallback + * @param {String} error Error message, if any. + * @param {module:model/IpoApplyResponse{ data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Apply for IPO + * Places an IPO application for the authenticated user. + * @param {module:model/IpoApplyRequest} body + * @param {module:api/IPOApi~applyForIpoCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} + */ + applyForIpo(body, callback) { + + let postBody = body; + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling applyForIpo"); + } + + let pathParams = { + + }; + let queryParams = { + + }; + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['OAUTH2']; + let contentTypes = ['application/json']; + let accepts = ['*/*', 'application/json']; + let returnType = IpoApplyResponse; + + return this.apiClient.callApi( + '/v2/ipos/orders', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** + * Callback function to receive the result of the cancelIpoOrder operation. + * @callback moduleapi/IPOApi~cancelIpoOrderCallback + * @param {String} error Error message, if any. + * @param {module:model/IpoCancelResponse{ data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Cancel IPO Order + * Cancels/deletes an IPO order of the authenticated user by order id. + * @param {Object} orderId IPO application id, as returned in `order_id` by the apply and orders APIs + * @param {module:api/IPOApi~cancelIpoOrderCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} + */ + cancelIpoOrder(orderId, callback) { + + let postBody = null; + // verify the required parameter 'orderId' is set + if (orderId === undefined || orderId === null) { + throw new Error("Missing the required parameter 'orderId' when calling cancelIpoOrder"); + } + + let pathParams = { + 'order_id': orderId + }; + let queryParams = { + + }; + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['OAUTH2']; + let contentTypes = []; + let accepts = ['*/*', 'application/json']; + let returnType = IpoCancelResponse; + + return this.apiClient.callApi( + '/v2/ipos/orders/{order_id}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } /** * Callback function to receive the result of the getIpoDetails operation. * @callback moduleapi/IPOApi~getIpoDetailsCallback @@ -130,5 +229,97 @@ export class IPOApi { authNames, contentTypes, accepts, returnType, callback ); } + /** + * Callback function to receive the result of the getIpoOrderById operation. + * @callback moduleapi/IPOApi~getIpoOrderByIdCallback + * @param {String} error Error message, if any. + * @param {module:model/IpoOrderDetailResponse{ data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Get IPO Order + * Fetches a single IPO order of the authenticated user by order id. + * @param {Object} orderId IPO application id, as returned in `order_id` by the apply and orders APIs + * @param {module:api/IPOApi~getIpoOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} + */ + getIpoOrderById(orderId, callback) { + + let postBody = null; + // verify the required parameter 'orderId' is set + if (orderId === undefined || orderId === null) { + throw new Error("Missing the required parameter 'orderId' when calling getIpoOrderById"); + } + + let pathParams = { + 'order_id': orderId + }; + let queryParams = { + + }; + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['OAUTH2']; + let contentTypes = []; + let accepts = ['*/*', 'application/json']; + let returnType = IpoOrderDetailResponse; + + return this.apiClient.callApi( + '/v2/ipos/orders/{order_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** + * Callback function to receive the result of the getIpoOrders operation. + * @callback moduleapi/IPOApi~getIpoOrdersCallback + * @param {String} error Error message, if any. + * @param {module:model/IpoOrderResponse{ data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Get IPO Orders + * Fetches the authenticated user's IPO orders/applications. + * @param {Object} opts Optional parameters + * @param {Object} opts.pageNumber Page number, starting at 1 + * @param {Object} opts.records Number of records per page + * @param {module:api/IPOApi~getIpoOrdersCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} + */ + getIpoOrders(opts, callback) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + + }; + let queryParams = { + 'page_number': opts['pageNumber'],'records': opts['records'] + }; + let headerParams = { + + }; + let formParams = { + + }; + + let authNames = ['OAUTH2']; + let contentTypes = []; + let accepts = ['*/*', 'application/json']; + let returnType = IpoOrderResponse; + + return this.apiClient.callApi( + '/v2/ipos/orders', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } } \ No newline at end of file From 1935341f9d6e71bbe63772b7b9c6b2aaf9507983 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:43 +0530 Subject: [PATCH 3/6] chore(exports): update src/index.js exports for ipo-orders --- src/index.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/index.js b/src/index.js index 5ce7cb4..58832a2 100644 --- a/src/index.js +++ b/src/index.js @@ -165,6 +165,17 @@ import {IpoDetailsData} from './model/IpoDetailsData'; import {IpoDetailsResponse} from './model/IpoDetailsResponse'; import {IpoRegistrarInfo} from './model/IpoRegistrarInfo'; import {IpoTimeline} from './model/IpoTimeline'; +import {IpoInvestorType} from './model/IpoInvestorType'; +import {IpoApplyRequest} from './model/IpoApplyRequest'; +import {IpoBidRequest} from './model/IpoBidRequest'; +import {IpoApplyData} from './model/IpoApplyData'; +import {IpoApplyResponse} from './model/IpoApplyResponse'; +import {IpoOrderBid} from './model/IpoOrderBid'; +import {IpoOrderData} from './model/IpoOrderData'; +import {IpoOrderResponse} from './model/IpoOrderResponse'; +import {IpoOrderDetailResponse} from './model/IpoOrderDetailResponse'; +import {IpoCancelData} from './model/IpoCancelData'; +import {IpoCancelResponse} from './model/IpoCancelResponse'; import {InitiatePayoutRequest} from './model/InitiatePayoutRequest'; import {ModifyPayoutRequest} from './model/ModifyPayoutRequest'; import {PayoutDetails} from './model/PayoutDetails'; @@ -1188,6 +1199,72 @@ export { */ IpoTimeline, + /** + * The IpoInvestorType model constructor. + * @property {module:model/IpoInvestorType} + */ + IpoInvestorType, + + /** + * The IpoApplyRequest model constructor. + * @property {module:model/IpoApplyRequest} + */ + IpoApplyRequest, + + /** + * The IpoBidRequest model constructor. + * @property {module:model/IpoBidRequest} + */ + IpoBidRequest, + + /** + * The IpoApplyData model constructor. + * @property {module:model/IpoApplyData} + */ + IpoApplyData, + + /** + * The IpoApplyResponse model constructor. + * @property {module:model/IpoApplyResponse} + */ + IpoApplyResponse, + + /** + * The IpoOrderBid model constructor. + * @property {module:model/IpoOrderBid} + */ + IpoOrderBid, + + /** + * The IpoOrderData model constructor. + * @property {module:model/IpoOrderData} + */ + IpoOrderData, + + /** + * The IpoOrderResponse model constructor. + * @property {module:model/IpoOrderResponse} + */ + IpoOrderResponse, + + /** + * The IpoOrderDetailResponse model constructor. + * @property {module:model/IpoOrderDetailResponse} + */ + IpoOrderDetailResponse, + + /** + * The IpoCancelData model constructor. + * @property {module:model/IpoCancelData} + */ + IpoCancelData, + + /** + * The IpoCancelResponse model constructor. + * @property {module:model/IpoCancelResponse} + */ + IpoCancelResponse, + /** * The InitiatePayoutRequest model constructor. * @property {module:model/InitiatePayoutRequest} From 7acaafa42777dd5c9b4e9ec2ab2f90c17db7e757 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:43 +0530 Subject: [PATCH 4/6] test(ipo-orders): add SDK tests for new feature --- test/sdk/IpoApiTest.js | 116 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/test/sdk/IpoApiTest.js b/test/sdk/IpoApiTest.js index 59a657b..3266f08 100644 --- a/test/sdk/IpoApiTest.js +++ b/test/sdk/IpoApiTest.js @@ -30,6 +30,56 @@ apiInstance.getIpoDetails("example-ipo-slug", (error, data, response) => { } }); +// Apply for an IPO +let ipoApplyRequest = new UpstoxClient.IpoApplyRequest(); +ipoApplyRequest.id = "example-ipo-slug"; +ipoApplyRequest.upi = "example@upi"; +ipoApplyRequest.category = "IND"; +ipoApplyRequest.bids = [{ quantity: 100, price: 250 }]; + +apiInstance.applyForIpo(ipoApplyRequest, (error, data, response) => { + if (error) { + console.error("error in applyForIpo: " + error.response.text); + } else { + if (data.status != "success") { + console.log("error in applyForIpo"); + } + } +}); + +// Get the authenticated user's IPO orders +apiInstance.getIpoOrders({ pageNumber: 1, records: 20 }, (error, data, response) => { + if (error) { + console.error("error in getIpoOrders: " + error.response.text); + } else { + if (data.status != "success") { + console.log("error in getIpoOrders"); + } + } +}); + +// Get a single IPO order by order id +apiInstance.getIpoOrderById("example-order-id", (error, data, response) => { + if (error) { + console.error("error in getIpoOrderById: " + error.response.text); + } else { + if (data.status != "success") { + console.log("error in getIpoOrderById"); + } + } +}); + +// Cancel an IPO order by order id +apiInstance.cancelIpoOrder("example-order-id", (error, data, response) => { + if (error) { + console.error("error in cancelIpoOrder: " + error.response.text); + } else { + if (data.status != "success") { + console.log("error in cancelIpoOrder"); + } + } +}); + // Verify model instantiation let ipoListingData = new UpstoxClient.IpoListingData(); let ipoMetaData = new UpstoxClient.IpoMetaData(); @@ -41,3 +91,69 @@ let ipoTimeline = new UpstoxClient.IpoTimeline(); let ipoDetailsData = new UpstoxClient.IpoDetailsData(); let ipoDetailsResponse = new UpstoxClient.IpoDetailsResponse(); ipoDetailsResponse.status = "success"; + +// Verify the investors field is parsed on the listing and details data models +let listingWithInvestors = UpstoxClient.IpoListingData.constructFromObject({ + id: "example-ipo-slug", + investors: [{ category: "IND", description: "Individual" }] +}); +if (!listingWithInvestors.investors || listingWithInvestors.investors.length != 1) { + console.log("error parsing investors on IpoListingData"); +} + +let detailsWithInvestors = UpstoxClient.IpoDetailsData.constructFromObject({ + id: "example-ipo-slug", + investors: [{ category: "IND", description: "Individual" }, { category: "HNI", description: "HNI" }] +}); +if (!detailsWithInvestors.investors || detailsWithInvestors.investors.length != 2) { + console.log("error parsing investors on IpoDetailsData"); +} + +// Verify instantiation of the IPO order models +let ipoInvestorType = new UpstoxClient.IpoInvestorType(); +ipoInvestorType.category = "IND"; + +let ipoBidRequest = new UpstoxClient.IpoBidRequest(); +ipoBidRequest.quantity = 100; +ipoBidRequest.price = 250; + +let ipoApplyData = new UpstoxClient.IpoApplyData(); +let ipoApplyResponse = new UpstoxClient.IpoApplyResponse(); +ipoApplyResponse.status = "success"; + +let ipoOrderBid = new UpstoxClient.IpoOrderBid(); +let ipoOrderData = new UpstoxClient.IpoOrderData(); +let ipoOrderResponse = new UpstoxClient.IpoOrderResponse(); +ipoOrderResponse.status = "success"; + +let ipoOrderDetailResponse = new UpstoxClient.IpoOrderDetailResponse(); +ipoOrderDetailResponse.status = "success"; + +let ipoCancelData = new UpstoxClient.IpoCancelData(); +let ipoCancelResponse = new UpstoxClient.IpoCancelResponse(); +ipoCancelResponse.status = "success"; + +// Verify the apply/order response models map snake_case payloads onto camelCase members +let applyResponse = UpstoxClient.IpoApplyResponse.constructFromObject({ + status: "success", + data: { order_id: "example-order-id" } +}); +if (applyResponse.data.orderId != "example-order-id") { + console.log("error parsing order_id on IpoApplyResponse"); +} + +let orderDetailResponse = UpstoxClient.IpoOrderDetailResponse.constructFromObject({ + status: "success", + data: { order_id: "example-order-id", units_allotted: 100, issue_type: "regular" } +}); +if (orderDetailResponse.data.orderId != "example-order-id" || orderDetailResponse.data.unitsAllotted != 100) { + console.log("error parsing data on IpoOrderDetailResponse"); +} + +let cancelResponse = UpstoxClient.IpoCancelResponse.constructFromObject({ + status: "success", + data: { order_id: "example-order-id", status: "cancelled" } +}); +if (cancelResponse.data.orderId != "example-order-id") { + console.log("error parsing order_id on IpoCancelResponse"); +} From a537613612a365d9035380be9c9c54599c24a04d Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:43 +0530 Subject: [PATCH 5/6] docs(ipo-orders): add usage examples for new feature --- examples/README.md | 2 +- examples/ipos/README.md | 7 ++++ examples/ipos/code/apply_for_ipo.md | 40 +++++++++++++++++++++++ examples/ipos/code/cancel_ipo_order.md | 21 ++++++++++++ examples/ipos/code/get_ipo_order_by_id.md | 21 ++++++++++++ examples/ipos/code/get_ipo_orders.md | 23 +++++++++++++ 6 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 examples/ipos/code/apply_for_ipo.md create mode 100644 examples/ipos/code/cancel_ipo_order.md create mode 100644 examples/ipos/code/get_ipo_order_by_id.md create mode 100644 examples/ipos/code/get_ipo_orders.md diff --git a/examples/README.md b/examples/README.md index f327044..62fecbc 100644 --- a/examples/README.md +++ b/examples/README.md @@ -34,7 +34,7 @@ Samples are grouped by API area. Each `.md` file contains one or more Node.js sn | [**option-chain/**](option-chain/) | Option contracts, put-call option chain. | | [**expired-instruments/**](expired-instruments/) | Expiries, expired future/option contracts, expired historical candle data. | | [**market-information/**](market-information/) | Exchange status, market timings, market holidays, OI, change in OI, PCR, max pain, FII, DII, and smartlist (futures, MTF, options). | -| [**ipos/**](ipos/) | IPO listing (by status) and IPO details (by slug id). | +| [**ipos/**](ipos/) | IPO listing (by status), IPO details (by slug id), and IPO orders: apply, order book, order details, cancel. | | [**gtt-orders/**](gtt-orders/) | Place, modify, cancel, and get details for GTT (Good Till Triggered) orders. | | [**margins/**](margins/) | Margin details. | | [**charges/**](charges/) | Brokerage details. | diff --git a/examples/ipos/README.md b/examples/ipos/README.md index 3713214..63a2977 100644 --- a/examples/ipos/README.md +++ b/examples/ipos/README.md @@ -7,3 +7,10 @@ ## 2. IPO Details - 2.1 [Get IPO details](code/get_ipo_details.md#get-ipo-details) + +## 3. IPO Orders + +- 3.1 [Apply for an IPO](code/apply_for_ipo.md#apply-for-an-ipo) +- 3.2 [Get IPO orders](code/get_ipo_orders.md#get-ipo-orders) +- 3.3 [Get IPO order details](code/get_ipo_order_by_id.md#get-ipo-order-details) +- 3.4 [Cancel IPO order](code/cancel_ipo_order.md#cancel-ipo-order) diff --git a/examples/ipos/code/apply_for_ipo.md b/examples/ipos/code/apply_for_ipo.md new file mode 100644 index 0000000..b3671a8 --- /dev/null +++ b/examples/ipos/code/apply_for_ipo.md @@ -0,0 +1,40 @@ +## Apply for an IPO + +```javascript +let UpstoxClient = require('upstox-js-sdk'); +let defaultClient = UpstoxClient.ApiClient.instance; +var OAUTH2 = defaultClient.authentications['OAUTH2']; +OAUTH2.accessToken = "{your_access_token}"; + +let apiInstance = new UpstoxClient.IPOApi(); + +let body = new UpstoxClient.IpoApplyRequest(); + +// id is the IPO slug id returned in the listing and details responses +body.id = "{ipo_slug_id}"; + +// UPI id used to block the application amount +body.upi = "{your_upi_id}"; + +// category: IND (individual) | HNI +// Must be a category the issue accepts — see investors[].category in the IPO details response +body.category = "IND"; + +// 1 to 3 bids. quantity must be a multiple of the IPO's lot_size and at +// least its minimum_quantity. price must sit inside the IPO's price band, +// or equal its cut_off_price, and must be in whole rupees. +let bid = new UpstoxClient.IpoBidRequest(); +bid.quantity = 100; +bid.price = 250; +body.bids = [bid]; + +apiInstance.applyForIpo(body, (error, data, response) => { + if (error) { + console.error(error); + } else { + // data.data.orderId is the application id — pass it as orderId to the + // get-order and cancel-order APIs + console.log('API called successfully. Returned data: ' + JSON.stringify(data)); + } +}); +``` diff --git a/examples/ipos/code/cancel_ipo_order.md b/examples/ipos/code/cancel_ipo_order.md new file mode 100644 index 0000000..8941dbd --- /dev/null +++ b/examples/ipos/code/cancel_ipo_order.md @@ -0,0 +1,21 @@ +## Cancel IPO order + +```javascript +let UpstoxClient = require('upstox-js-sdk'); +let defaultClient = UpstoxClient.ApiClient.instance; +var OAUTH2 = defaultClient.authentications['OAUTH2']; +OAUTH2.accessToken = "{your_access_token}"; + +let apiInstance = new UpstoxClient.IPOApi(); + +// orderId is the IPO application id returned as order_id by the apply and orders APIs +let orderId = "{ipo_order_id}"; + +apiInstance.cancelIpoOrder(orderId, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + JSON.stringify(data)); + } +}); +``` diff --git a/examples/ipos/code/get_ipo_order_by_id.md b/examples/ipos/code/get_ipo_order_by_id.md new file mode 100644 index 0000000..fa5f789 --- /dev/null +++ b/examples/ipos/code/get_ipo_order_by_id.md @@ -0,0 +1,21 @@ +## Get IPO order details + +```javascript +let UpstoxClient = require('upstox-js-sdk'); +let defaultClient = UpstoxClient.ApiClient.instance; +var OAUTH2 = defaultClient.authentications['OAUTH2']; +OAUTH2.accessToken = "{your_access_token}"; + +let apiInstance = new UpstoxClient.IPOApi(); + +// orderId is the IPO application id returned as order_id by the apply and orders APIs +let orderId = "{ipo_order_id}"; + +apiInstance.getIpoOrderById(orderId, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + JSON.stringify(data)); + } +}); +``` diff --git a/examples/ipos/code/get_ipo_orders.md b/examples/ipos/code/get_ipo_orders.md new file mode 100644 index 0000000..8434dd1 --- /dev/null +++ b/examples/ipos/code/get_ipo_orders.md @@ -0,0 +1,23 @@ +## Get IPO orders + +```javascript +let UpstoxClient = require('upstox-js-sdk'); +let defaultClient = UpstoxClient.ApiClient.instance; +var OAUTH2 = defaultClient.authentications['OAUTH2']; +OAUTH2.accessToken = "{your_access_token}"; + +let apiInstance = new UpstoxClient.IPOApi(); + +let opts = { + pageNumber: 1, + records: 20 +}; + +apiInstance.getIpoOrders(opts, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + JSON.stringify(data)); + } +}); +``` From 3e5dd70ee56adb035bfc852caaa3930b788d6997 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Mon, 17 Aug 2026 19:11:43 +0530 Subject: [PATCH 6/6] chore(release): bump version to 2.30.0 --- package.json | 2 +- src/ApiClient.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f7fff9b..fedb4b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "upstox-js-sdk", - "version": "2.29.0", + "version": "2.30.0", "description": "The official Node Js client for communicating with the Upstox API", "license": "MIT", "main": "dist/index.js", diff --git a/src/ApiClient.js b/src/ApiClient.js index 1bbf29b..bf3d5c7 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -68,7 +68,7 @@ export class ApiClient { */ this.defaultHeaders = { 'X-Upstox-SDK-Language': 'nodejs', - 'X-Upstox-SDK-Version': '2.29.0' + 'X-Upstox-SDK-Version': '2.30.0' }; /**