Builds a buy transaction (USDC → $GOLD) and returns it partially-signed by GRAIL. The client must co-sign with the partner wallet and the user wallet, then either call Submit Buy or broadcast directly to a Solana RPC.This endpoint is stateless — no database row is created at quote time. The Trade row is written by the indexer once the transaction confirms on-chain (confirmed or failed).
The partial-signed transaction expires in ~60 seconds (Solana recentBlockhash TTL). If you take too long to co-sign and submit, you’ll get broadcast_failed: Blockhash not found. Re-quote.
Headers
string
required
A valid PARTNER scope key.
Request Body
string
required
GRAIL user ID (prefixed gu_). User must belong to the authenticated partner, be active, and have kyc_level: "full".
number
required
USDC the user will spend, in human decimal (e.g., 100 = 100 USDC). Must be positive.
integer
Slippage tolerance in basis points. Default 50 (0.5%). Ignored if min_gold_out is provided.
number
Absolute minimum $GOLD to receive (human decimal). If supplied, overrides slippage_bps. If omitted, computed as quoted_gold * (10000 - slippage_bps) / 10000.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Oro Grail","colors":{"primary":"#00261c","light":"#00261c","dark":"#00261c"},"favicon":"https://mintcdn.com/oro-a5494d30/CRdlCQgjAt0bkkeb/images/oro-finance-logo.png?fit=max\u0026auto=format\u0026n=CRdlCQgjAt0bkkeb\u0026q=85\u0026s=a8a1d535fb3e82aecf71f61c154492c3","logo":{"light":"https://mintcdn.com/oro-a5494d30/CRdlCQgjAt0bkkeb/images/oro-finance-logo.png?fit=max\u0026auto=format\u0026n=CRdlCQgjAt0bkkeb\u0026q=85\u0026s=a8a1d535fb3e82aecf71f61c154492c3","dark":"https://mintcdn.com/oro-a5494d30/CRdlCQgjAt0bkkeb/images/oro-finance-logo.png?fit=max\u0026auto=format\u0026n=CRdlCQgjAt0bkkeb\u0026q=85\u0026s=a8a1d535fb3e82aecf71f61c154492c3"},"api":{"openapi":"openapi.json","mdx":{"server":"https://grail-stack-dev.onrender.com"}},"appearance":{"default":"light","strict":true},"navbar":{"links":[{"label":"Support","href":"mailto:support@oro.finance"}],"primary":{"type":"button","label":"Get Started","href":"https://grail.oro.finance"}},"footer":{"socials":{"website":"https://oro.finance","discord":"https://discord.gg/kb3buk7pgR","x":"https://x.com/orogoldapp"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"oro-a5494d30","hasAudioNarration":false,"actualSubdomain":"oro-a5494d30","customDomains":["docs.grail.oro.finance"],"gitSource":{"type":"github","owner":"oroweb3","repo":"oro-grail-docs","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae946832b3cf0697cfc9908:success","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"API Reference","count":22},{"language":"default","tag":"Documentation","count":10},{"language":"default","tag":"Grail Overview","count":7},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Trades","count":6},{"language":"default","tag":"Redemptions","count":5},{"language":"default","tag":"Integration Guides","count":5},{"language":"default","tag":"Users","count":3},{"language":"default","tag":"Authentication","count":2},{"language":"default","tag":"Partner","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"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":"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":"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":"editor-metadata","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},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/trades/quote-buy","slug":"/api-reference/trades/quote-buy","pageMetadata":{"title":"Quote Buy","api":"POST /v1/buy","description":"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.","href":"/api-reference/trades/quote-buy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\"\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];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField,Table,Warning}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Builds a buy transaction (USDC → `,_jsx(_components.code,{children:`$GOLD`}),`) and returns it partially-signed by GRAIL. The client must co-sign with the `,_jsx(_components.strong,{children:`partner wallet`}),` and the `,_jsx(_components.strong,{children:`user wallet`}),`, then either call `,_jsx(_components.a,{href:`/api-reference/trades/submit-buy`,children:`Submit Buy`}),` or broadcast directly to a Solana RPC.`]}),`\n`,_jsxs(_components.p,{children:[`This endpoint is stateless — no database row is created at quote time. The `,_jsx(_components.code,{children:`Trade`}),` row is written by the indexer once the transaction confirms on-chain (`,_jsx(_components.code,{children:`confirmed`}),` or `,_jsx(_components.code,{children:`failed`}),`).`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The partial-signed transaction expires in `,_jsx(_components.strong,{children:`~60 seconds`}),` (Solana `,_jsx(_components.code,{children:`recentBlockhash`}),` TTL). If you take too long to co-sign and submit, you’ll get `,_jsx(_components.code,{children:`broadcast_failed: Blockhash not found`}),`. Re-quote.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsxs(_components.p,{children:[`A valid `,_jsx(_components.code,{children:`PARTNER`}),` scope key.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`grail_user_id`,type:`string`,required:true,id:`param-grail-user-id`,children:_jsxs(_components.p,{children:[`GRAIL user ID (prefixed `,_jsx(_components.code,{children:`gu_`}),`). User must belong to the authenticated partner, be `,_jsx(_components.code,{children:`active`}),`, and have `,_jsx(_components.code,{children:`kyc_level: \"full\"`}),`.`]})}),`\n`,_jsx(ParamField,{body:`usdc_amount`,type:`number`,required:true,id:`param-usdc-amount`,children:_jsxs(_components.p,{children:[`USDC the user will spend, in human decimal (e.g., `,_jsx(_components.code,{children:`100`}),` = 100 USDC). Must be positive.`]})}),`\n`,_jsx(ParamField,{body:`slippage_bps`,type:`integer`,id:`param-slippage-bps`,children:_jsxs(_components.p,{children:[`Slippage tolerance in basis points. Default `,_jsx(_components.code,{children:`50`}),` (0.5%). Ignored if `,_jsx(_components.code,{children:`min_gold_out`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`min_gold_out`,type:`number`,id:`param-min-gold-out`,children:_jsxs(_components.p,{children:[`Absolute minimum `,_jsx(_components.code,{children:`$GOLD`}),` to receive (human decimal). If supplied, overrides `,_jsx(_components.code,{children:`slippage_bps`}),`. If omitted, computed as `,_jsx(_components.code,{children:`quoted_gold * (10000 - slippage_bps) / 10000`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`trade_id`,type:`string`,id:`param-trade-id`,children:_jsxs(_components.p,{children:[`Trade identifier, prefixed `,_jsx(_components.code,{children:`trd_`}),`. Use with `,_jsx(_components.a,{href:`/api-reference/trades/submit-buy`,children:`Submit Buy`}),` and `,_jsx(_components.a,{href:`/api-reference/trades/get-trade`,children:`Get Trade`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`side`,type:`string`,id:`param-side`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`\"buy\"`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`quote`,type:`object`,id:`param-quote`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`usdc_amount`,type:`number`,id:`param-usdc-amount-1`,children:_jsx(_components.p,{children:`Input USDC (echo of request).`})}),_jsx(ResponseField,{name:`gold_amount`,type:`number`,id:`param-gold-amount`,children:_jsxs(_components.p,{children:[`Expected `,_jsx(_components.code,{children:`$GOLD`}),` output at quote-time spot price (pre-slippage).`]})}),_jsx(ResponseField,{name:`price_per_troy_oz`,type:`number`,id:`param-price-per-troy-oz`,children:_jsx(_components.p,{children:`Gold spot price in USD per troy ounce at quote time.`})}),_jsx(ResponseField,{name:`fee_bps`,type:`integer`,id:`param-fee-bps`,children:_jsx(_components.p,{children:`Fee rate applied in basis points (derived from the partner’s IntegratorV2 on-chain config).`})}),_jsx(ResponseField,{name:`fee_usd`,type:`number`,id:`param-fee-usd`,children:_jsx(_components.p,{children:`Fee in USDC deducted from the input before swap.`})}),_jsx(ResponseField,{name:`min_gold_out`,type:`number`,id:`param-min-gold-out-1`,children:_jsxs(_components.p,{children:[`Minimum `,_jsx(_components.code,{children:`$GOLD`}),` the tx will accept — slippage floor.`]})})]})}),`\n`,_jsx(ResponseField,{name:`partially_signed_transaction`,type:`string`,id:`param-partially-signed-transaction`,children:_jsx(_components.p,{children:`Base64-encoded Solana transaction, already signed by GRAIL. Co-sign with partner + user and submit.`})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error`})}),_jsx(_components.th,{children:`When`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_request`})}),_jsxs(_components.td,{children:[`Missing or non-positive `,_jsx(_components.code,{children:`usdc_amount`}),`, missing `,_jsx(_components.code,{children:`grail_user_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`kyc_level_insufficient`})}),_jsxs(_components.td,{children:[`User’s KYC level is not `,_jsx(_components.code,{children:`full`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onchain_config_missing`})}),_jsx(_components.td,{children:`Partner’s on-chain config hasn’t been set up yet. Contact ORO.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`wallet_missing`})}),_jsx(_components.td,{children:`Partner has no registered wallet`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`partner_mismatch`})}),_jsx(_components.td,{children:`User belongs to a different partner`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`user_suspended`})}),_jsxs(_components.td,{children:[`User status is `,_jsx(_components.code,{children:`suspended`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`user_not_found`})}),_jsxs(_components.td,{children:[`No user with the given `,_jsx(_components.code,{children:`grail_user_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pricing_unavailable`})}),_jsx(_components.td,{children:`Gold price oracle unreachable or returned stale data`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{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":"Quote Buy","api":"POST /v1/buy","description":"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.","href":"/api-reference/trades/quote-buy"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Builds a buy transaction (USDC → `,_jsx(_components.code,{children:`$GOLD`}),`) and returns it partially-signed by GRAIL. The client must co-sign with the `,_jsx(_components.strong,{children:`partner wallet`}),` and the `,_jsx(_components.strong,{children:`user wallet`}),`, then either call `,_jsx(_components.a,{href:`/api-reference/trades/submit-buy`,children:`Submit Buy`}),` or broadcast directly to a Solana RPC.`]}),`\n`,_jsxs(_components.p,{children:[`This endpoint is stateless — no database row is created at quote time. The `,_jsx(_components.code,{children:`Trade`}),` row is written by the indexer once the transaction confirms on-chain (`,_jsx(_components.code,{children:`confirmed`}),` or `,_jsx(_components.code,{children:`failed`}),`).`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The partial-signed transaction expires in `,_jsx(_components.strong,{children:`~60 seconds`}),` (Solana `,_jsx(_components.code,{children:`recentBlockhash`}),` TTL). If you take too long to co-sign and submit, you’ll get `,_jsx(_components.code,{children:`broadcast_failed: Blockhash not found`}),`. Re-quote.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsxs(_components.p,{children:[`A valid `,_jsx(_components.code,{children:`PARTNER`}),` scope key.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`grail_user_id`,type:`string`,required:true,id:`param-grail-user-id`,children:_jsxs(_components.p,{children:[`GRAIL user ID (prefixed `,_jsx(_components.code,{children:`gu_`}),`). User must belong to the authenticated partner, be `,_jsx(_components.code,{children:`active`}),`, and have `,_jsx(_components.code,{children:`kyc_level: \"full\"`}),`.`]})}),`\n`,_jsx(ParamField,{body:`usdc_amount`,type:`number`,required:true,id:`param-usdc-amount`,children:_jsxs(_components.p,{children:[`USDC the user will spend, in human decimal (e.g., `,_jsx(_components.code,{children:`100`}),` = 100 USDC). Must be positive.`]})}),`\n`,_jsx(ParamField,{body:`slippage_bps`,type:`integer`,id:`param-slippage-bps`,children:_jsxs(_components.p,{children:[`Slippage tolerance in basis points. Default `,_jsx(_components.code,{children:`50`}),` (0.5%). Ignored if `,_jsx(_components.code,{children:`min_gold_out`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`min_gold_out`,type:`number`,id:`param-min-gold-out`,children:_jsxs(_components.p,{children:[`Absolute minimum `,_jsx(_components.code,{children:`$GOLD`}),` to receive (human decimal). If supplied, overrides `,_jsx(_components.code,{children:`slippage_bps`}),`. If omitted, computed as `,_jsx(_components.code,{children:`quoted_gold * (10000 - slippage_bps) / 10000`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`trade_id`,type:`string`,id:`param-trade-id`,children:_jsxs(_components.p,{children:[`Trade identifier, prefixed `,_jsx(_components.code,{children:`trd_`}),`. Use with `,_jsx(_components.a,{href:`/api-reference/trades/submit-buy`,children:`Submit Buy`}),` and `,_jsx(_components.a,{href:`/api-reference/trades/get-trade`,children:`Get Trade`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`side`,type:`string`,id:`param-side`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`\"buy\"`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`quote`,type:`object`,id:`param-quote`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`usdc_amount`,type:`number`,id:`param-usdc-amount-1`,children:_jsx(_components.p,{children:`Input USDC (echo of request).`})}),_jsx(ResponseField,{name:`gold_amount`,type:`number`,id:`param-gold-amount`,children:_jsxs(_components.p,{children:[`Expected `,_jsx(_components.code,{children:`$GOLD`}),` output at quote-time spot price (pre-slippage).`]})}),_jsx(ResponseField,{name:`price_per_troy_oz`,type:`number`,id:`param-price-per-troy-oz`,children:_jsx(_components.p,{children:`Gold spot price in USD per troy ounce at quote time.`})}),_jsx(ResponseField,{name:`fee_bps`,type:`integer`,id:`param-fee-bps`,children:_jsx(_components.p,{children:`Fee rate applied in basis points (derived from the partner’s IntegratorV2 on-chain config).`})}),_jsx(ResponseField,{name:`fee_usd`,type:`number`,id:`param-fee-usd`,children:_jsx(_components.p,{children:`Fee in USDC deducted from the input before swap.`})}),_jsx(ResponseField,{name:`min_gold_out`,type:`number`,id:`param-min-gold-out-1`,children:_jsxs(_components.p,{children:[`Minimum `,_jsx(_components.code,{children:`$GOLD`}),` the tx will accept — slippage floor.`]})})]})}),`\n`,_jsx(ResponseField,{name:`partially_signed_transaction`,type:`string`,id:`param-partially-signed-transaction`,children:_jsx(_components.p,{children:`Base64-encoded Solana transaction, already signed by GRAIL. Co-sign with partner + user and submit.`})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error`})}),_jsx(_components.th,{children:`When`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_request`})}),_jsxs(_components.td,{children:[`Missing or non-positive `,_jsx(_components.code,{children:`usdc_amount`}),`, missing `,_jsx(_components.code,{children:`grail_user_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`kyc_level_insufficient`})}),_jsxs(_components.td,{children:[`User’s KYC level is not `,_jsx(_components.code,{children:`full`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onchain_config_missing`})}),_jsx(_components.td,{children:`Partner’s on-chain config hasn’t been set up yet. Contact ORO.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`wallet_missing`})}),_jsx(_components.td,{children:`Partner has no registered wallet`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`partner_mismatch`})}),_jsx(_components.td,{children:`User belongs to a different partner`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`user_suspended`})}),_jsxs(_components.td,{children:[`User status is `,_jsx(_components.code,{children:`suspended`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`user_not_found`})}),_jsxs(_components.td,{children:[`No user with the given `,_jsx(_components.code,{children:`grail_user_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pricing_unavailable`})}),_jsx(_components.td,{children:`Gold price oracle unreachable or returned stale data`})]})]})]}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`8`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://grail-stack-dev.onrender.com/v1/buy`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: grail_partner_\u003chex>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"grail_user_id\": \"gu_6b60956e-a8ee-4de2-8128-04c7fdf633c3\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"usdc_amount\": 100,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"slippage_bps\": 50`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200 OK`,numberOfLines:`13`,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:`13`,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:` \"trade_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trd_4e7a1b8f-9c32-4a91-b3e6-7f12a8d4c5e9\"`}),_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:`\"buy\"`}),_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:` \"quote\"`}),_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:` \"usdc_amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_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:` \"gold_amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.0205`}),_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_per_troy_oz\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4872.84`}),_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:` \"fee_bps\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_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:` \"fee_usd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.50`}),_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:` \"min_gold_out\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.0204`})]}),`\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:` \"partially_signed_transaction\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AQAAAAABAAEC...\u003cbase64>...\"`})]}),`\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{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":"Quote Buy","api":"POST /v1/buy","description":"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.","href":"/api-reference/trades/quote-buy"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Headers","slug":"headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://grail-stack-dev.onrender.com/v1/buy\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key: grail_partner_\u0026#x3C;hex>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"grail_user_id\": \"gu_6b60956e-a8ee-4de2-8128-04c7fdf633c3\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"usdc_amount\": 100,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"slippage_bps\": 50\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200 OK","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"13\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"trade_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"trd_4e7a1b8f-9c32-4a91-b3e6-7f12a8d4c5e9\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"side\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"buy\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"quote\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usdc_amount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">100\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"gold_amount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.0205\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"price_per_troy_oz\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">4872.84\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"fee_bps\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">50\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"fee_usd\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.50\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"min_gold_out\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.0204\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"partially_signed_transaction\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"AQAAAAABAAEC...\u0026#x3C;base64>...\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Quote Buy","path":"/v1/buy","servers":[{"url":"https://grail-stack-dev.onrender.com"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"x-api-key":{"schema":[{"type":"string","description":"A valid `PARTNER` scope key.","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"grail_user_id":[{"type":"string","description":"GRAIL user ID (prefixed `gu_` ). User must belong to the authenticated partner, be `active` , and have `kyc_level: \"full\"` .","required":true}],"usdc_amount":[{"type":"number","description":"USDC the user will spend, in human decimal (e.g., `100` = 100 USDC). Must be positive.","required":true}],"slippage_bps":[{"type":"integer","description":"Slippage tolerance in basis points. Default `50` (0.5%). Ignored if `min_gold_out` is provided."}],"min_gold_out":[{"type":"number","description":"Absolute minimum `$GOLD` to receive (human decimal). If supplied, overrides `slippage_bps` . If omitted, computed as `quoted_gold * (10000 - slippage_bps) / 10000` ."}]}}],"examples":{"example":{"value":{"grail_user_id":"\u003cstring>","usdc_amount":123,"slippage_bps":123,"min_gold_out":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"trade_id":[{"type":"string","description":"Trade identifier, prefixed `trd_` . Use with Submit Buy and Get Trade ."}],"side":[{"type":"string","description":"Always `\"buy\"` ."}],"quote":[{"type":"object","properties":{"usdc_amount":[{"type":"number","description":"Input USDC (echo of request)."}],"gold_amount":[{"type":"number","description":"Expected `$GOLD` output at quote-time spot price (pre-slippage)."}],"price_per_troy_oz":[{"type":"number","description":"Gold spot price in USD per troy ounce at quote time."}],"fee_bps":[{"type":"integer","description":"Fee rate applied in basis points (derived from the partner’s IntegratorV2 on-chain config)."}],"fee_usd":[{"type":"number","description":"Fee in USDC deducted from the input before swap."}],"min_gold_out":[{"type":"number","description":"Minimum `$GOLD` the tx will accept — slippage floor."}]}}],"partially_signed_transaction":[{"type":"string","description":"Base64-encoded Solana transaction, already signed by GRAIL. Co-sign with partner + user and submit."}]}}],"examples":{"example":{"value":{"trade_id":"\u003cstring>","side":"\u003cstring>","quote":{"usdc_amount":123,"gold_amount":123,"price_per_troy_oz":123,"fee_bps":123,"fee_usd":123,"min_gold_out":123},"partially_signed_transaction":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"oro-a5494d30","siteName":"Oro Grail","title":"Quote Buy - Oro Grail","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-20T10:27:39.304Z","originalFileLocation":"api-reference/trades/quote-buy.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Oro Grail\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Quote Buy - Oro Grail\">\u003cmeta data-mint-head property=\"og:description\" content=\"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Oro Grail\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.grail.oro.finance/api-reference/trades/quote-buy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://oro-a5494d30.mintlify.site/_mintlify/api/og/v2?division=Trades\u0026amp;title=Quote+Buy\u0026amp;description=Stateless+quote+for+buying+%24GOLD+with+USDC.+Returns+a+partially-signed+Solana+transaction+to+co-sign+and+submit.\u0026amp;theme=304c9bec0b792d02be331269\u0026amp;signature=2adaf73da31c61946a8411d61d62907bc9addd43f03230d69c522ede7c929bb0\">\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=\"Quote Buy - Oro Grail\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://oro-a5494d30.mintlify.site/_mintlify/api/og/v2?division=Trades\u0026amp;title=Quote+Buy\u0026amp;description=Stateless+quote+for+buying+%24GOLD+with+USDC.+Returns+a+partially-signed+Solana+transaction+to+co-sign+and+submit.\u0026amp;theme=304c9bec0b792d02be331269\u0026amp;signature=2adaf73da31c61946a8411d61d62907bc9addd43f03230d69c522ede7c929bb0\">\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/oro-a5494d30/zm95Ikh3MBH1y1Nr/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Oro Grail\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00261c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.grail.oro.finance/api-reference/trades/quote-buy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/trades/quote-buy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.grail.oro.finance/#organization\",\"name\":\"Oro Grail\",\"url\":\"https://docs.grail.oro.finance\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/oro-a5494d30/CRdlCQgjAt0bkkeb/images/oro-finance-logo.png?fit=max\u0026auto=format\u0026n=CRdlCQgjAt0bkkeb\u0026q=85\u0026s=a8a1d535fb3e82aecf71f61c154492c3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.grail.oro.finance#website\",\"name\":\"Oro Grail\",\"url\":\"https://docs.grail.oro.finance\",\"publisher\":{\"@id\":\"https://docs.grail.oro.finance/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy#webpage\",\"url\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy\",\"name\":\"Quote Buy\",\"description\":\"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\",\"dateModified\":\"2026-04-20T10:27:39.304Z\",\"isPartOf\":{\"@id\":\"https://docs.grail.oro.finance#website\"},\"breadcrumb\":{\"@id\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Oro Grail\",\"item\":\"https://docs.grail.oro.finance\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quote Buy\",\"item\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy#apireference\",\"headline\":\"Quote Buy\",\"name\":\"Quote Buy\",\"description\":\"Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.\",\"url\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy\",\"mainEntityOfPage\":{\"@id\":\"https://docs.grail.oro.finance/api-reference/trades/quote-buy#webpage\"},\"dateModified\":\"2026-04-20T10:27:39.304Z\",\"publisher\":{\"@id\":\"https://docs.grail.oro.finance/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.grail.oro.finance#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Oro Grail\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Oro Grail\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/trades/quote-buy.md","siteName":"Oro Grail","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/overview"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"API Overview","href":"/api-reference/overview"}]},{"group":"General","pages":[{"title":"Health Check","api":"GET /health","href":"/api-reference/general/health"}]},{"group":"Authentication","pages":[{"title":"Request API Key Challenge","api":"POST /v1/auth/challenge","href":"/api-reference/authentication/request-challenge"},{"title":"Create API Key","api":"POST /v1/auth/api-key","href":"/api-reference/authentication/create-api-key"}]},{"group":"Partner","pages":[{"title":"List API Keys","api":"GET /v1/partner/api-keys","href":"/api-reference/partner/list-api-keys"},{"title":"Revoke API Key","api":"POST /v1/partner/api-keys/{key_id}/revoke","href":"/api-reference/partner/revoke-api-key"}]},{"group":"Users","pages":[{"title":"Create User","api":"POST /v1/users","href":"/api-reference/users/create-user"},{"title":"List Users","api":"GET /v1/users","href":"/api-reference/users/list-users"},{"title":"Get User","api":"GET /v1/users/{grail_user_id}","href":"/api-reference/users/get-user"}]},{"group":"Denominations","pages":[{"title":"List Denominations","api":"GET /v1/denominations","description":"Returns the active physical-gold denominations available for redemption in a given country.","href":"/api-reference/denominations/list-denominations"}]},{"group":"Trades","pages":[{"title":"Quote Buy","api":"POST /v1/buy","href":"/api-reference/trades/quote-buy"},{"title":"Submit Buy","api":"POST /v1/buy/{trade_id}/submit","description":"Broadcasts the fully-signed buy transaction to Solana. Pure passthrough — no database write.","href":"/api-reference/trades/submit-buy"},{"title":"Quote Sell","api":"POST /v1/sell","href":"/api-reference/trades/quote-sell"},{"title":"Submit Sell","api":"POST /v1/sell/{trade_id}/submit","href":"/api-reference/trades/submit-sell"},{"title":"Get Trade","api":"GET /v1/trades/{trade_id}","href":"/api-reference/trades/get-trade"},{"title":"List Trades","api":"GET /v1/trades","href":"/api-reference/trades/list-trades"}]},{"group":"Redemptions","pages":[{"title":"Quote Redemption","api":"POST /v1/redemptions","href":"/api-reference/redemptions/quote-redemption"},{"title":"Submit Redemption","api":"POST /v1/redemptions/{id}/submit","href":"/api-reference/redemptions/submit-redemption"},{"title":"Get Redemption","api":"GET /v1/redemptions/{id}","href":"/api-reference/redemptions/get-redemption"},{"title":"List Redemptions","api":"GET /v1/redemptions","href":"/api-reference/redemptions/list-redemptions"},{"title":"Cancel Redemption","api":"POST /v1/redemptions/{id}/cancel","href":"/api-reference/redemptions/cancel-redemption"}]}]}]},"basePath":"","title":"Quote Buy - Oro Grail","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js"]}