Learn how to place your first bond order by getting bond quote data, running preflight checks, placing the order, and verifying execution.
First, retrieve your account ID using the accounts endpoint:
curl --request GET \
--url https://api.public.com/userapigateway/trading/account \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'This returns your available accounts with their IDs:
{
"accounts": [
{
"accountId": "YOUR_ACCOUNT_ID",
"accountType": "BOND_ACCOUNT",
"optionsLevel": "NONE",
"brokerageAccountType": "CASH",
"tradePermissions": "BUY_AND_SELL"
}
]
}Get the current quote for the bond you want to buy using its CUSIP (e.g., a US Treasury bond):
curl --request POST \
--url https://api.public.com/userapigateway/marketdata/{YOUR_ACCOUNT_ID}/quotes \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"instruments": [
{
"symbol": "912810TM0",
"type": "BOND"
}
]
}'This returns current bid/ask prices, yield, and last trade information:
{
"quotes": [
{
"instrument": {
"symbol": "912810TM0",
"type": "BOND"
},
"outcome": "SUCCESS",
"last": "0.90949219",
"lastTimestamp": "2026-04-22T16:09:16.169739Z",
"bid": "0.905796875",
"bidSize": 4000000,
"bidTimestamp": null,
"ask": "0.913109375",
"askSize": 4000000,
"askTimestamp": null,
"volume": null,
"openInterest": null,
"previousClose": null,
"oneDayChange": null,
"optionDetails": null
}
]
}Before placing an order, run a preflight check to estimate costs and validate the order:
curl --request POST \
--url https://api.public.com/userapigateway/trading/{YOUR_ACCOUNT_ID}/preflight/single-leg \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"instrument": {
"symbol": "912810TM0",
"type": "BOND"
},
"orderSide": "BUY",
"orderType": "LIMIT",
"limitPrice": "0.90",
"expiration": {
"timeInForce": "DAY"
},
"quantity": "1000",
"openCloseIndicator": "OPEN",
"validateOrder": true
}'The response provides estimated costs, accrued interest, and order details:
{
"instrument": {
"symbol": "912810TM0",
"type": "BOND"
},
"cusip": "912810TM0",
"rootSymbol": "UST-BOND",
"rootOptionSymbol": null,
"estimatedCommission": "1.00",
"regulatoryFees": {
"secFee": "0.00",
"tafFee": "0.00",
"orfFee": "0.00",
"exchangeFee": null,
"occFee": null,
"catFee": null
},
"estimatedIndexOptionFee": null,
"estimatedExecutionFee": null,
"orderValue": "900.00",
"estimatedQuantity": "1000",
"estimatedCost": "918.57",
"buyingPowerRequirement": "918.57",
"estimatedProceeds": null,
"optionDetails": null,
"estimatedOrderRebate": null,
"marginRequirement": {
"longMaintenanceRequirement": "0.0600",
"longInitialRequirement": "0.0600"
},
"marginImpact": {
"marginUsageImpact": "918.57",
"initialMarginRequirement": "55.11"
},
"shortSelling": null,
"priceIncrement": null
}Now place the actual order. Generate a unique UUID for the orderId:
curl --request POST \
--url https://api.public.com/userapigateway/trading/{YOUR_ACCOUNT_ID}/order \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"orderId": "eb11cba2-751b-4a9e-8cb0-82b421f02909",
"instrument": {
"symbol": "912810TM0",
"type": "BOND"
},
"orderSide": "BUY",
"orderType": "LIMIT",
"limitPrice": "0.90",
"expiration": {
"timeInForce": "DAY"
},
"quantity": "1000",
"openCloseIndicator": "OPEN"
}'The response confirms the order was submitted:
{
"orderId": "eb11cba2-751b-4a9e-8cb0-82b421f02909"
}Monitor your order status to see if it has been filled:
curl --request GET \
--url https://api.public.com/userapigateway/trading/{YOUR_ACCOUNT_ID}/order/eb11cba2-751b-4a9e-8cb0-82b421f02909 \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'The response shows the current order status:
{
"orderId": "eb11cba2-751b-4a9e-8cb0-82b421f02909",
"instrument": {
"symbol": "912810TM0",
"type": "BOND"
},
"createdAt": "2026-04-22T16:22:30.292084Z",
"type": "LIMIT",
"side": "BUY",
"status": "FILLED",
"quantity": "1000",
"notionalValue": null,
"expiration": {
"timeInForce": "DAY",
"expirationTime": null
},
"limitPrice": "0.90",
"stopPrice": null,
"closedAt": "2026-04-22T16:22:45.118204Z",
"openCloseIndicator": "OPEN",
"filledQuantity": "1000",
"averagePrice": "0.9085",
"legs": null,
"rejectReason": null
}Finally, check your portfolio to confirm the new bond position:
curl --request GET \
--url https://api.public.com/userapigateway/trading/{YOUR_ACCOUNT_ID}/portfolio/v2 \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'You should now see your new bond position in the portfolio:
{
"accountId": "YOUR_ACCOUNT_ID",
"accountType": "BOND_ACCOUNT",
"buyingPower": {
"cashOnlyBuyingPower": "4084.27",
"buyingPower": "4084.27",
"optionsBuyingPower": "0.00"
},
"positions": [
{
"instrument": {
"symbol": "912810TM0",
"name": "US TREASURY N/B 4.125% 08/15/2053",
"type": "BOND",
"couponRate": "4.125",
"maturityDate": "2053-08-15"
},
"quantity": "1000",
"currentValue": "909.49",
"percentOfPortfolio": "18.21",
"costBasis": {
"totalCost": "908.50",
"unitCost": "0.9085",
"gainValue": "0.99",
"gainPercentage": "0.11"
}
}
]
}📝 Important Notes