API ReferenceMargin & Lending

Borrow

POST/api/v1/px/borrowBearer

PX Discovery & AccountE6 decimal strings throughoutA | B

Adds to your debt, which accrues interest continuously, and credits cash. Synchronous — success returns the updated credit state directly; there is no 202 and no cursor.

Failure is a 400 with {code, message}, not the shared error body {error, message, recoverable}. code is one of INVALID_AMOUNT / EXCEEDS_MAX_BORROW. A jurisdiction block is rejected here too.

Send Authorization: Bearer <token>. The token is issued by POST /api/v1/auth/verify, and expires after 24h idle or 7d after issuance.

Request body

  • amountE6stringrequired

    Amount, as an E6 string; must be positive

Response

200Borrowed; returns the updated credit state
  • debtE6string

    Debt including accrued interest, as an E6 string

  • equityE6string

    Account equity, as an E6 string

  • grossE6string

    Gross exposure, as an E6 string

  • healthBpsstringnullable

    Health, in basis points. null when there is no debt (health is undefined then) — do not treat it as 0

  • healthyboolean

    Whether the account is above the maintenance line; true when there is no debt

    Examplefalse

  • borrowAprBpsstring

    Borrow APR, in basis points

  • maxBorrowE6string

    Current borrowing limit, as an E6 string

  • lendDepositE6string

    Principal currently lent out, as an E6 string

  • maintenanceBpsstring

    Maintenance margin rate, in basis points; liquidation triggers when healthBps falls below it

  • initialMarginBpsstring

    Initial margin rate, in basis points

Switch status codes in the response example to view errors. For all codes, see the Errors page.