from finance_dev import FinanceDev, models
from finance_dev.utils import parse_datetime
with FinanceDev(
security=models.Security(
client_id="<YOUR_CLIENT_ID_HERE>",
client_secret="<YOUR_CLIENT_SECRET_HERE>",
),
) as fd_client:
res = fd_client.orders.list_order_history(id="TEST-ACCOUNT-001", from_=parse_datetime("2026-01-01T00:00:00Z"), to=parse_datetime("2026-01-31T00:00:00Z"), order_by=models.OrderBy.DESC, exclude_today=False, limit=50, cursor=0)
while res is not None:
# Handle items
res = res.next()
import { FinanceDev } from "@ariesdotcom/finance-dev";
const financeDev = new FinanceDev({
security: {
clientID: "<YOUR_CLIENT_ID_HERE>",
clientSecret: "<YOUR_CLIENT_SECRET_HERE>",
},
});
async function run() {
const result = await financeDev.orders.getHistory({
id: "TEST-ACCOUNT-001",
from: new Date("2026-01-01T00:00:00Z"),
to: new Date("2026-01-31T00:00:00Z"),
});
for await (const page of result) {
console.log(page);
}
}
run();
Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint.
Use Case: Fill gaps before today’s session or export fills for reporting without walking the live cache cursor.
GET
/
v2
/
accounts
/
{id}
/
orders
/
history
Python (SDK)
from finance_dev import FinanceDev, models
from finance_dev.utils import parse_datetime
with FinanceDev(
security=models.Security(
client_id="<YOUR_CLIENT_ID_HERE>",
client_secret="<YOUR_CLIENT_SECRET_HERE>",
),
) as fd_client:
res = fd_client.orders.list_order_history(id="TEST-ACCOUNT-001", from_=parse_datetime("2026-01-01T00:00:00Z"), to=parse_datetime("2026-01-31T00:00:00Z"), order_by=models.OrderBy.DESC, exclude_today=False, limit=50, cursor=0)
while res is not None:
# Handle items
res = res.next()
import { FinanceDev } from "@ariesdotcom/finance-dev";
const financeDev = new FinanceDev({
security: {
clientID: "<YOUR_CLIENT_ID_HERE>",
clientSecret: "<YOUR_CLIENT_SECRET_HERE>",
},
});
async function run() {
const result = await financeDev.orders.getHistory({
id: "TEST-ACCOUNT-001",
from: new Date("2026-01-01T00:00:00Z"),
to: new Date("2026-01-31T00:00:00Z"),
});
for await (const page of result) {
console.log(page);
}
}
run();
You must pass from (RFC 3339 with timezone). If you omit to, the service uses the current time truncated to the minute (UTC) and caps the span at 90 days from from.
Use the same cursor / nextCursor contract as List active orders (v2): start with cursor=0, then pass the last nextCursor until it returns 0. Sorting is by order_created_at; set order_by to asc or desc (default desc).
Same contract as List active orders (v2): orders (never null) and nextCursor are always present. Each order uses the v2 domain shape with the same required core fields (clOrdId, accountId, symbol, decimal quantity/price strings, timestamps). History excludes SUPERSEDED status and rows with failed_flag = true server-side.
Opaque pagination cursor for the database history walk. Send 0 (or omit) for the first page; pass the previous nextCursor until it is absent.
Response
Page of historical orders
Paginated v2 orders response from GET /v2/accounts/{id}/orders and GET /v2/accounts/{id}/orders/history. orders is always present; nextCursor is present only when another page exists.
Page of orders in v2 domain shape (TradeOrderV2). null from GET /v2/accounts/{id}/orders when the account has no active orders; an empty array from the history endpoint when there are no matches.
Opaque pagination cursor. Pass as cursor on the next request. This field is omitted on the final page.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Aries API","colors":{"primary":"#0BAA5E","light":"#0BAA5E","dark":"#098F4E"},"logo":{"light":"https://mintcdn.com/ariesfinancialinc/RAN-JEltzDnib-_A/logo/light.svg?fit=max\u0026auto=format\u0026n=RAN-JEltzDnib-_A\u0026q=85\u0026s=4eae127cdf55bb09159d2b5a625690e3","dark":"https://mintcdn.com/ariesfinancialinc/RAN-JEltzDnib-_A/logo/dark.svg?fit=max\u0026auto=format\u0026n=RAN-JEltzDnib-_A\u0026q=85\u0026s=fbee595bbc78c2506c5e92673b91d2c7"},"favicon":"https://mintcdn.com/ariesfinancialinc/RAN-JEltzDnib-_A/favicon.svg?fit=max\u0026auto=format\u0026n=RAN-JEltzDnib-_A\u0026q=85\u0026s=0c47f5ea65b933ab26eae6eaca2fc12c","api":{"openapi":["openapi.json"],"playground":{"display":"interactive"}},"navbar":{"links":[{"href":"mailto:support@aries.com","label":"Support"}],"primary":{"type":"button","label":"Aries","href":"https://aries.com"}},"contextual":{"options":["chatgpt","claude","view"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ariesfinancialinc","hasAudioNarration":false,"actualSubdomain":"ariesfinancialinc","customDomains":["finance.dev"],"gitSource":{"type":"github","owner":"aries-financial-inc","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aeab772bd6bd4d02bb4d556","collectionId":"5f3965ef-2edc-49ee-be66-8e32e0157ac3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aeab772bd6bd4d02bb4d556"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aeab772bd6bd4d02bb4d556","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"Supplemental API","count":116},{"language":"default","tag":"Core API","count":38},{"language":"default","tag":"Orders","count":22},{"language":"default","tag":"Prediction API","count":20},{"language":"default","tag":"Stock Alternative","count":18},{"language":"default","tag":"Analytics","count":13},{"language":"default","tag":"Options","count":11},{"language":"default","tag":"Guide","count":10},{"language":"default","tag":"Stocks","count":10},{"language":"default","tag":"MCP Auth","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"body,html{opacity:1!important}html{visibility:visible!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeSpeed;font-display:swap}body{transition:none!important;will-change:auto!important}.hero-title{text-align:center!important;font-size:clamp(2rem,5vw,3rem)!important;font-weight:700!important;margin:0 auto!important;will-change:transform!important}.hero-description,.hero-title+p{text-align:center!important;max-width:800px!important;margin:1rem auto!important}.card-group,div[class*=CardGroup]{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))!important;gap:1.5rem!important;contain:layout style!important;content-visibility:auto!important}.aries-oauth-dialog[open]{display:flex;align-items:center;justify-content:center;width:100%;min-height:100dvh;min-height:100vh;max-width:100vw;max-height:100dvh;max-height:100vh;box-sizing:border-box;margin:0;border:0;padding:1rem;background:0 0;overflow:auto;overscroll-behavior:contain}.aries-oauth-dialog::backdrop{background:rgba(0,0,0,.65);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.aries-oauth-dialog[data-oauth-theme=light]::backdrop{background:rgba(0,0,0,.45);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.aries-oauth-dialog[data-oauth-theme=dark]::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.welcome-hero{background:linear-gradient(180deg,#ecfdf5 0,#d1fae5 50%,#ecfdf5 100%)!important}.welcome-hero-gradient{background:linear-gradient(to top,#a7f3d0,transparent)!important}.welcome-feature-box{background:#e7f6ef!important;border:1px solid #0baa5e!important;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)!important}.welcome-feature-box:hover{background:#daf2e7!important;border-color:#0baa5e!important;transform:translateY(-4px)!important;box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)!important}.welcome-feature-link{color:#0baa5e!important}.welcome-feature-title{color:#000!important}.dark .welcome-hero{background:linear-gradient(180deg,rgba(11,170,94,.15) 0,rgba(11,170,94,.25) 50%,rgba(11,170,94,.15) 100%)!important}.dark .welcome-hero-gradient{background:linear-gradient(to top,rgba(11,170,94,.2),transparent)!important}.dark .welcome-feature-box{background:rgba(11,170,94,.15)!important;border:1px solid rgba(11,170,94,.5)!important}.dark .welcome-feature-box:hover{background:rgba(11,170,94,.2)!important;border-color:rgba(11,170,94,.6)!important}.dark .welcome-feature-link{color:#0baa5e!important}.dark .welcome-feature-title{color:#fff!important}.welcome-feature-box-coming-soon{cursor:default!important;pointer-events:none!important}.welcome-feature-box-coming-soon:hover{transform:none!important}.welcome-coming-soon{color:#0baa5e!important;font-weight:600!important}.hero-description,.hero-footnote{color:#000!important}.dark .welcome-coming-soon,.hero-link{color:#0baa5e!important}.section-title{color:#000!important}.welcome-cards .card,.welcome-cards a[class*=Card]{transition:transform .22s cubic-bezier(.4,0,.2,1),box-shadow .22s cubic-bezier(.4,0,.2,1),border-color .22s cubic-bezier(.4,0,.2,1),background-color .22s cubic-bezier(.4,0,.2,1)!important;transform-origin:center center!important}.welcome-cards,.welcome-cards .card-group,.welcome-cards div[class*=CardGroup]{overflow:visible!important}.welcome-cards .card:hover,.welcome-cards a[class*=Card]:hover{transform:translateY(-6px)!important;border-color:rgba(11,170,94,.45)!important;box-shadow:0 18px 30px -12px rgba(0,0,0,.16),0 10px 18px -14px rgba(11,170,94,.35)!important}.dark .welcome-cards .card:hover,.dark .welcome-cards a[class*=Card]:hover{border-color:rgba(11,170,94,.55)!important;box-shadow:0 18px 30px -12px rgba(0,0,0,.45),0 10px 22px -16px rgba(11,170,94,.35)!important}.dark .hero-title{color:#fff!important}.dark .hero-description{color:#d1d5db!important}.dark .hero-footnote{color:#9ca3af!important}.dark .hero-link{color:#0baa5e!important}.dark .section-title{color:#fff!important}@media (max-width:1024px){.welcome-side-by-side{grid-template-columns:1fr!important}}@media (max-width:640px){.welcome-cards{padding:0 24px!important}}.dark select,.dark select option{background-color:#000!important;color:#fff!important;border-color:rgba(255,255,255,.2)!important}.dark select:active,.dark select:focus{background-color:#000!important;color:#fff!important}.dark [class*=api] select,.dark [class*=playground] select,.dark [class*=request] select,.dark form select{background-color:#000!important;color:#fff!important;border-color:rgba(255,255,255,.2)!important}.dark [class*=api] select option,.dark [class*=playground] select option,.dark [class*=request] select option,.dark form select option{background-color:#000!important;color:#fff!important}.prompt,select,select option{background-color:#fff!important}select,select option{color:#000!important}.prompt{border-color:rgba(10,15,13,.1)!important}.dark .prompt{background-color:#0b0c0e!important;border-color:rgba(255,255,255,.1)!important}img[src=\"/logo/claude-logo.png\"]{border-radius:23%!important}img[src=\"/logo/chatgpt-logo.png\"],img[src=\"https://cdn.simpleicons.org/cursor\"]{background-color:#fff!important;border-radius:23%!important;padding:3px!important}"}],"page":{"pagePath":"api-reference/accounts/list-orders-history","slug":"/api-reference/accounts/list-orders-history","pageMetadata":{"title":"List order history","description":"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional `exclude_today` avoids overlap with the active-orders v2 endpoint.\n\n**Use Case:** Fill gaps before today's session or export fills for reporting without walking the live cache cursor.\n","openapi":"openapi.json GET /v2/accounts/{id}/orders/history","href":"/api-reference/accounts/list-orders-history"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional \", _jsx(_components.code, {\n children: \"exclude_today\"\n }), \" avoids overlap with the active-orders v2 endpoint.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Use Case:\"\n }), \" Fill gaps before today’s session or export fills for reporting without walking the live cache cursor.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const OAuthLoginButton=({scopes=`user:information watchlist:information watchlist:management account:information order:execution order:information position:information market:information calendar:information options:information analytics:information market:supplemental`,responseType=`token`,buttonText=`Authenticate with OAuth`,showStatus=true,requiredScopes=[]})=>{const{Info}=_provideComponents()||{};if(!Info)_missingMdxReference(`Info`,true);const[isDarkMode,setIsDarkMode]=useState(false);useEffect(()=>{const checkDarkMode=()=>{const isDark=document.documentElement.classList.contains(`dark`)||document.documentElement.getAttribute(`data-theme`)===`dark`||document.body.classList.contains(`dark`)||document.body.getAttribute(`data-theme`)===`dark`;setIsDarkMode(isDark)};checkDarkMode();const htmlObserver=new MutationObserver(checkDarkMode);const bodyObserver=new MutationObserver(checkDarkMode);htmlObserver.observe(document.documentElement,{attributes:true,attributeFilter:[`class`,`data-theme`,`style`]});bodyObserver.observe(document.body,{attributes:true,attributeFilter:[`class`,`data-theme`,`style`]});const interval=setInterval(checkDarkMode,1e3);return()=>{htmlObserver.disconnect();bodyObserver.disconnect();clearInterval(interval)}},[]);const styles=useMemo(()=>({statusContainer:{marginBottom:`1.5rem`,padding:`0.875rem 1rem`,backgroundColor:isDarkMode?`rgba(11, 170, 94, 0.08)`:`rgba(11, 170, 94, 0.06)`,border:isDarkMode?`1px solid rgba(11, 170, 94, 0.25)`:`1px solid rgba(11, 170, 94, 0.25)`,borderRadius:`10px`},statusContent:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`1rem`,flexWrap:`wrap`},statusLeft:{display:`flex`,alignItems:`center`,gap:`1rem`,flexWrap:`wrap`},statusBadge:{display:`flex`,alignItems:`center`,gap:`0.5rem`},checkmark:{color:isDarkMode?`#0BAA5E`:`#0BAA5E`,fontSize:`1.25rem`,fontWeight:`bold`},statusText:{color:isDarkMode?`#0BAA5E`:`#0BAA5E`,fontWeight:`600`,fontSize:`0.95rem`},expiryText:{color:isDarkMode?`#a1a1aa`:`#71717a`,fontSize:`0.8125rem`},logoutButton:{padding:`0.375rem 0.75rem`,backgroundColor:`transparent`,color:isDarkMode?`#e4e4e7`:`#3f3f46`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.1)`:`1px solid rgba(0, 0, 0, 0.1)`,borderRadius:`6px`,cursor:`pointer`,fontSize:`0.8125rem`,fontWeight:`500`,transition:`background-color 0.15s ease`},logoutButtonHover:{backgroundColor:isDarkMode?`rgba(255, 255, 255, 0.05)`:`rgba(0, 0, 0, 0.04)`},buttonContainer:{marginBottom:`1.5rem`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`1rem`,padding:`0.875rem 1rem`,backgroundColor:`transparent`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.1)`:`1px solid rgba(0, 0, 0, 0.08)`,borderRadius:`10px`},loginButton:{display:`inline-flex`,alignItems:`center`,gap:`0.5rem`,padding:`0.5rem 0.875rem`,backgroundColor:`#0BAA5E`,color:`white`,border:`1px solid #0BAA5E`,borderRadius:`8px`,cursor:`pointer`,fontSize:`0.8125rem`,fontWeight:`500`,lineHeight:`1.25rem`,transition:`background-color 0.15s ease, border-color 0.15s ease`,whiteSpace:`nowrap`,flexShrink:0},loginButtonHover:{backgroundColor:`#098F4E`,borderColor:`#098F4E`},lockIcon:{width:`14px`,height:`14px`,flexShrink:0},helpText:{margin:0,fontSize:`0.8125rem`,color:isDarkMode?`#9ca3af`:`#6b7280`,lineHeight:`1.5`,flex:1},modalDialog:{border:`none`,backgroundColor:`transparent`,padding:0,margin:0,maxWidth:`100%`,maxHeight:`100%`},modalContent:{backgroundColor:isDarkMode?`#0f0f10`:`#ffffff`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.08)`:`1px solid rgba(0, 0, 0, 0.08)`,borderRadius:`12px`,padding:`1.5rem`,maxWidth:`500px`,width:`100%`,boxShadow:isDarkMode?`0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3)`:`0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)`},modalHeader:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`1.5rem`},modalTitle:{margin:0,fontSize:`1.125rem`,fontWeight:`600`,color:isDarkMode?`#fafafa`:`#0a0a0a`},closeButton:{background:`none`,border:`none`,fontSize:`1.5rem`,lineHeight:1,color:isDarkMode?`#a1a1aa`:`#71717a`,cursor:`pointer`,padding:`0`,width:`2rem`,height:`2rem`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`6px`,transition:`color 0.15s ease, background-color 0.15s ease`},form:{display:`flex`,flexDirection:`column`,gap:`1rem`},formGroup:{display:`flex`,flexDirection:`column`,gap:`0.5rem`},label:{fontSize:`0.8125rem`,fontWeight:`500`,color:isDarkMode?`#e4e4e7`:`#3f3f46`},input:{padding:`0.5rem 0.75rem`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.1)`:`1px solid rgba(0, 0, 0, 0.1)`,borderRadius:`8px`,fontSize:`0.875rem`,color:isDarkMode?`#fafafa`:`#0a0a0a`,backgroundColor:isDarkMode?`rgba(255, 255, 255, 0.03)`:`#ffffff`,transition:`border-color 0.15s ease, box-shadow 0.15s ease`,outline:`none`},inputHelp:{margin:0,fontSize:`0.75rem`,color:isDarkMode?`#a1a1aa`:`#71717a`},link:{color:`#0BAA5E`,textDecoration:`none`,fontWeight:`500`},errorBox:{padding:`0.75rem`,backgroundColor:isDarkMode?`rgba(220, 38, 38, 0.1)`:`rgba(220, 38, 38, 0.05)`,border:isDarkMode?`1px solid rgba(220, 38, 38, 0.3)`:`1px solid rgba(220, 38, 38, 0.2)`,borderRadius:`8px`,color:isDarkMode?`#fca5a5`:`#dc2626`,fontSize:`0.8125rem`},modalFooter:{display:`flex`,gap:`0.5rem`,justifyContent:`flex-end`,marginTop:`0.5rem`},cancelButton:{padding:`0.5rem 0.875rem`,backgroundColor:`transparent`,color:isDarkMode?`#e4e4e7`:`#3f3f46`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.1)`:`1px solid rgba(0, 0, 0, 0.1)`,borderRadius:`8px`,cursor:`pointer`,fontSize:`0.8125rem`,fontWeight:`500`,lineHeight:`1.25rem`,transition:`background-color 0.15s ease`},submitButton:{padding:`0.5rem 0.875rem`,backgroundColor:`#0BAA5E`,color:`white`,border:`1px solid #0BAA5E`,borderRadius:`8px`,cursor:`pointer`,fontSize:`0.8125rem`,fontWeight:`500`,lineHeight:`1.25rem`,transition:`background-color 0.15s ease, border-color 0.15s ease`},submitButtonDisabled:{opacity:.6,cursor:`not-allowed`},redirectUrlContainer:{display:`flex`,alignItems:`center`,gap:`0.5rem`,padding:`0.5rem 0.75rem`,backgroundColor:isDarkMode?`rgba(255, 255, 255, 0.03)`:`rgba(0, 0, 0, 0.03)`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.08)`:`1px solid rgba(0, 0, 0, 0.08)`,borderRadius:`8px`,fontSize:`0.8125rem`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`},redirectUrlText:{flex:1,color:isDarkMode?`#a1a1aa`:`#71717a`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},copyButton:{padding:`0.25rem 0.625rem`,backgroundColor:`transparent`,color:isDarkMode?`#e4e4e7`:`#3f3f46`,border:isDarkMode?`1px solid rgba(255, 255, 255, 0.1)`:`1px solid rgba(0, 0, 0, 0.1)`,borderRadius:`6px`,cursor:`pointer`,fontSize:`0.75rem`,fontWeight:`500`,transition:`background-color 0.15s ease, border-color 0.15s ease`,whiteSpace:`nowrap`},copyButtonHover:{backgroundColor:isDarkMode?`rgba(255, 255, 255, 0.05)`:`rgba(0, 0, 0, 0.04)`},copyButtonCopied:{backgroundColor:`#0BAA5E`,color:`white`,border:`1px solid #0BAA5E`}}),[isDarkMode]);const[isModalOpen,setIsModalOpen]=useState(false);const[clientId,setClientId]=useState(``);const[isLoading,setIsLoading]=useState(false);const[hasValidToken,setHasValidToken]=useState(false);const[tokenSource,setTokenSource]=useState(null);const[timeRemaining,setTimeRemaining]=useState(0);const[error,setError]=useState(``);const[copied,setCopied]=useState(false);const redirectUrl=typeof window!==`undefined`?window.location.origin+`/api-reference`:``;useEffect(()=>{updateTokenState();if(window.AriesOAuth){const lastClientId=window.AriesOAuth.getLastClientId();setClientId(lastClientId)}const handleTokenUpdate=()=>{updateTokenState()};const handleOAuthError=event=>{setError(event.detail.description||`Authentication failed`);setIsLoading(false)};const handleOAuthSuccess=()=>{setIsModalOpen(false);setIsLoading(false);setError(``)};window.addEventListener(`tokenStatusChanged`,handleTokenUpdate);window.addEventListener(`tokenUpdated`,handleTokenUpdate);window.addEventListener(`tokenCleared`,handleTokenUpdate);window.addEventListener(`oauthError`,handleOAuthError);window.addEventListener(`oauthSuccess`,handleOAuthSuccess);const interval=setInterval(()=>{if(hasValidToken){updateTokenState()}},1e3);return()=>{window.removeEventListener(`tokenStatusChanged`,handleTokenUpdate);window.removeEventListener(`tokenUpdated`,handleTokenUpdate);window.removeEventListener(`tokenCleared`,handleTokenUpdate);window.removeEventListener(`oauthError`,handleOAuthError);window.removeEventListener(`oauthSuccess`,handleOAuthSuccess);clearInterval(interval)}},[hasValidToken]);const updateTokenState=useCallback(()=>{if(window.AriesOAuth){const isValid=window.AriesOAuth.isAuthenticated();const remaining=window.AriesOAuth.getTimeRemaining();const knownExpiry=window.AriesOAuth.hasKnownExpiry?window.AriesOAuth.hasKnownExpiry():false;const source=window.AriesOAuth.getTokenSource?window.AriesOAuth.getTokenSource():null;setHasValidToken(isValid);setTokenSource(source);setTimeRemaining(knownExpiry\u0026\u0026typeof remaining===`number`?remaining:null)}},[]);const handleLogin=()=>{setError(``);setIsModalOpen(true)};const handleLogout=()=>{if(window.AriesOAuth){window.AriesOAuth.logout()}try{const cfg=window.AriesOAuth?.config;const tokenKey=cfg?.TOKEN_KEY??`aries_access_token`;const expiryKey=cfg?.TOKEN_EXPIRY_KEY??`aries_token_timestamp`;const sourceKey=cfg?.TOKEN_SOURCE_KEY??`aries_token_source`;localStorage.removeItem(tokenKey);localStorage.removeItem(expiryKey);localStorage.removeItem(sourceKey)}catch(_){}setHasValidToken(false);setTimeRemaining(null)};const handleOAuthRedirect=async e=>{e.preventDefault();if(!clientId.trim()){setError(`Please enter your Client ID`);return}setIsLoading(true);try{if(window.AriesOAuth){window.AriesOAuth.saveClientId(clientId.trim())}const returnPath=window.location.pathname+window.location.search+window.location.hash;sessionStorage.setItem(`oauth_return_path`,returnPath);const pkce=await window.AriesOAuth.generatePKCE();const authEndpoint=window.AriesOAuth?.config?.AUTH_ENDPOINT||`https://app.aries.com/oauth2/authorize`;const authUrl=new URL(authEndpoint);authUrl.searchParams.set(`client_id`,clientId.trim());authUrl.searchParams.set(`redirect_uri`,redirectUrl);authUrl.searchParams.set(`response_type`,`code`);authUrl.searchParams.set(`code_challenge`,pkce.challenge);authUrl.searchParams.set(`code_challenge_method`,`S256`);authUrl.searchParams.set(`scope`,scopes);authUrl.searchParams.set(`state`,generateState());const fullAuthUrl=authUrl.toString();setTimeout(()=>{window.location.href=fullAuthUrl},100)}catch(error){setError(`Failed to initiate OAuth flow: `+error.message);setIsLoading(false)}};const generateState=()=>{return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)};const formatTimeRemaining=seconds=>{const minutes=Math.floor(seconds/60);const secs=seconds%60;return`${minutes}m ${secs}s`};const copyRedirectUrl=()=>{navigator.clipboard.writeText(redirectUrl).then(()=>{setCopied(true);setTimeout(()=>setCopied(false),2e3)}).catch(()=>{})};const oauthDialogRef=useRef(null);const isLoadingRef=useRef(false);isLoadingRef.current=isLoading;const closeModal=useCallback(()=>{if(!isLoading){setIsModalOpen(false);setError(``);setCopied(false)}},[isLoading]);useEffect(()=>{const el=oauthDialogRef.current;if(!el)return;if(isModalOpen){if(!el.open)el.showModal()}else{if(el.open)el.close()}},[isModalOpen]);useEffect(()=>{const el=oauthDialogRef.current;if(!el)return;const onClose=()=>{setIsModalOpen(false);setError(``);setCopied(false)};const onCancel=e=>{if(isLoadingRef.current)e.preventDefault()};el.addEventListener(`close`,onClose);el.addEventListener(`cancel`,onCancel);return()=>{el.removeEventListener(`close`,onClose);el.removeEventListener(`cancel`,onCancel)}},[hasValidToken,showStatus]);if(hasValidToken\u0026\u0026showStatus\u0026\u0026tokenSource===`oauth`){return _jsx(`div`,{style:styles.statusContainer,children:_jsxs(`div`,{style:styles.statusContent,children:[_jsxs(`div`,{style:styles.statusLeft,children:[_jsxs(`div`,{style:styles.statusBadge,children:[_jsx(`span`,{style:styles.checkmark,children:`✓`}),_jsx(`span`,{style:styles.statusText,children:`Authenticated`})]}),typeof timeRemaining===`number`?_jsxs(`span`,{style:styles.expiryText,children:[`Expires in `,formatTimeRemaining(timeRemaining)]}):null]}),_jsx(`button`,{onClick:handleLogout,style:styles.logoutButton,onMouseEnter:e=>e.target.style.backgroundColor=styles.logoutButtonHover.backgroundColor,onMouseLeave:e=>e.target.style.backgroundColor=styles.logoutButton.backgroundColor,children:`Logout`})]})})}const onDialogClick=e=>{if(e.target===e.currentTarget){closeModal()}};const modalMarkup=_jsx(`dialog`,{ref:oauthDialogRef,className:`aries-oauth-dialog`,\"data-oauth-theme\":isDarkMode?`dark`:`light`,style:styles.modalDialog,onClick:onDialogClick,children:_jsxs(`div`,{style:styles.modalContent,onClick:e=>e.stopPropagation(),children:[_jsxs(`div`,{style:styles.modalHeader,children:[_jsx(`h3`,{style:styles.modalTitle,children:`OAuth Authentication`}),_jsx(`button`,{type:`button`,onClick:closeModal,style:styles.closeButton,disabled:isLoading,children:`×`})]}),_jsxs(`form`,{onSubmit:handleOAuthRedirect,style:styles.form,children:[_jsxs(`div`,{style:styles.formGroup,children:[_jsx(`label`,{htmlFor:`clientId`,style:styles.label,children:`Client ID`}),_jsx(`input`,{id:`clientId`,type:`text`,value:clientId,onChange:e=>setClientId(e.target.value),placeholder:`Enter your OAuth Client ID`,style:styles.input,disabled:isLoading}),_jsxs(`p`,{style:styles.inputHelp,children:[`Get your Client ID from`,` `,_jsx(`a`,{href:`https://app.aries.com/client-center/api`,target:`_blank`,rel:`noopener noreferrer`,style:styles.link,children:`Client Center / Manage Account → API`})]})]}),_jsxs(`div`,{style:styles.formGroup,children:[_jsx(`label`,{style:styles.label,children:`Redirect URL`}),_jsxs(`div`,{style:styles.redirectUrlContainer,children:[_jsx(`span`,{style:styles.redirectUrlText,title:redirectUrl,children:redirectUrl}),_jsx(`button`,{type:`button`,onClick:copyRedirectUrl,style:{...styles.copyButton,...copied?styles.copyButtonCopied:{}},onMouseEnter:e=>{if(!copied){e.currentTarget.style.backgroundColor=styles.copyButtonHover.backgroundColor}},onMouseLeave:e=>{if(!copied){e.currentTarget.style.backgroundColor=styles.copyButton.backgroundColor}},children:copied?`✓ Copied`:`Copy`})]}),_jsx(`p`,{style:styles.inputHelp,children:`Add this URL to your OAuth client's allowed redirect URIs`})]}),error\u0026\u0026_jsx(`div`,{style:styles.errorBox,children:error}),_jsxs(`div`,{style:styles.modalFooter,children:[_jsx(`button`,{type:`button`,onClick:closeModal,style:styles.cancelButton,disabled:isLoading,children:`Cancel`}),_jsx(`button`,{type:`submit`,style:{...styles.submitButton,...isLoading?styles.submitButtonDisabled:{}},disabled:isLoading,children:isLoading?`Redirecting...`:`Initiate Login`})]})]})]})});return _jsxs(_Fragment,{children:[_jsxs(`div`,{style:styles.buttonContainer,children:[_jsxs(`div`,{style:styles.helpText,children:[_jsx(`strong`,{style:{color:isDarkMode?`#e5e7eb`:`#374151`},children:`Quick Auth:`}),` `,`Authenticate once to auto-fill your Bearer token across all API endpoints`]}),_jsxs(`button`,{onClick:handleLogin,style:styles.loginButton,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=styles.loginButtonHover.backgroundColor;e.currentTarget.style.borderColor=styles.loginButtonHover.borderColor},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=styles.loginButton.backgroundColor;e.currentTarget.style.borderColor=styles.loginButton.borderColor},children:[_jsxs(`svg`,{style:styles.lockIcon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,\"aria-hidden\":`true`,children:[_jsx(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),_jsx(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]}),buttonText]})]}),modalMarkup,requiredScopes.length>0\u0026\u0026_jsxs(Info,{children:[_jsx(`strong`,{children:requiredScopes.length===1\u0026\u0026requiredScopes[0].length===1?`Required scope`:requiredScopes.length===1?`Required scopes`:`Required scope (any one of)`}),` `,requiredScopes.map((alternative,i)=>_jsxs(`span`,{children:[i>0\u0026\u0026` or `,alternative.map((scope,j)=>_jsxs(`span`,{children:[j>0\u0026\u0026` + `,_jsx(`code`,{children:scope})]},scope))]},i))]})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`OAuthLoginButton`,children:_jsx(OAuthLoginButton,{requiredScopes:[[`order:information`]]})}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.p,{children:[`You must pass `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`from`})}),` (RFC 3339 with timezone). If you omit `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`to`})}),`, the service uses the current time truncated to the minute (UTC) and caps the span at `,_jsx(_components.strong,{children:`90 days`}),` from `,_jsx(_components.code,{children:`from`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`pagination-and-sorting`,children:`Pagination and sorting`}),`\n`,_jsxs(_components.p,{children:[`Use the same `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`cursor`}),` / `,_jsx(_components.code,{children:`nextCursor`})]}),` contract as `,_jsx(_components.a,{href:`/api-reference/accounts/list-active-orders`,children:`List active orders (v2)`}),`: start with `,_jsx(_components.code,{children:`cursor=0`}),`, then pass the last `,_jsx(_components.code,{children:`nextCursor`}),` until it returns `,_jsx(_components.code,{children:`0`}),`. Sorting is by `,_jsx(_components.code,{children:`order_created_at`}),`; set `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`order_by`})}),` to `,_jsx(_components.code,{children:`asc`}),` or `,_jsx(_components.code,{children:`desc`}),` (default `,_jsx(_components.code,{children:`desc`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`response-envelope`,children:`Response envelope`}),`\n`,_jsxs(_components.p,{children:[`Same contract as `,_jsx(_components.a,{href:`/api-reference/accounts/list-active-orders`,children:`List active orders (v2)`}),`: `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`orders`})}),` (never null) and `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`nextCursor`})}),` are always present. Each order uses the v2 domain shape with the same required core fields (`,_jsx(_components.code,{children:`clOrdId`}),`, `,_jsx(_components.code,{children:`accountId`}),`, `,_jsx(_components.code,{children:`symbol`}),`, decimal quantity/price strings, timestamps). History excludes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`SUPERSEDED`})}),` status and rows with `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`failed_flag = true`})}),` server-side.`]}),`\n`,_jsx(Heading,{level:`2`,id:`demo-response`,children:`Demo response`}),`\n`,_jsx(_components.p,{children:`Each order matches the v2 domain shape so it aligns with WebSocket and cache-backed reads.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`31`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`31`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"orders\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"clOrdId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"clord-20260310-msft-001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ordId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ord-hist-0001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"accountId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"TEST-ACCOUNT-001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"clientId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"demo-oauth-client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"symbol\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MSFT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"side\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SELL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"LIMIT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timeInForce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DAY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"qty\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"410.00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"stopPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ordStatus\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"FILLED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"cumQty\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"leavesQty\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"avgPrice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"410.25\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USD\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"exDestination\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"NASDAQ\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ordRejReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"securityType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"EQUITY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"category\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SINGLE_LEG\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"legs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"createdAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-10T15:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updatedAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-10T15:00:12Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"nextCursor\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{OAuthLoginButton,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"List order history","description":"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional `exclude_today` avoids overlap with the active-orders v2 endpoint.\n\n**Use Case:** Fill gaps before today's session or export fills for reporting without walking the live cache cursor.\n","openapi":"openapi.json GET /v2/accounts/{id}/orders/history","href":"/api-reference/accounts/list-orders-history"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[152,16465,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Pagination and sorting","slug":"pagination-and-sorting","depth":2,"children":[]},{"title":"Response envelope","slug":"response-envelope","depth":2,"children":[]},{"title":"Demo response","slug":"demo-response","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/ariesfinancialinc/d35069a6af6e0e00/public/oauth-manager.js","/_mintlify/custom/ariesfinancialinc/baaed03e98a52073/public/token-autofill.js","/_mintlify/custom/ariesfinancialinc/5c3c9fc4fbc77145/public/paste-plain-text.js"],"openApiReferenceData":{"operation":{"description":"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional `exclude_today` avoids overlap with the active-orders v2 endpoint.\n\n**Use Case:** Fill gaps before today's session or export fills for reporting without walking the live cache cursor.\n","operationId":"listOrderHistory","x-codeSamples":[{"lang":"python","label":"Python (SDK)","source":"from finance_dev import FinanceDev, models\nfrom finance_dev.utils import parse_datetime\n\n\nwith FinanceDev(\n security=models.Security(\n client_id=\"\u003cYOUR_CLIENT_ID_HERE>\",\n client_secret=\"\u003cYOUR_CLIENT_SECRET_HERE>\",\n ),\n) as fd_client:\n\n res = fd_client.orders.list_order_history(id=\"TEST-ACCOUNT-001\", from_=parse_datetime(\"2026-01-01T00:00:00Z\"), to=parse_datetime(\"2026-01-31T00:00:00Z\"), order_by=models.OrderBy.DESC, exclude_today=False, limit=50, cursor=0)\n\n while res is not None:\n # Handle items\n\n res = res.next()"},{"lang":"typescript","label":"Typescript (SDK)","source":"import { FinanceDev } from \"@ariesdotcom/finance-dev\";\n\nconst financeDev = new FinanceDev({\n security: {\n clientID: \"\u003cYOUR_CLIENT_ID_HERE>\",\n clientSecret: \"\u003cYOUR_CLIENT_SECRET_HERE>\",\n },\n});\n\nasync function run() {\n const result = await financeDev.orders.getHistory({\n id: \"TEST-ACCOUNT-001\",\n from: new Date(\"2026-01-01T00:00:00Z\"),\n to: new Date(\"2026-01-31T00:00:00Z\"),\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();"}],"parameters":["53f8959a-e4c2-442d-9e18-c219770dbd12","790ec4da-abd1-477a-9552-b36214fe3243","3a9f4ccb-93b2-4fc4-b7d0-1217d87b0fb2","ef331b29-6f00-4ed1-8882-7cdc63a106a8","c001a595-aa6a-412e-bd9e-ef17599fcd50","b71f613c-82ab-4906-8911-ff0fc214a2c8","399bda51-aff9-470a-b6cf-97a3dc65861c"],"responses":{"200":"ff7f6f41-6ae7-4e5c-868a-09dfd0b1302a","400":"d4e7aa4d-e92c-4af7-9340-9f4917ffc065","401":"1d38c8fb-4807-4fa5-a05a-35b695c43c84","403":"6ce22f6b-f2af-4128-a6ca-d30be1cb075e","404":"0826a53a-c0e8-42e2-adb2-e67c17e62341","500":"1ac5c096-8596-4e4c-99ac-f7248e85ad4c"},"security":["a3165608-d013-4697-b5a9-e1f5c9a6af7d"],"summary":"List order history (v2)","tags":["Orders"],"method":"get","type":"path","servers":["f38d7b7f-6d4c-4c3f-8232-2c94a60e51ad","421feb2d-ac41-443e-9380-492252b72659"],"path":"/v2/accounts/{id}/orders/history","baseUrlOptions":["https://api.aries.com","https://api.tradearies.dev"],"title":"List order history (v2)","codeSamples":[{"label":"Python (SDK)","lang":"python","source":"from finance_dev import FinanceDev, models\nfrom finance_dev.utils import parse_datetime\n\n\nwith FinanceDev(\n security=models.Security(\n client_id=\"\u003cYOUR_CLIENT_ID_HERE>\",\n client_secret=\"\u003cYOUR_CLIENT_SECRET_HERE>\",\n ),\n) as fd_client:\n\n res = fd_client.orders.list_order_history(id=\"TEST-ACCOUNT-001\", from_=parse_datetime(\"2026-01-01T00:00:00Z\"), to=parse_datetime(\"2026-01-31T00:00:00Z\"), order_by=models.OrderBy.DESC, exclude_today=False, limit=50, cursor=0)\n\n while res is not None:\n # Handle items\n\n res = res.next()"},{"label":"Typescript (SDK)","lang":"typescript","source":"import { FinanceDev } from \"@ariesdotcom/finance-dev\";\n\nconst financeDev = new FinanceDev({\n security: {\n clientID: \"\u003cYOUR_CLIENT_ID_HERE>\",\n clientSecret: \"\u003cYOUR_CLIENT_SECRET_HERE>\",\n },\n});\n\nasync function run() {\n const result = await financeDev.orders.getHistory({\n id: \"TEST-ACCOUNT-001\",\n from: new Date(\"2026-01-01T00:00:00Z\"),\n to: new Date(\"2026-01-31T00:00:00Z\"),\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"53f8959a-e4c2-442d-9e18-c219770dbd12":{"description":"Account ID whose historical orders you want to read.","example":"TEST-ACCOUNT-001","in":"path","name":"id","required":true,"schema":{"type":"string","isRequired":true,"description":"Account ID whose historical orders you want to read.","uniqueKey":"","typeLabel":"string"}},"790ec4da-abd1-477a-9552-b36214fe3243":{"description":"Start of the history window, inclusive. Enter an RFC 3339 timestamp with timezone, for example `2026-04-01T00:00:00Z`.","example":"2026-01-01T00:00:00Z","in":"query","name":"from","required":true,"schema":{"format":"date-time","type":"string","isRequired":true,"description":"Start of the history window, inclusive. Enter an RFC 3339 timestamp with timezone, for example `2026-04-01T00:00:00Z`.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}},"3a9f4ccb-93b2-4fc4-b7d0-1217d87b0fb2":{"description":"End of the history window, inclusive. Omit it to use the current time. The total range from `from` cannot exceed 90 days.","example":"2026-01-31T00:00:00Z","in":"query","name":"to","schema":{"format":"date-time","type":"string","description":"End of the history window, inclusive. Omit it to use the current time. The total range from `from` cannot exceed 90 days.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}},"ef331b29-6f00-4ed1-8882-7cdc63a106a8":{"description":"Sort direction by `order_created_at`. Defaults to `desc` (newest first). Use `asc` for chronological exports.","example":"desc","in":"query","name":"order_by","schema":{"default":"desc","enum":["asc","desc"],"type":"string","description":"Sort direction by `order_created_at`. Defaults to `desc` (newest first). Use `asc` for chronological exports.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"c001a595-aa6a-412e-bd9e-ef17599fcd50":{"description":"Set to `true` when you want historical orders only and do not want today's activity duplicated with the active-orders endpoint.","example":false,"in":"query","name":"exclude_today","schema":{"default":false,"type":"boolean","description":"Set to `true` when you want historical orders only and do not want today's activity duplicated with the active-orders endpoint.","uniqueKey":"","typeLabel":"boolean"}},"b71f613c-82ab-4906-8911-ff0fc214a2c8":{"description":"Maximum number of historical orders to return in this page. Default is 50; maximum is 500.","example":50,"in":"query","name":"limit","schema":{"default":50,"maximum":500,"minimum":1,"type":"integer","description":"Maximum number of historical orders to return in this page. Default is 50; maximum is 500.","uniqueKey":"","typeLabel":"integer"}},"399bda51-aff9-470a-b6cf-97a3dc65861c":{"description":"Opaque pagination cursor for the database history walk. Send `0` (or omit) for the first page; pass the previous `nextCursor` until it is absent.","example":0,"in":"query","name":"cursor","schema":{"default":0,"format":"int64","type":"integer","description":"Opaque pagination cursor for the database history walk. Send `0` (or omit) for the first page; pass the previous `nextCursor` until it is absent.","uniqueKey":"","typeLabel":"integer\u003cint64>"}}},"responses":{"ff7f6f41-6ae7-4e5c-868a-09dfd0b1302a":{"content":{"application/json":{"example":{"orders":[{"accountId":"TEST-ACCOUNT-001","avgPrice":"410.25","category":"SINGLE_LEG","clOrdId":"clord-20260310-msft-001","clientId":"demo-oauth-client","createdAt":"2026-03-10T15:00:00Z","cumQty":"10","currency":"USD","exDestination":"MNGD","leavesQty":"0","legs":[],"ordId":"ord-hist-0001","ordRejReason":"","ordStatus":"FILLED","price":"410.00","qty":"10","securityType":"EQUITY","side":"SELL","stopPrice":"","symbol":"MSFT","text":"","timeInForce":"DAY","type":"LIMIT","updatedAt":"2026-03-10T15:00:12Z"}]},"schema":{"description":"Paginated v2 orders response from **GET /v2/accounts/{id}/orders** and **GET /v2/accounts/{id}/orders/history**. `orders` is always present; `nextCursor` is present only when another page exists.","properties":{"orders":{"oneOf":[{"description":"Page of orders in v2 domain shape (`TradeOrderV2`). `null` from **GET /v2/accounts/{id}/orders** when the account has no active orders; an empty array from the history endpoint when there are no matches.","items":{"description":"Standard v2 order shape returned by the trading endpoints. Identical across **GET /v2/accounts/{id}/orders** (cache and DB), **GET /v2/accounts/{id}/orders/history**, and WebSocket `accUpdates` — merge live updates with REST by `clOrdId` without field remapping. Numeric quantities and prices are decimal strings. Fields marked optional in Go (`omitempty`) may be absent when empty; core quantity, price, and timestamp fields are always present on each order object.","properties":{"accountId":{"description":"Account that owns this order.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].accountId","typeLabel":"string"},"advancedOrderRole":{"description":"The order's role within its advanced-order list.\n- `SIBLING` — An OCO order.\n- `ENTRY`, `PROFIT_TARGET`, `STOP_LOSS` — Bracket orders.\n- `PARENT`, `CHILD` — OTO and OTOCO orders.\n\nOmitted for ordinary orders.","enum":["SIBLING","ENTRY","PROFIT_TARGET","STOP_LOSS","PARENT","CHILD"],"type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].advancedOrderRole","typeLabel":"enum\u003cstring>"},"advancedOrderType":{"description":"Kind of advanced-order list the order was placed in.\n- `OCO` — One-cancels-other siblings.\n- `BRACKET` — Entry with a profit target and/or stop loss.\n- `OTO` — Parent whose fill releases its children.\n- `OTOCO` — Parent whose fill releases a one-cancels-other group.\n\nOmitted for ordinary orders.","enum":["OCO","BRACKET","OTO","OTOCO"],"type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].advancedOrderType","typeLabel":"enum\u003cstring>"},"avgPrice":{"description":"Average fill price at the order level. For multi-leg orders this may be zero; use each leg's `avgPrice` instead.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].avgPrice","typeLabel":"string"},"category":{"description":"What kind of trade this order represents.\n- `EQUITY` — Plain stock or ETF order.\n- `SINGLE_LEG` — One option contract (call or put).\n- `MULTI_LEG` — Two-to-four-leg option strategy (spread, condor, straddle, etc.). See the `legs` array.\n\nOmitted when the order has not been classified.","enum":["SINGLE_LEG","MULTI_LEG","EQUITY"],"type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].category","typeLabel":"enum\u003cstring>"},"clOrdId":{"description":"Client order ID — unique per account, used as the merge key with WebSocket order snapshots.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].clOrdId","typeLabel":"string"},"clientId":{"description":"OAuth client / application identifier that submitted the order. Always serialized; may be empty.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].clientId","typeLabel":"string"},"createdAt":{"description":"Time the order record was created. Use this for timeline and sorting displays.","format":"date-time","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].createdAt","typeLabel":"string\u003cdate-time>"},"cumQty":{"description":"Total quantity already filled, returned as a decimal string.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].cumQty","typeLabel":"string"},"currency":{"description":"Currency for prices and amounts on this order, usually USD for U.S. securities.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].currency","typeLabel":"string"},"exDestination":{"description":"Where the order was routed for execution. Useful for support diagnostics and advanced routing displays.\n- `MNGD` — Managed routing (Aries chooses the best venue automatically).\n- `MNGDFTE` — Managed routing with fill-then-end (extended) handling.","enum":["MNGD","MNGDFTE"],"example":"MNGD","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].exDestination","typeLabel":"enum\u003cstring>"},"leavesQty":{"description":"Quantity still open and waiting to fill, returned as a decimal string.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].leavesQty","typeLabel":"string"},"legs":{"description":"Per-leg details for option spreads or other multi-leg orders. Empty or omitted for normal single-symbol orders.","items":{"description":"Option leg on a v2 order (`order.Leg`). Multi-leg orders carry per-leg `avgPrice`; order-level `avgPrice` is zero when `legs` is non-empty.","properties":{"maturity":{"description":"Option expiration date in YYYY-MM-DD format. Present for option legs.","type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].maturity","typeLabel":"string"},"positionEffect":{"description":"Whether this leg opens a new position or closes an existing one:\n- `OPEN` — opens a new position (or increases an existing one).\n- `CLOSE` — closes an existing position (or reduces it).","enum":["OPEN","CLOSE"],"type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].positionEffect","typeLabel":"enum\u003cstring>"},"putCall":{"description":"Option contract type. CALL gives the right to buy; PUT gives the right to sell.","enum":["CALL","PUT"],"type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].putCall","typeLabel":"enum\u003cstring>"},"ratioQty":{"description":"Quantity ratio for this leg, returned as a decimal string. Use it to display strategy structure.","type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].ratioQty","typeLabel":"string"},"securityType":{"description":"Instrument type for this leg. EQUITY is stock or ETF; OPTION is an options contract.","enum":["EQUITY","OPTION"],"type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].securityType","typeLabel":"enum\u003cstring>"},"side":{"description":"Direction for this leg. BUY purchases the instrument; SELL sells it.","enum":["BUY","SELL"],"type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].side","typeLabel":"enum\u003cstring>"},"strikePrice":{"description":"Option strike price as a decimal string. Present for option legs.","type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].strikePrice","typeLabel":"string"},"symbol":{"description":"Symbol for this leg. For options, use the exact contract symbol from search or the order response.","type":"string","isRequired":true,"uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].symbol","typeLabel":"string"},"avgPrice":{"description":"Average fill price for this leg (decimal string)","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].avgPrice","typeLabel":"string"},"tickerSymbol":{"description":"Full OCC contract symbol for an option leg (for example `AAPL261023C00340000`). Equity legs carry the plain symbol. Omitted on orders stored before this field existed.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX].tickerSymbol","typeLabel":"string"}},"required":["symbol","side","ratioQty","securityType","maturity","strikePrice","positionEffect","putCall"],"type":"object","uniqueKey":"orders.oneOf.0.items.[INDEX].legs.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"orders.oneOf.0.items.[INDEX].legs","typeLabel":"object[]"},"listId":{"description":"ID of the advanced-order list (OCO, bracket, OTO or OTOCO) this order was placed in, shared by every order in the list. Kept on the order's cancel and replace records. Omitted for ordinary orders.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].listId","typeLabel":"string"},"ordId":{"description":"Broker order ID. Always serialized; may be an empty string for cancel-rejects or before the broker accepts the order.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].ordId","typeLabel":"string"},"ordRejReason":{"description":"Broker rejection reason code or text. Use this with `text` to explain why an order was rejected.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].ordRejReason","typeLabel":"string"},"ordStatus":{"description":"Current state of the order. Possible values:\n- `PENDING_NEW` — Submitted, waiting for exchange acknowledgement.\n- `NEW` — Accepted by the exchange and live in the order book; no fills yet.\n- `PARTIALLY_FILLED` — Some of the quantity has executed; the rest is still working. See `cumQty` and `leavesQty`.\n- `FILLED` — Fully executed. Order is complete.\n- `PENDING_CANCEL` — Cancel request submitted; waiting for exchange confirmation.\n- `CANCELED` — Order was cancelled and will not execute further.\n- `PENDING_REPLACE` — Replace/modify request submitted; waiting for exchange confirmation.\n- `REPLACED` — Order was successfully replaced/modified.\n- `REJECTED` — Order was refused (bad parameters, insufficient buying power, halted symbol, etc.). Check `ordRejReason` and `text`.\n- `EXPIRED` — Order reached its time-in-force limit without filling (e.g. a `DAY` order that didn't fill before close).\n- `DONE_FOR_DAY` — Order is no longer active for today's session but may resume on the next trading day (rare).\n- `STOPPED` — Trading was stopped on this order by an exchange action.\n- `SUSPENDED` — Order is temporarily suspended by the broker or exchange.\n- `CALCULATED` — End-of-day calculated status from FIX (rarely surfaced).\n- `ACCEPTED_FOR_BID` — Acknowledged for a bid (auction workflows).\n- `SUPERSEDED` — Replaced by a newer record; excluded from history responses server-side.\n\nOmitted when the broker has not yet reported a status.","enum":["NEW","PARTIALLY_FILLED","FILLED","DONE_FOR_DAY","CANCELED","REPLACED","PENDING_CANCEL","STOPPED","REJECTED","SUSPENDED","PENDING_NEW","CALCULATED","EXPIRED","ACCEPTED_FOR_BID","PENDING_REPLACE","SUPERSEDED"],"type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].ordStatus","typeLabel":"enum\u003cstring>"},"origClOrdId":{"description":"Original client order ID for replace/cancel chains. Omitted when not part of a chain.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].origClOrdId","typeLabel":"string"},"parentClOrdId":{"description":"Client order ID the parent order was placed with, on a child of a bracket, OTO or OTOCO. Unchanged when the child is replaced or cancelled, and when the parent is replaced — follow the parent's `origClOrdId` chain for that. Omitted for parents, OCO orders and ordinary orders.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].parentClOrdId","typeLabel":"string"},"price":{"description":"Limit or reference price as a decimal string. Required for limit-style orders and empty or zero for pure market orders.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].price","typeLabel":"string"},"qty":{"description":"Original order size as a decimal string. Use this with filled and remaining quantities to show execution progress.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].qty","typeLabel":"string"},"securityType":{"description":"Instrument type for the order. EQUITY is stock or ETF; OPTION is an options contract.","enum":["EQUITY","OPTION"],"type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].securityType","typeLabel":"enum\u003cstring>"},"side":{"description":"Which direction to trade in. Pick one:\n- `BUY` — buying shares or contracts (opens a long position or closes an existing short).\n- `SELL` — selling shares or contracts you already hold (closes a long position).\n- `SELL_SHORT` — selling shares you do not own (opens a short position). Subject to short-sale regulations.\n- `BUY_TO_COVER` — buying shares to close an open short position.","enum":["BUY","SELL","SELL_SHORT","BUY_TO_COVER"],"example":"BUY","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].side","typeLabel":"enum\u003cstring>"},"stopPrice":{"description":"Stop trigger price as a decimal string. Required for stop-style orders and empty or zero when not used.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].stopPrice","typeLabel":"string"},"symbol":{"description":"Primary symbol traded by the order.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].symbol","typeLabel":"string"},"text":{"description":"Broker or platform message about the order. Show this when status is rejected or when the user needs extra context.","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].text","typeLabel":"string"},"timeInForce":{"description":"How long the order should stay alive before automatically cancelling. Pick one:\n- `DAY` — Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.\n- `GTC` — Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).\n- `IOC` — Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.\n- `FOK` — Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.\n- `EXTENDED_HOURS` — Active during pre-market and after-hours trading sessions in addition to regular hours.\n- `AT_THE_OPENING` — Execute at the official market open price; if it can't fill at open, it's cancelled.\n- `AT_THE_CLOSE` — Execute at the official market close price; if it can't fill at close, it's cancelled.","enum":["DAY","GTC","IOC","FOK","EXTENDED_HOURS","AT_THE_OPENING","AT_THE_CLOSE"],"example":"DAY","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].timeInForce","typeLabel":"enum\u003cstring>"},"type":{"description":"How the order is priced. Pick one:\n- `MARKET` — Execute immediately at the best available price. Fast and guaranteed to fill, but no price guarantee — the actual fill price can move during execution.\n- `LIMIT` — Execute only at the limit `price` or better (lower for buys, higher for sells). Gives you price control, no execution guarantee. Requires the `price` field.\n- `STOP` — Sits inactive until the market hits `stopPrice`, then converts to a market order. Common for stop-loss exits. Requires the `stopPrice` field.\n- `STOP_LIMIT` — Sits inactive until the market hits `stopPrice`, then converts to a limit order at `price`. More control than `STOP`, but the limit may not fill. Requires both `stopPrice` and `price`.","enum":["MARKET","LIMIT","STOP","STOP_LIMIT"],"example":"LIMIT","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"updatedAt":{"description":"Time the order record was last updated. Use this to show status freshness.","format":"date-time","type":"string","uniqueKey":"orders.oneOf.0.items.[INDEX].updatedAt","typeLabel":"string\u003cdate-time>"}},"type":"object","uniqueKey":"orders.oneOf.0.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"orders.oneOf.0","typeLabel":"object[]"},{"description":"Page of orders in v2 domain shape (`TradeOrderV2`). `null` from **GET /v2/accounts/{id}/orders** when the account has no active orders; an empty array from the history endpoint when there are no matches.","items":{"description":"Standard v2 order shape returned by the trading endpoints. Identical across **GET /v2/accounts/{id}/orders** (cache and DB), **GET /v2/accounts/{id}/orders/history**, and WebSocket `accUpdates` — merge live updates with REST by `clOrdId` without field remapping. Numeric quantities and prices are decimal strings. Fields marked optional in Go (`omitempty`) may be absent when empty; core quantity, price, and timestamp fields are always present on each order object.","properties":{"accountId":{"description":"Account that owns this order.","type":"string"},"advancedOrderRole":{"description":"The order's role within its advanced-order list.\n- `SIBLING` — An OCO order.\n- `ENTRY`, `PROFIT_TARGET`, `STOP_LOSS` — Bracket orders.\n- `PARENT`, `CHILD` — OTO and OTOCO orders.\n\nOmitted for ordinary orders.","enum":["SIBLING","ENTRY","PROFIT_TARGET","STOP_LOSS","PARENT","CHILD"],"type":"string"},"advancedOrderType":{"description":"Kind of advanced-order list the order was placed in.\n- `OCO` — One-cancels-other siblings.\n- `BRACKET` — Entry with a profit target and/or stop loss.\n- `OTO` — Parent whose fill releases its children.\n- `OTOCO` — Parent whose fill releases a one-cancels-other group.\n\nOmitted for ordinary orders.","enum":["OCO","BRACKET","OTO","OTOCO"],"type":"string"},"avgPrice":{"description":"Average fill price at the order level. For multi-leg orders this may be zero; use each leg's `avgPrice` instead.","type":"string"},"category":{"description":"What kind of trade this order represents.\n- `EQUITY` — Plain stock or ETF order.\n- `SINGLE_LEG` — One option contract (call or put).\n- `MULTI_LEG` — Two-to-four-leg option strategy (spread, condor, straddle, etc.). See the `legs` array.\n\nOmitted when the order has not been classified.","enum":["SINGLE_LEG","MULTI_LEG","EQUITY"],"type":"string"},"clOrdId":{"description":"Client order ID — unique per account, used as the merge key with WebSocket order snapshots.","type":"string"},"clientId":{"description":"OAuth client / application identifier that submitted the order. Always serialized; may be empty.","type":"string"},"createdAt":{"description":"Time the order record was created. Use this for timeline and sorting displays.","format":"date-time","type":"string"},"cumQty":{"description":"Total quantity already filled, returned as a decimal string.","type":"string"},"currency":{"description":"Currency for prices and amounts on this order, usually USD for U.S. securities.","type":"string"},"exDestination":{"description":"Where the order was routed for execution. Useful for support diagnostics and advanced routing displays.\n- `MNGD` — Managed routing (Aries chooses the best venue automatically).\n- `MNGDFTE` — Managed routing with fill-then-end (extended) handling.","enum":["MNGD","MNGDFTE"],"example":"MNGD","type":"string"},"leavesQty":{"description":"Quantity still open and waiting to fill, returned as a decimal string.","type":"string"},"legs":{"description":"Per-leg details for option spreads or other multi-leg orders. Empty or omitted for normal single-symbol orders.","items":{"description":"Option leg on a v2 order (`order.Leg`). Multi-leg orders carry per-leg `avgPrice`; order-level `avgPrice` is zero when `legs` is non-empty.","properties":{"avgPrice":{"description":"Average fill price for this leg (decimal string)","type":"string"},"maturity":{"description":"Option expiration date in YYYY-MM-DD format. Present for option legs.","type":"string"},"positionEffect":{"description":"Whether this leg opens a new position or closes an existing one:\n- `OPEN` — opens a new position (or increases an existing one).\n- `CLOSE` — closes an existing position (or reduces it).","enum":["OPEN","CLOSE"],"type":"string"},"putCall":{"description":"Option contract type. CALL gives the right to buy; PUT gives the right to sell.","enum":["CALL","PUT"],"type":"string"},"ratioQty":{"description":"Quantity ratio for this leg, returned as a decimal string. Use it to display strategy structure.","type":"string"},"securityType":{"description":"Instrument type for this leg. EQUITY is stock or ETF; OPTION is an options contract.","enum":["EQUITY","OPTION"],"type":"string"},"side":{"description":"Direction for this leg. BUY purchases the instrument; SELL sells it.","enum":["BUY","SELL"],"type":"string"},"strikePrice":{"description":"Option strike price as a decimal string. Present for option legs.","type":"string"},"symbol":{"description":"Symbol for this leg. For options, use the exact contract symbol from search or the order response.","type":"string"},"tickerSymbol":{"description":"Full OCC contract symbol for an option leg (for example `AAPL261023C00340000`). Equity legs carry the plain symbol. Omitted on orders stored before this field existed.","type":"string"}},"required":["symbol","side","ratioQty","securityType","maturity","strikePrice","positionEffect","putCall"],"type":"object"},"type":"array"},"listId":{"description":"ID of the advanced-order list (OCO, bracket, OTO or OTOCO) this order was placed in, shared by every order in the list. Kept on the order's cancel and replace records. Omitted for ordinary orders.","type":"string"},"ordId":{"description":"Broker order ID. Always serialized; may be an empty string for cancel-rejects or before the broker accepts the order.","type":"string"},"ordRejReason":{"description":"Broker rejection reason code or text. Use this with `text` to explain why an order was rejected.","type":"string"},"ordStatus":{"description":"Current state of the order. Possible values:\n- `PENDING_NEW` — Submitted, waiting for exchange acknowledgement.\n- `NEW` — Accepted by the exchange and live in the order book; no fills yet.\n- `PARTIALLY_FILLED` — Some of the quantity has executed; the rest is still working. See `cumQty` and `leavesQty`.\n- `FILLED` — Fully executed. Order is complete.\n- `PENDING_CANCEL` — Cancel request submitted; waiting for exchange confirmation.\n- `CANCELED` — Order was cancelled and will not execute further.\n- `PENDING_REPLACE` — Replace/modify request submitted; waiting for exchange confirmation.\n- `REPLACED` — Order was successfully replaced/modified.\n- `REJECTED` — Order was refused (bad parameters, insufficient buying power, halted symbol, etc.). Check `ordRejReason` and `text`.\n- `EXPIRED` — Order reached its time-in-force limit without filling (e.g. a `DAY` order that didn't fill before close).\n- `DONE_FOR_DAY` — Order is no longer active for today's session but may resume on the next trading day (rare).\n- `STOPPED` — Trading was stopped on this order by an exchange action.\n- `SUSPENDED` — Order is temporarily suspended by the broker or exchange.\n- `CALCULATED` — End-of-day calculated status from FIX (rarely surfaced).\n- `ACCEPTED_FOR_BID` — Acknowledged for a bid (auction workflows).\n- `SUPERSEDED` — Replaced by a newer record; excluded from history responses server-side.\n\nOmitted when the broker has not yet reported a status.","enum":["NEW","PARTIALLY_FILLED","FILLED","DONE_FOR_DAY","CANCELED","REPLACED","PENDING_CANCEL","STOPPED","REJECTED","SUSPENDED","PENDING_NEW","CALCULATED","EXPIRED","ACCEPTED_FOR_BID","PENDING_REPLACE","SUPERSEDED"],"type":"string"},"origClOrdId":{"description":"Original client order ID for replace/cancel chains. Omitted when not part of a chain.","type":"string"},"parentClOrdId":{"description":"Client order ID the parent order was placed with, on a child of a bracket, OTO or OTOCO. Unchanged when the child is replaced or cancelled, and when the parent is replaced — follow the parent's `origClOrdId` chain for that. Omitted for parents, OCO orders and ordinary orders.","type":"string"},"price":{"description":"Limit or reference price as a decimal string. Required for limit-style orders and empty or zero for pure market orders.","type":"string"},"qty":{"description":"Original order size as a decimal string. Use this with filled and remaining quantities to show execution progress.","type":"string"},"securityType":{"description":"Instrument type for the order. EQUITY is stock or ETF; OPTION is an options contract.","enum":["EQUITY","OPTION"],"type":"string"},"side":{"description":"Which direction to trade in. Pick one:\n- `BUY` — buying shares or contracts (opens a long position or closes an existing short).\n- `SELL` — selling shares or contracts you already hold (closes a long position).\n- `SELL_SHORT` — selling shares you do not own (opens a short position). Subject to short-sale regulations.\n- `BUY_TO_COVER` — buying shares to close an open short position.","enum":["BUY","SELL","SELL_SHORT","BUY_TO_COVER"],"example":"BUY","type":"string"},"stopPrice":{"description":"Stop trigger price as a decimal string. Required for stop-style orders and empty or zero when not used.","type":"string"},"symbol":{"description":"Primary symbol traded by the order.","type":"string"},"text":{"description":"Broker or platform message about the order. Show this when status is rejected or when the user needs extra context.","type":"string"},"timeInForce":{"description":"How long the order should stay alive before automatically cancelling. Pick one:\n- `DAY` — Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.\n- `GTC` — Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).\n- `IOC` — Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.\n- `FOK` — Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.\n- `EXTENDED_HOURS` — Active during pre-market and after-hours trading sessions in addition to regular hours.\n- `AT_THE_OPENING` — Execute at the official market open price; if it can't fill at open, it's cancelled.\n- `AT_THE_CLOSE` — Execute at the official market close price; if it can't fill at close, it's cancelled.","enum":["DAY","GTC","IOC","FOK","EXTENDED_HOURS","AT_THE_OPENING","AT_THE_CLOSE"],"example":"DAY","type":"string"},"type":{"description":"How the order is priced. Pick one:\n- `MARKET` — Execute immediately at the best available price. Fast and guaranteed to fill, but no price guarantee — the actual fill price can move during execution.\n- `LIMIT` — Execute only at the limit `price` or better (lower for buys, higher for sells). Gives you price control, no execution guarantee. Requires the `price` field.\n- `STOP` — Sits inactive until the market hits `stopPrice`, then converts to a market order. Common for stop-loss exits. Requires the `stopPrice` field.\n- `STOP_LIMIT` — Sits inactive until the market hits `stopPrice`, then converts to a limit order at `price`. More control than `STOP`, but the limit may not fill. Requires both `stopPrice` and `price`.","enum":["MARKET","LIMIT","STOP","STOP_LIMIT"],"example":"LIMIT","type":"string"},"updatedAt":{"description":"Time the order record was last updated. Use this to show status freshness.","format":"date-time","type":"string"}},"type":"object"},"type":"null","isRequired":true,"uniqueKey":"orders.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"orders","typeLabel":"object[] | null"},"nextCursor":{"description":"Opaque pagination cursor. Pass as `cursor` on the next request. This field is omitted on the final page.","format":"int64","type":"integer","uniqueKey":"nextCursor","typeLabel":"integer\u003cint64>"}},"required":["orders"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"orders":[{"accountId":"TEST-ACCOUNT-001","avgPrice":"410.25","category":"SINGLE_LEG","clOrdId":"clord-20260310-msft-001","clientId":"demo-oauth-client","createdAt":"2026-03-10T15:00:00Z","cumQty":"10","currency":"USD","exDestination":"MNGD","leavesQty":"0","legs":[],"ordId":"ord-hist-0001","ordRejReason":"","ordStatus":"FILLED","price":"410.00","qty":"10","securityType":"EQUITY","side":"SELL","stopPrice":"","symbol":"MSFT","text":"","timeInForce":"DAY","type":"LIMIT","updatedAt":"2026-03-10T15:00:12Z"}]}}},"exampleType":"examples"}},"description":"Page of historical orders","exampleType":"examples"},"d4e7aa4d-e92c-4af7-9340-9f4917ffc065":{"content":{"application/json":{"examples":{"from_required":{"title":"from_required","value":{"error":"from is required"}},"invalid_from":{"title":"invalid_from","value":{"error":"invalid from: parsing time \"2006-01-02T15:04:05Z07:00\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"Z07:00\""}},"invalid_order_by":{"title":"invalid_order_by","value":{"error":"order_by must be asc or desc"}},"range_exceeded":{"title":"range_exceeded","value":{"error":"range exceeds 90 days"}}},"schema":{"oneOf":[{"type":"object","description":"Flat error body: an `error` string, with optional structured `codes` and additional `metadata`.","properties":{"codes":{"description":"Structured error codes for programmatic handling","items":{"description":"A single structured error entry identifying a machine-readable code, a human-readable description, and optionally the field that caused it.","properties":{"code":{"description":"Machine-readable error code","example":"INVALID_PASSWORD","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].code","typeLabel":"string"},"description":{"description":"Human-readable description of the error","example":"Password must be between 8 and 64 characters","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].description","typeLabel":"string"},"field":{"description":"Field name that caused the error","example":"password","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].field","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.0.codes.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"oneOf.0.codes","typeLabel":"object[]"},"error":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.0.error","typeLabel":"string"},"metadata":{"additionalProperties":true,"description":"Additional error context","type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"JSON envelope where `error` is a nested object (`type`, `code`, `message`, …). Many services use this shape for 400, 401, 403, 404, and 5xx when using the shared HTTP error format.","properties":{"error":{"description":"Structured payload for the nested `error` object. Services using the shared Go error writer emit uppercase `type` values aligned with error categories (for example `VALIDATION`, `BAD_REQUEST`, `AUTHENTICATION`, `AUTHORIZATION`, `NOT_FOUND`, `RATE_LIMIT`, `INTERNAL`).","properties":{"code":{"description":"Machine-readable code","example":"INVALID_TOKEN","type":"string","uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"details":{"additionalProperties":true,"description":"Optional extra context","type":"object","uniqueKey":"oneOf.1.error.details","typeLabel":"object"},"message":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"request_id":{"description":"Request correlation id when provided","type":"string","uniqueKey":"oneOf.1.error.request_id","typeLabel":"string"},"type":{"description":"Error category emitted by the shared error writer, such as VALIDATION, BAD_REQUEST, AUTHENTICATION, AUTHORIZATION, NOT_FOUND, RATE_LIMIT, or INTERNAL.","example":"AUTHENTICATION","type":"string","uniqueKey":"oneOf.1.error.type","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"additionalProperties":true,"description":"Optional metadata","type":"object","uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"Bad request: missing or invalid `from`/`to`, range over 90 days, or invalid `order_by`, returned as a flat `ErrorResponse` (`error` string). Account-ID path validation failures return the nested error envelope.","exampleType":"examples"},"1d38c8fb-4807-4fa5-a05a-35b695c43c84":{"content":{"application/json":{"examples":{"flat_message":{"title":"flat_message","value":{"error":"string"}},"flat_with_codes":{"title":"flat_with_codes","value":{"codes":[{"code":"string","description":"string"}],"error":"string"}},"nested_error_object":{"title":"nested_error_object","value":{"error":{"code":"INVALID_TOKEN","message":"string","type":"AUTHENTICATION"}}}},"schema":{"oneOf":[{"type":"object","description":"401 responses may use a flat `ErrorResponse` shape or a nested `error` object. Inspect `error`: if it is a string, use the flat shape; if it is an object, use the structured shape.","properties":{"codes":{"description":"Structured error codes for programmatic handling","items":{"description":"A single structured error entry identifying a machine-readable code, a human-readable description, and optionally the field that caused it.","properties":{"code":{"description":"Machine-readable error code","example":"INVALID_PASSWORD","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].code","typeLabel":"string"},"description":{"description":"Human-readable description of the error","example":"Password must be between 8 and 64 characters","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].description","typeLabel":"string"},"field":{"description":"Field name that caused the error","example":"password","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].field","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.0.codes.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"oneOf.0.codes","typeLabel":"object[]"},"error":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.0.error","typeLabel":"string"},"metadata":{"additionalProperties":true,"description":"Additional error context","type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"401 responses may use a flat `ErrorResponse` shape or a nested `error` object. Inspect `error`: if it is a string, use the flat shape; if it is an object, use the structured shape.","properties":{"error":{"description":"Structured payload for the nested `error` object. Services using the shared Go error writer emit uppercase `type` values aligned with error categories (for example `VALIDATION`, `BAD_REQUEST`, `AUTHENTICATION`, `AUTHORIZATION`, `NOT_FOUND`, `RATE_LIMIT`, `INTERNAL`).","properties":{"code":{"description":"Machine-readable code","example":"INVALID_TOKEN","type":"string","uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"details":{"additionalProperties":true,"description":"Optional extra context","type":"object","uniqueKey":"oneOf.1.error.details","typeLabel":"object"},"message":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"request_id":{"description":"Request correlation id when provided","type":"string","uniqueKey":"oneOf.1.error.request_id","typeLabel":"string"},"type":{"description":"Error category emitted by the shared error writer, such as VALIDATION, BAD_REQUEST, AUTHENTICATION, AUTHORIZATION, NOT_FOUND, RATE_LIMIT, or INTERNAL.","example":"AUTHENTICATION","type":"string","uniqueKey":"oneOf.1.error.type","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"additionalProperties":true,"description":"Optional metadata","type":"object","uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"Authentication failed: missing credentials, invalid JWT, or expired access token.\n\n**Response body variants:** Some routes return JSON with a string `error` field (and optionally `codes` / `metadata`). Others return JSON where `error` is a structured object (`type`, `code`, `message`, and optionally `details`, `request_id`). The response may have **no body** even though the status is 401—clients should treat 401 as unauthenticated and refresh or re-authenticate regardless of body shape.","exampleType":"examples"},"6ce22f6b-f2af-4128-a6ca-d30be1cb075e":{"content":{"application/json":{"examples":{"flat":{"title":"flat","value":{"error":"string"}},"nested":{"title":"nested","value":{"error":{"code":"INSUFFICIENT_SCOPE","message":"string","type":"AUTHORIZATION"}}}},"schema":{"oneOf":[{"type":"object","description":"403 responses may use a flat or nested error shape.","properties":{"codes":{"description":"Structured error codes for programmatic handling","items":{"description":"A single structured error entry identifying a machine-readable code, a human-readable description, and optionally the field that caused it.","properties":{"code":{"description":"Machine-readable error code","example":"INVALID_PASSWORD","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].code","typeLabel":"string"},"description":{"description":"Human-readable description of the error","example":"Password must be between 8 and 64 characters","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].description","typeLabel":"string"},"field":{"description":"Field name that caused the error","example":"password","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].field","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.0.codes.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"oneOf.0.codes","typeLabel":"object[]"},"error":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.0.error","typeLabel":"string"},"metadata":{"additionalProperties":true,"description":"Additional error context","type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"403 responses may use a flat or nested error shape.","properties":{"error":{"description":"Structured payload for the nested `error` object. Services using the shared Go error writer emit uppercase `type` values aligned with error categories (for example `VALIDATION`, `BAD_REQUEST`, `AUTHENTICATION`, `AUTHORIZATION`, `NOT_FOUND`, `RATE_LIMIT`, `INTERNAL`).","properties":{"code":{"description":"Machine-readable code","example":"INVALID_TOKEN","type":"string","uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"details":{"additionalProperties":true,"description":"Optional extra context","type":"object","uniqueKey":"oneOf.1.error.details","typeLabel":"object"},"message":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"request_id":{"description":"Request correlation id when provided","type":"string","uniqueKey":"oneOf.1.error.request_id","typeLabel":"string"},"type":{"description":"Error category emitted by the shared error writer, such as VALIDATION, BAD_REQUEST, AUTHENTICATION, AUTHORIZATION, NOT_FOUND, RATE_LIMIT, or INTERNAL.","example":"AUTHENTICATION","type":"string","uniqueKey":"oneOf.1.error.type","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"additionalProperties":true,"description":"Optional metadata","type":"object","uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"Authenticated but not allowed to perform this action or access this resource (insufficient scope or role).\n\n**Response body variants:** Flat `ErrorResponse` or nested `error` object, same pattern as 400/401.","exampleType":"examples"},"0826a53a-c0e8-42e2-adb2-e67c17e62341":{"content":{"application/json":{"examples":{"flat":{"title":"flat","value":{"error":"string"}},"nested":{"title":"nested","value":{"error":{"code":"RESOURCE_NOT_FOUND","message":"string","type":"NOT_FOUND"}}}},"schema":{"oneOf":[{"type":"object","description":"404 responses may use a flat or nested error shape.","properties":{"codes":{"description":"Structured error codes for programmatic handling","items":{"description":"A single structured error entry identifying a machine-readable code, a human-readable description, and optionally the field that caused it.","properties":{"code":{"description":"Machine-readable error code","example":"INVALID_PASSWORD","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].code","typeLabel":"string"},"description":{"description":"Human-readable description of the error","example":"Password must be between 8 and 64 characters","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].description","typeLabel":"string"},"field":{"description":"Field name that caused the error","example":"password","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].field","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.0.codes.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"oneOf.0.codes","typeLabel":"object[]"},"error":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.0.error","typeLabel":"string"},"metadata":{"additionalProperties":true,"description":"Additional error context","type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"404 responses may use a flat or nested error shape.","properties":{"error":{"description":"Structured payload for the nested `error` object. Services using the shared Go error writer emit uppercase `type` values aligned with error categories (for example `VALIDATION`, `BAD_REQUEST`, `AUTHENTICATION`, `AUTHORIZATION`, `NOT_FOUND`, `RATE_LIMIT`, `INTERNAL`).","properties":{"code":{"description":"Machine-readable code","example":"INVALID_TOKEN","type":"string","uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"details":{"additionalProperties":true,"description":"Optional extra context","type":"object","uniqueKey":"oneOf.1.error.details","typeLabel":"object"},"message":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"request_id":{"description":"Request correlation id when provided","type":"string","uniqueKey":"oneOf.1.error.request_id","typeLabel":"string"},"type":{"description":"Error category emitted by the shared error writer, such as VALIDATION, BAD_REQUEST, AUTHENTICATION, AUTHORIZATION, NOT_FOUND, RATE_LIMIT, or INTERNAL.","example":"AUTHENTICATION","type":"string","uniqueKey":"oneOf.1.error.type","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"additionalProperties":true,"description":"Optional metadata","type":"object","uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"The requested resource does not exist or is not visible to this caller.\n\n**Response body variants:** Flat `ErrorResponse` or nested `error` object.","exampleType":"examples"},"1ac5c096-8596-4e4c-99ac-f7248e85ad4c":{"content":{"application/json":{"examples":{"flat_string":{"title":"flat_string","value":{"error":"string"}},"nested_error_object":{"title":"nested_error_object","value":{"error":{"code":"INTERNAL_ERROR","message":"string","type":"INTERNAL"}}}},"schema":{"oneOf":[{"type":"object","description":"5xx responses may use a flat or nested error shape.","properties":{"codes":{"description":"Structured error codes for programmatic handling","items":{"description":"A single structured error entry identifying a machine-readable code, a human-readable description, and optionally the field that caused it.","properties":{"code":{"description":"Machine-readable error code","example":"INVALID_PASSWORD","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].code","typeLabel":"string"},"description":{"description":"Human-readable description of the error","example":"Password must be between 8 and 64 characters","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].description","typeLabel":"string"},"field":{"description":"Field name that caused the error","example":"password","type":"string","uniqueKey":"oneOf.0.codes.items.[INDEX].field","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.0.codes.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"oneOf.0.codes","typeLabel":"object[]"},"error":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.0.error","typeLabel":"string"},"metadata":{"additionalProperties":true,"description":"Additional error context","type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"5xx responses may use a flat or nested error shape.","properties":{"error":{"description":"Structured payload for the nested `error` object. Services using the shared Go error writer emit uppercase `type` values aligned with error categories (for example `VALIDATION`, `BAD_REQUEST`, `AUTHENTICATION`, `AUTHORIZATION`, `NOT_FOUND`, `RATE_LIMIT`, `INTERNAL`).","properties":{"code":{"description":"Machine-readable code","example":"INVALID_TOKEN","type":"string","uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"details":{"additionalProperties":true,"description":"Optional extra context","type":"object","uniqueKey":"oneOf.1.error.details","typeLabel":"object"},"message":{"description":"Error detail as a string. Exact message content is not fixed and should not be hard-coded.","example":"string","type":"string","uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"request_id":{"description":"Request correlation id when provided","type":"string","uniqueKey":"oneOf.1.error.request_id","typeLabel":"string"},"type":{"description":"Error category emitted by the shared error writer, such as VALIDATION, BAD_REQUEST, AUTHENTICATION, AUTHORIZATION, NOT_FOUND, RATE_LIMIT, or INTERNAL.","example":"AUTHENTICATION","type":"string","uniqueKey":"oneOf.1.error.type","typeLabel":"string"}},"type":"object","uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"additionalProperties":true,"description":"Optional metadata","type":"object","uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"Unexpected server error or upstream failure. **Retry with exponential backoff**; do not assume a specific JSON body shape.\n\n**Response body variants:** Flat `ErrorResponse`, nested `error` object, or occasionally a minimal message.","exampleType":"examples"}},"security":{"a3165608-d013-4697-b5a9-e1f5c9a6af7d":{"OAuth2":{"description":"OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.","flows":{"authorizationCode":{"authorizationUrl":"https://app.aries.com/oauth2/authorize","refreshUrl":"https://api.aries.com/v1/oauth2/token","scopes":{"account:information":"View account balances, positions, and transaction history","analytics:information":"View analytics, ratings, and market insights","calendar:information":"Access earnings, economic, and market schedule data","market:information":"Access live and historical market data","market:supplemental":"News, company profiles, financials, filings, ETF data, technical analysis","options:information":"Access options chains and expiration data","order:execution":"Place, modify, and cancel orders","order:information":"View order history and status","position:information":"View current positions and holdings","user:information":"View user profile and personal details","user:management":"Manage user-scoped resources and saved configuration (internal).","watchlist:information":"View your watchlists and their symbols.","watchlist:management":"Create, update, replace, and delete your watchlists."},"tokenUrl":"https://api.aries.com/v1/oauth2/token"},"clientCredentials":{"refreshUrl":"https://api.aries.com/v1/oauth2/token","scopes":{"account:information":"View account balances, positions, and transaction history","analytics:information":"View analytics, ratings, and market insights","calendar:information":"Access earnings, economic, and market schedule data","market:information":"Access live and historical market data","market:supplemental":"News, company profiles, financials, filings, ETF data, technical analysis","options:information":"Access options chains and expiration data","order:execution":"Place, modify, and cancel orders","order:information":"View order history and status","position:information":"View current positions and holdings","user:information":"View user profile and personal details","user:management":"Manage user-scoped resources and saved configuration (internal).","watchlist:information":"View your watchlists and their symbols.","watchlist:management":"Create, update, replace, and delete your watchlists."},"tokenUrl":"https://api.aries.com/v1/oauth2/token"}},"type":"oauth2","scopes":["order:information"],"schemeName":"OAuth2"}}},"servers":{"f38d7b7f-6d4c-4c3f-8232-2c94a60e51ad":{"description":"Production server","url":"https://api.aries.com"},"421feb2d-ac41-443e-9380-492252b72659":{"description":"Staging server","url":"https://api.tradearies.dev"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"description":"OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.","flows":{"authorizationCode":{"authorizationUrl":"https://app.aries.com/oauth2/authorize","refreshUrl":"https://api.aries.com/v1/oauth2/token","scopes":{"account:information":"View account balances, positions, and transaction history","analytics:information":"View analytics, ratings, and market insights","calendar:information":"Access earnings, economic, and market schedule data","market:information":"Access live and historical market data","market:supplemental":"News, company profiles, financials, filings, ETF data, technical analysis","options:information":"Access options chains and expiration data","order:execution":"Place, modify, and cancel orders","order:information":"View order history and status","position:information":"View current positions and holdings","user:information":"View user profile and personal details","user:management":"Manage user-scoped resources and saved configuration (internal).","watchlist:information":"View your watchlists and their symbols.","watchlist:management":"Create, update, replace, and delete your watchlists."},"tokenUrl":"https://api.aries.com/v1/oauth2/token"},"clientCredentials":{"refreshUrl":"https://api.aries.com/v1/oauth2/token","scopes":{"account:information":"View account balances, positions, and transaction history","analytics:information":"View analytics, ratings, and market insights","calendar:information":"Access earnings, economic, and market schedule data","market:information":"Access live and historical market data","market:supplemental":"News, company profiles, financials, filings, ETF data, technical analysis","options:information":"Access options chains and expiration data","order:execution":"Place, modify, and cancel orders","order:information":"View order history and status","position:information":"View current positions and holdings","user:information":"View user profile and personal details","user:management":"Manage user-scoped resources and saved configuration (internal).","watchlist:information":"View your watchlists and their symbols.","watchlist:management":"Create, update, replace, and delete your watchlists."},"tokenUrl":"https://api.aries.com/v1/oauth2/token"}},"type":"oauth2","scopes":["order:information"],"schemeName":"OAuth2"},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"OAuth2","name":"Authorization"}],"title":"OAuth2"}]},"originalFileLocation":"openapi.json"},"subdomain":"ariesfinancialinc","siteName":"Aries API","title":"List order history - Aries API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T15:46:21.325Z","originalFileLocation":"api-reference/accounts/list-orders-history.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint. Use Case: Fill gaps before today\u0026#x27;s session or export fills for reporting without walking the live cache cursor.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Aries API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"List order history - Aries API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint. Use Case: Fill gaps before today\u0026#x27;s session or export fills for reporting without walking the live cache cursor.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Aries API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://finance.dev/api-reference/accounts/list-orders-history\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ariesfinancialinc.mintlify.app/_mintlify/api/og/v2?division=Accounts\u0026amp;title=List+order+history\u0026amp;description=Paginated+historical+orders+for+an+account+from+PostgreSQL+within+a+date+range+%28up+to+90+days%29.+Always+reads+from+the+database%3B+filtering+excludes+superseded+an\u0026amp;theme=d059c03e4782a17f3aeb5806\u0026amp;signature=1917f1ae57770b72b49616c764f1c19177ae1c244c98105e2abffa6cdc13ab70\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"List order history - Aries API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint. Use Case: Fill gaps before today\u0026#x27;s session or export fills for reporting without walking the live cache cursor.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ariesfinancialinc.mintlify.app/_mintlify/api/og/v2?division=Accounts\u0026amp;title=List+order+history\u0026amp;description=Paginated+historical+orders+for+an+account+from+PostgreSQL+within+a+date+range+%28up+to+90+days%29.+Always+reads+from+the+database%3B+filtering+excludes+superseded+an\u0026amp;theme=d059c03e4782a17f3aeb5806\u0026amp;signature=1917f1ae57770b72b49616c764f1c19177ae1c244c98105e2abffa6cdc13ab70\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/ariesfinancialinc/ylnD03T0GOb_wvQC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Aries API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0BAA5E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://finance.dev/api-reference/accounts/list-orders-history\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/accounts/list-orders-history.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://finance.dev/#organization\",\"name\":\"Aries API\",\"url\":\"https://finance.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ariesfinancialinc/RAN-JEltzDnib-_A/logo/light.svg?fit=max\u0026auto=format\u0026n=RAN-JEltzDnib-_A\u0026q=85\u0026s=4eae127cdf55bb09159d2b5a625690e3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://finance.dev#website\",\"name\":\"Aries API\",\"url\":\"https://finance.dev\",\"publisher\":{\"@id\":\"https://finance.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://finance.dev/api-reference/accounts/list-orders-history#webpage\",\"url\":\"https://finance.dev/api-reference/accounts/list-orders-history\",\"name\":\"List order history\",\"description\":\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint. Use Case: Fill gaps before today's session or export fills for reporting without walking the live cache cursor.\",\"dateModified\":\"2026-10-21T15:46:21.325Z\",\"isPartOf\":{\"@id\":\"https://finance.dev#website\"},\"breadcrumb\":{\"@id\":\"https://finance.dev/api-reference/accounts/list-orders-history#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://finance.dev/api-reference/accounts/list-orders-history#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accounts\",\"item\":\"https://finance.dev/api-reference/accounts/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"List order history\",\"item\":\"https://finance.dev/api-reference/accounts/list-orders-history\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://finance.dev/api-reference/accounts/list-orders-history#apireference\",\"headline\":\"List order history\",\"name\":\"List order history\",\"description\":\"Paginated historical orders for an account from PostgreSQL within a date range (up to 90 days). Always reads from the database; filtering excludes superseded and failed rows. Optional exclude_today avoids overlap with the active-orders v2 endpoint. Use Case: Fill gaps before today's session or export fills for reporting without walking the live cache cursor.\",\"url\":\"https://finance.dev/api-reference/accounts/list-orders-history\",\"mainEntityOfPage\":{\"@id\":\"https://finance.dev/api-reference/accounts/list-orders-history#webpage\"},\"dateModified\":\"2026-10-21T15:46:21.325Z\",\"publisher\":{\"@id\":\"https://finance.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://finance.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Aries API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Aries API","nav":{"global":null,"tabs":[{"tab":"Welcome","icon":"house","pages":[{"title":"Welcome","href":"/welcome"}]},{"tab":"Quick Start","icon":"rocket","pages":[{"title":"Quick Start","href":"/api-reference/quickstart"}]},{"tab":"Auth","icon":"shield-halved","pages":[{"title":"Auth","href":"/api-reference/oauth2/overview"}]},{"tab":"Core API","icon":"bolt","pages":[{"title":"API Reference","href":"/api-reference"},{"group":"Users","pages":[{"title":"Get User Info","openapi":"openapi.json GET /v1/users/info","href":"/api-reference/user/info"}]},{"group":"Accounts","pages":[{"group":"Guide","pages":[{"title":"Account Info","href":"/api-reference/accounts/overview"}]},{"title":"User Accounts","openapi":"openapi.json GET /v2/users/me/accounts","href":"/api-reference/accounts/user-accounts"},{"title":"Today's Orders","description":"Paginated active orders for an account from the trade read service: open orders plus today's terminal activity. Default source is the v2 cache; optional PostgreSQL reads use the same domain order shape as WebSocket updates.\n\n**Use Case:** Drive a live blotter or reconcile REST snapshots with `accUpdates` by merging on `clOrdId`.\n","openapi":"openapi.json GET /v2/accounts/{id}/orders","href":"/api-reference/accounts/list-active-orders"},{"title":"List order history","openapi":"openapi.json GET /v2/accounts/{id}/orders/history","href":"/api-reference/accounts/list-orders-history"},{"title":"Account Positions","description":"Retrieve all open positions for a specific trading account including quantity, cost basis, current market value, and unrealized profit/loss. Track portfolio holdings and performance metrics in real-time.\n\n**Use Case:** Display a portfolio summary with current positions, P\u0026L, and percentage gains/losses for each holding.\n","openapi":"openapi.json GET /v1/accounts/{id}/positions","href":"/api-reference/accounts/positions"},{"title":"Account Balance","openapi":"openapi.json GET /v2/accounts/{id}/balance","href":"/api-reference/accounts/balance"}]},{"group":"Orders","pages":[{"group":"Guide","pages":[{"title":"Order Flow","href":"/api-reference/orders/order-flow"},{"title":"Market Order","href":"/api-reference/orders/market-order"},{"title":"Limit Order","href":"/api-reference/orders/limit-order"},{"title":"Stop Order","href":"/api-reference/orders/stop-order"},{"title":"Stop-Limit Order","href":"/api-reference/orders/stop-limit-order"},{"title":"Single-Leg Option Order","href":"/api-reference/orders/single-leg-option"},{"title":"Multi-Leg Option Order","href":"/api-reference/orders/multi-leg-option"}]},{"title":"Place Order","openapi":"openapi.json POST /v1/orders","href":"/api-reference/orders/place-order"},{"title":"Replace Order","openapi":"openapi.json POST /v1/orders/replace","href":"/api-reference/orders/update-order"},{"title":"Cancel Order","openapi":"openapi.json POST /v1/orders/cancel","href":"/api-reference/orders/cancel-order"},{"title":"Preview Order","openapi":"openapi.json POST /v1/orders/preview","href":"/api-reference/orders/preview-order"}]},{"group":"Market Data","pages":[{"group":"Guide","pages":[{"title":"Market Data","href":"/api-reference/marketdata/overview"}]},{"title":"Search Symbols","openapi":"openapi.json GET /v1/marketdata/search","href":"/api-reference/marketdata/search"},{"title":"Equity Details","openapi":"openapi.json GET /v1/marketdata/equities/details","href":"/api-reference/marketdata/equity-details"},{"title":"Options Details","openapi":"openapi.json GET /v1/marketdata/options/details","href":"/api-reference/marketdata/options-details"},{"title":"Easy-to-Borrow List","openapi":"openapi.json GET /v1/etb","href":"/api-reference/marketdata/easy-to-borrow-list"},{"title":"Easy-to-Borrow Search","openapi":"openapi.json POST /v1/etb/search","href":"/api-reference/marketdata/easy-to-borrow-search"}]},{"group":"Watchlist","pages":[{"title":"Create Watchlist","openapi":"openapi.json POST /v1/config/watchlist","href":"/api-reference/watchlist/create-watchlist"},{"title":"List Watchlists","openapi":"openapi.json GET /v1/config/watchlist","href":"/api-reference/watchlist/list-watchlists"},{"title":"Get Watchlist","openapi":"openapi.json GET /v1/config/watchlist/{watchlist_id}","href":"/api-reference/watchlist/get-watchlist"},{"title":"Update Watchlist","openapi":"openapi.json PATCH /v1/config/watchlist/{watchlist_id}","href":"/api-reference/watchlist/update-watchlist"},{"title":"Delete Watchlist","openapi":"openapi.json DELETE /v1/config/watchlist/{watchlist_id}","href":"/api-reference/watchlist/delete-watchlist"},{"title":"Replace All Watchlists","openapi":"openapi.json PUT /v1/config/watchlist","href":"/api-reference/watchlist/replace-watchlists"}]},{"group":"Chart","pages":[{"title":"Chart Configuration","openapi":"openapi.json GET /v1/chart/config","href":"/api-reference/chart/get-config"},{"title":"Symbol Information","openapi":"openapi.json GET /v1/chart/symbols","href":"/api-reference/chart/get-symbol-info"},{"title":"Historical Bars","openapi":"openapi.json GET /v1/chart/history","href":"/api-reference/chart/get-historical-bars"},{"title":"Tick-Based Chart Data","openapi":"openapi.json GET /v1/chart/tick-history","href":"/api-reference/chart/get-tick-history"},{"title":"Server Time","openapi":"openapi.json GET /v1/chart/time","href":"/api-reference/chart/get-server-time"},{"title":"Search Symbols","openapi":"openapi.json GET /v1/chart/search","href":"/api-reference/chart/search-symbols"},{"title":"Quotes","openapi":"openapi.json GET /v1/chart/quotes","href":"/api-reference/chart/get-quotes"}]}]},{"tab":"Supplemental API","icon":"chart-mixed","pages":[{"title":"Supplemental API","href":"/supplemental-api/overview"}]},{"tab":"Prediction API","icon":"landmark","pages":[{"title":"Prediction API","href":"/prediction-api/overview"}]},{"tab":"Streaming API","icon":"satellite-dish","pages":[{"title":"Streaming API","href":"/websockets/overview"}]},{"tab":"AI Agents","icon":"robot","pages":[{"title":"AI Agents","href":"/ai-agents/add-skill"}]},{"tab":"MCP Auth","icon":"plug","pages":[{"title":"MCP Auth","href":"/mcp-auth"}]},{"tab":"SDKs","icon":"code","pages":[{"title":"SDKs","href":"/sdks/overview"}]},{"tab":"Changelog","icon":"newspaper","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"List order history - Aries API","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C8RPHPxo.js","utils-0BK-9q6z.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DfjzsUJT.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B4v9psJ4.js","snippetPresets-CpTQv-Ez.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BNP-Fvr0.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BSgu6h1D.js","shallow-Biv1i9Gs.js","getApiPlaygroundDisplay-BoGOXhtF.js","CodeSnippet-DvQoT18_.js","CodeSnippets-Dnpa15xT.js","Page-Buji1S4J.js","getPastedJson-xAIyhUFE.js","icon-S6FBih11.js","MethodPill-SaYeUZyk.js","DuplicateIcon-Cs-p3v2Q.js","createIcon-DjCFEoHq.js","DynamicMarkdown-BcnBltEQ.js","SectionHeading-BUBl0eEF.js","axios-vUo_bRtp.js","Markdown-h4cOoD8d.js","clsx-B2v50t8t.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DJnKvr0g.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BHrrjR1K.js"]}