Get Borrowing and Repayment Orders

Queries borrowing, principal-repayment and interest-repayment orders. Includes independent split-repayment records and historical borrowing.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Returns paginated MarginX borrowing, principal-repayment and interest-repayment orders. Use requestId to retrieve one order, or clientOrderId to retrieve the records associated with a customer request.

Rate limit: 10 requests per minute per API key.

API key access

Requires a signed LTP Open API request with READ permission. See Authentication.

API key typeCan callScope
Main User Level API key (also the Main Portfolio key)YesBorrowing and repayment orders belonging to the main user.
Sub-user Level API keyNoNot supported.
Dedicated Sub Portfolio Level API keyNoNot supported.
Exchange-native API keyNoUse an LTP Main User Level API key.

Query parameters

All query parameters are optional. Supplied filters are combined with AND.

NameTypeDefaultDescription
pageinteger1One-based page number. Zero, negative or empty values use 1.
pageSizeinteger20Records per page, maximum 1000. Zero, negative or empty values use 20; values above 1000 are rejected.
clientOrderIdstringNo filterExact customer-supplied request identifier. If supplied, exactly 18 ASCII letters or digits; case is preserved. Empty values are invalid.
requestIdstringNo filterExact system order identifier. Preserve it as a string. Empty values are invalid.
groupIdstringNo filterExact margin group ID, expressed as a positive integer string. Omit for orders across your groups. Empty values and group names are invalid.
orderTypestringAll typesBORROW, REPAY_PRINCIPAL or REPAY_INTEREST. Input is case-insensitive; empty values are invalid.
sortBystringcreatedAtcreatedAt, amount or status. Empty uses createdAt.
sortDirectionstringDESCASC or DESC. Input is case-insensitive. Empty uses DESC.

There is no currency filter. Amounts are quantities in each order's currency, not converted valuations.

Pagination and filtering

  • Non-integer or out-of-range integer pagination values return 1002. An integer pageSize above 1000 returns 100400; it is not silently capped.
  • Sorting applies before pagination. Status sorting follows NEW, PROCESSING, SUCCESS, FAIL, rather than alphabetical order.
  • A page beyond the end returns list: [] and retains the matching totalSize. There is no pageNum field.
  • No matching orders returns a successful empty list. An explicitly requested unavailable or deleted group returns an error; an unfiltered query can still include that group's historical orders.

Understanding borrowing and repayment orders

orderTypefromto
BORROW{"ltpAccountType":"LTP Lending Service"} for both floating and fixed-term borrowing.The customer-selected account receiving the funds and taking on the debt.
REPAY_PRINCIPALThe customer-selected account actually providing repayment funds.The member whose principal debt is reduced.
REPAY_INTERESTThe customer-selected account actually providing repayment funds.The member whose interest debt is reduced.

For repayments, to identifies whose debt is reduced, not the destination receiving repayment funds. The funding account and debt-carrying member can be different. memberId always equals to.id.

When a repayment covers both principal and interest, the list contains two independent records. They share the customer's clientOrderId when one was supplied, and each has a distinct requestId, its own amount and execution status. The records can share one transferId for a single transfer covering the total repayment; do not count that transfer twice. Querying by clientOrderId can therefore return more than one record; querying by requestId identifies one record. totalSize counts individual records, not customer requests. There is no separate orderId or nested items array.

Response fields

FieldTypeDescription
codeinteger200 means success; any other value indicates an error.
messagestringResult message.
data.pageintegerPage number used.
data.pageSizeintegerPage size used.
data.totalSizeintegerTotal matching individual order records.
data.listarray of objectsOrders on this page.

Order record: data.list[]

IDs and amounts are strings. Timestamps are Unix milliseconds.

FieldTypeDescription
clientOrderIdstring or nullCustomer-supplied request identifier. null if not supplied or not saved in a historical record.
requestIdstringSystem identifier for this individual order record.
groupIdstringMargin group ID.
groupNamestringMargin group name.
orderTypestringBORROW, REPAY_PRINCIPAL or REPAY_INTEREST.
statusstringExecution status; see below.
capitalCallStatusstring or nullCapital-call approval and transfer status; see below. null when not applicable.
currencystringCurrency of the order amount.
currencyDetailsobject or nullCurrency metadata; see below.
amountstringBorrowed, principal-repayment or interest-repayment quantity for this record. For a split repayment, each record contains only its own portion. Whether execution succeeded is determined by status.
fromobjectBorrowing service endpoint or actual repayment funding account, as described above.
toobjectBorrowing recipient or member whose debt is reduced, as described above.
memberIdstringDebt-carrying member ID; always to.id. A DMA account ID or RapidX Portfolio ID.
debtIdstring or nullAssociated debt ID for a successful borrowing order, when available. Historical floating-only borrowing predates this ID and may return null even after success. Repayment orders and unsuccessful or processing borrowing orders return null.
interestRateTypestring or nullFLOATING or FIXED when available. Repayment orders and historical borrowing without rate-type metadata may return null.
termDaysinteger or nullFixed-term duration in days when applicable and available; otherwise null.
maturityDateinteger or nullFixed-term maturity time in Unix milliseconds when applicable and available; otherwise null.
createdAtintegerOrder creation time in Unix milliseconds.
updatedAtintegerLast update time in Unix milliseconds.
transferIdstring or nullAssociated transfer ID, if one has been generated.

To obtain repayable debt IDs and current outstanding amounts, use Get Outstanding Debts.

Execution and capital-call statuses

statusMeaning
NEWOrder created; execution has not started.
PROCESSINGExecution is in progress.
SUCCESSExecution succeeded.
FAILExecution failed.
capitalCallStatusMeaning
nullNo capital-call approval applies, including floating borrowing.
PENDING_APPROVALAwaiting capital-call approval.
APPROVED_PENDING_TRANSFERApproved; transfer has not been initiated.
TRANSFER_INITIATEDTransfer has been initiated; this does not itself mean execution succeeded.
REJECTEDCapital-call approval was rejected.

Capital-call status and order execution status are separate. Check status for the execution outcome.

from and to account fields

The borrowing service endpoint contains only ltpAccountType: "LTP Lending Service". Customer accounts use the following fields:

FieldTypeDescription
ltpAccountTypestringTRADING.
primeTypestringdma or rapidx.
idstringDMA account ID or RapidX Portfolio ID.
venuestringExchange; for RapidX, its specific Portfolio venue.
accountTypestring or nullDMA wallet type or RapidX exchange. A repayment's debt-carrying DMA member may have null because no specific destination wallet is identified.

See Account Types for current enums. Historical orders can retain older values such as Spot, Trading, Margin-PM, USDT-M, Unified Account or Funding.

currencyDetails

FieldTypeDescription
idintegerCurrency identifier.
iconUrlstringCurrency icon URL.
currencyNamestringCurrency display name.
slugstringCurrency slug.
referenceAssetIdinteger or nullReference asset identifier.
multipliernumber or nullConversion multiplier to the reference asset.

The response panel includes borrowing, split-repayment, historical and empty-list examples.

Error codes

Errors can return HTTP 200 with a non-success JSON code. Check both HTTP status and JSON code. See Error Codes for shared errors.

CodeWhen it occursWhat to do
1002A pagination value cannot be converted to a supported integer.Send integer values; the message identifies the affected field.
100400Invalid filter, empty required filter value, invalid sorting parameter, or pageSize above 1000.Use the supported values. Omit optional filters instead of sending empty strings.
-1An explicitly requested group is unavailable. Observed message: Group unavailable.Check the group ID and whether it remains available.
2000Signature verification fails.Check the signature and authentication headers.
2003The calling API key level is not allowed.Use a Main User Level API key.
2004The key lacks a required permission.Use a key with READ permission.
100429Rate limit exceeded.Reduce the request rate.
Query Params
integer
Defaults to 1

One-based page number; non-positive or empty values use 1. Invalid integer format or range returns 1002.

integer
≤ 1000
Defaults to 20

Records per page; non-positive or empty values use 20. More than 1000 returns 100400.

string
enum
Defaults to createdAt

Sort field. Status order is NEW, PROCESSING, SUCCESS, FAIL. Empty uses createdAt.

Allowed:
string
enum
Defaults to DESC

Sort direction. Input is case-insensitive. Empty uses DESC.

Allowed:
string

Exact group ID. Omit for all groups; empty, whitespace and group names are invalid.

string
length between 18 and 18
^[A-Za-z0-9]{18}$

Exact customer request identifier; exactly 18 ASCII letters or digits when supplied. Empty is invalid.

string

Exact system order identifier, kept as a string. Empty is invalid.

string

BORROW, REPAY_PRINCIPAL or REPAY_INTEREST. Input is case-insensitive. Empty is invalid.

Headers
string
required

Current Unix timestamp in seconds, also used in the signature.

string
required

HMAC-SHA256 hex signature; see Authentication.

string
required

Current Unix timestamp in microseconds.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json