The access endpoint tells you whether a customer is entitled to use a product — either because they have an active subscription or because they made a confirmed one-time payment. This is the check the AI SDK, LangChain, and UploadThing adapters run automatically, but you can call it directly from your own server-side logic.
Check access
GET /customers/{customer_id}/access/{product_id}Returns whether the customer has access to the product and the reason why.
Whether the customer is entitled to use the product.
object | null
The reason access was granted. null when has_access is false.
Show grant fields
"subscription" | "one_time"
What kind of entitlement granted access.
string
Present when type is "subscription". The subscription that is active.
string
Present when type is "subscription". The subscription status (active, trialing, or paused). Subscriptions scheduled to cancel remain active until current_period_end.
string
Present when type is "one_time". The confirmed payment that granted access.
SDK usage
The @stellartools/core SDK exposes this as customers.access.verify(customerId, productId):
import { StellarTools } from "@stellartools/core";const stellar = new StellarTools({ api_key: process.env.STELLAR_TOOLS_API_KEY! });const { has_access, grant } = await stellar.customers.access.verify("cus_xxx", "prod_xxx");if (!has_access) { throw new Error("Customer does not have access to this product");}// grant.type tells you whether it's a subscription or one-time paymentif (grant?.type === "subscription") { console.log("Active subscription:", grant.subscription_id);}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Stellar Tools","description":"The financial infrastructure for the Stellar economy.","colors":{"primary":"#fdda24","light":"#fdda24","dark":"#fdda24"},"logo":{"light":"https://mintcdn.com/stellartools/6QFNlsXpo-KxOhhW/logo/logo-light.png?fit=max\u0026auto=format\u0026n=6QFNlsXpo-KxOhhW\u0026q=85\u0026s=6fc8e21e1a593b8168867e6b6dcd611b","dark":"https://mintcdn.com/stellartools/6QFNlsXpo-KxOhhW/logo/logo-dark.png?fit=max\u0026auto=format\u0026n=6QFNlsXpo-KxOhhW\u0026q=85\u0026s=60ac1f88d0beef40036b24d52ba2cfb3"},"favicon":"https://mintcdn.com/stellartools/6QFNlsXpo-KxOhhW/favicon.ico?fit=max\u0026auto=format\u0026n=6QFNlsXpo-KxOhhW\u0026q=85\u0026s=61b116399ef0d4404904dcecdb94a842","navbar":{"links":[{"href":"mailto:odii@stellartools.dev","label":"Support"}],"primary":{"type":"button","label":"Sign Up Free","href":"https://dashboard.stellartools.dev/signup"}},"footer":{"socials":{"x":"https://x.com/payrouteshq","github":"https://github.com/payrouteshq/stellartools","linkedin":"https://www.linkedin.com/company/payrouteshq"}},"fonts":{"heading":{"family":"Instrument Serif"},"body":{"family":"DM Sans"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Documentation","icon":"book-open-cover","href":"/docs"},{"anchor":"Home","icon":"house","href":"/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stellartools","hasAudioNarration":false,"actualSubdomain":"stellartools","customDomains":["docs.stellartools.dev"],"gitSource":{"type":"github","owner":"payrouteshq","repo":"stellartools","deployBranch":"main","contentDirectory":"apps/web/app/landing/docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae955f06532f6ede4e9cdc0:success","clientVersion":"0.0.4410","searchFilterCounts":[{"language":"default","tag":"Documentation","count":15},{"language":"default","tag":"API Reference","count":13},{"language":"default","tag":"Resources","count":9},{"language":"default","tag":"Integrations","count":8},{"language":"default","tag":"Marketplace","count":3},{"language":"default","tag":"Getting Started","count":2},{"language":"default","tag":"Reference Data","count":2},{"language":"default","tag":"Overview","count":2},{"language":"default","tag":"Concepts","count":1},{"language":"default","tag":"Webhooks","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":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":"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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api-reference/usage","slug":"/api-reference/usage","pageMetadata":{"title":"Access","description":"Check whether a customer can access a product","href":"/api-reference/usage"},"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: \"Check whether a customer can access a product\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The access endpoint tells you whether a customer is entitled to use a product — either because they have an active subscription or because they made a confirmed one-time payment. This is the check the AI SDK, LangChain, and UploadThing adapters run automatically, but you can call it directly from your own server-side logic.`}),`\n`,_jsx(Heading,{level:`2`,id:`check-access`,children:`Check access`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`GET /customers/{customer_id}/access/{product_id}`})}),`\n`,_jsx(_components.p,{children:`Returns whether the customer has access to the product and the reason why.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,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:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.stellartools.dev/customers/cus_01jx.../access/prod_01jx... \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-api-key: YOUR_API_KEY\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,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:` \"has_access\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_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:` \"grant\"`}),_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:`\"subscription\"`}),_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:` \"subscription_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sub_01jx...\"`}),_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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`})]}),`\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`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,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:` \"has_access\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_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:` \"grant\"`}),_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:`\"one_time\"`}),_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:` \"payment_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pay_01jx...\"`})]}),`\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`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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:` \"has_access\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_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:` \"grant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`has_access`,type:`boolean`,id:`param-has-access`,children:_jsx(_components.p,{children:`Whether the customer is entitled to use the product.`})}),`\n`,_jsxs(ResponseField,{name:`grant`,type:`object | null`,id:`param-grant`,children:[_jsxs(_components.p,{children:[`The reason access was granted. `,_jsx(_components.code,{children:`null`}),` when `,_jsx(_components.code,{children:`has_access`}),` is false.`]}),_jsxs(Expandable,{title:`grant fields`,children:[_jsx(ResponseField,{name:`type`,type:`\"subscription\" | \"one_time\"`,id:`param-type`,children:_jsx(_components.p,{children:`What kind of entitlement granted access.`})}),_jsx(ResponseField,{name:`subscription_id`,type:`string`,id:`param-subscription-id`,children:_jsxs(_components.p,{children:[`Present when `,_jsx(_components.code,{children:`type`}),` is `,_jsx(_components.code,{children:`\"subscription\"`}),`. The subscription that is active.`]})}),_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[`Present when `,_jsx(_components.code,{children:`type`}),` is `,_jsx(_components.code,{children:`\"subscription\"`}),`. The subscription status (`,_jsx(_components.code,{children:`active`}),`, `,_jsx(_components.code,{children:`trialing`}),`, or `,_jsx(_components.code,{children:`paused`}),`). Subscriptions scheduled to cancel remain `,_jsx(_components.code,{children:`active`}),` until `,_jsx(_components.code,{children:`current_period_end`}),`.`]})}),_jsx(ResponseField,{name:`payment_id`,type:`string`,id:`param-payment-id`,children:_jsxs(_components.p,{children:[`Present when `,_jsx(_components.code,{children:`type`}),` is `,_jsx(_components.code,{children:`\"one_time\"`}),`. The confirmed payment that granted access.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`sdk-usage`,children:`SDK usage`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`@stellartools/core`}),` SDK exposes this as `,_jsx(_components.code,{children:`customers.access.verify(customerId, productId)`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { StellarTools } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@stellartools/core\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` stellar = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` StellarTools({ api_key: process.env.STELLAR_TOOLS_API_KEY! });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { has_access, grant } = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` stellar.customers.access.verify(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cus_xxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"prod_xxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (!has_access) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Error(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Customer does not have access to this product\"`}),_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`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// grant.type tells you whether it's a subscription or one-time payment`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (grant?.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"subscription\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Active subscription:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, grant.subscription_id);`})]}),`\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":"Access","description":"Check whether a customer can access a product","href":"/api-reference/usage"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Check access","slug":"check-access","depth":2,"children":[{"title":"Response","slug":"response","depth":3,"children":[]}]},{"title":"SDK usage","slug":"sdk-usage","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"stellartools","siteName":"Stellar Tools","title":"Access - Stellar Tools","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-06T11:04:10.908Z","originalFileLocation":"api-reference/usage.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=\"Check whether a customer can access a product\">\u003cmeta data-mint-head name=\"application-name\" content=\"Stellar Tools\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_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/stellartools/lTnCwp1BURIiKMuc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Access - Stellar Tools\">\u003cmeta data-mint-head property=\"og:description\" content=\"Check whether a customer can access a product\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Stellar Tools\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.stellartools.dev/api-reference/usage\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://stellartools.mintlify.site/_mintlify/api/og/v2?division=Resources\u0026amp;title=Access\u0026amp;description=Check+whether+a+customer+can+access+a+product\u0026amp;theme=1a89815e54c49c06d60704c1\u0026amp;signature=c68d2096630c3c44836f0e8071d59edcfba2999bfd7f3df54f501e2eb20bf1f6\">\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=\"Access - Stellar Tools\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Check whether a customer can access a product\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://stellartools.mintlify.site/_mintlify/api/og/v2?division=Resources\u0026amp;title=Access\u0026amp;description=Check+whether+a+customer+can+access+a+product\u0026amp;theme=1a89815e54c49c06d60704c1\u0026amp;signature=c68d2096630c3c44836f0e8071d59edcfba2999bfd7f3df54f501e2eb20bf1f6\">\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/stellartools/lTnCwp1BURIiKMuc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Stellar Tools\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#fdda24\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.stellartools.dev/api-reference/usage\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/usage.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.stellartools.dev/#organization\",\"name\":\"Stellar Tools\",\"url\":\"https://docs.stellartools.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stellartools/6QFNlsXpo-KxOhhW/logo/logo-light.png?fit=max\u0026auto=format\u0026n=6QFNlsXpo-KxOhhW\u0026q=85\u0026s=6fc8e21e1a593b8168867e6b6dcd611b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.stellartools.dev#website\",\"name\":\"Stellar Tools\",\"url\":\"https://docs.stellartools.dev\",\"publisher\":{\"@id\":\"https://docs.stellartools.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.stellartools.dev/api-reference/usage#webpage\",\"url\":\"https://docs.stellartools.dev/api-reference/usage\",\"name\":\"Access\",\"description\":\"Check whether a customer can access a product\",\"dateModified\":\"2026-07-06T11:04:10.908Z\",\"isPartOf\":{\"@id\":\"https://docs.stellartools.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.stellartools.dev/api-reference/usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.stellartools.dev/api-reference/usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Resources\",\"item\":\"https://docs.stellartools.dev/api-reference/customers\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Access\",\"item\":\"https://docs.stellartools.dev/api-reference/usage\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.stellartools.dev/api-reference/usage#article\",\"headline\":\"Access\",\"name\":\"Access\",\"description\":\"Check whether a customer can access a product\",\"url\":\"https://docs.stellartools.dev/api-reference/usage\",\"mainEntityOfPage\":{\"@id\":\"https://docs.stellartools.dev/api-reference/usage#webpage\"},\"dateModified\":\"2026-07-06T11:04:10.908Z\",\"publisher\":{\"@id\":\"https://docs.stellartools.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.stellartools.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Stellar Tools\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Stellar Tools\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/usage.md","siteName":"Stellar Tools","nav":{"global":{"anchors":[{"anchor":"Documentation","icon":"book-open-cover","href":"/docs"},{"anchor":"Home","icon":"house","href":"/"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"}]},{"group":"Resources","pages":[{"title":"Customers","href":"/api-reference/customers"},{"title":"Customer Portal","href":"/api-reference/portal"},{"title":"Products","href":"/api-reference/products"},{"title":"Checkouts","href":"/api-reference/checkouts"},{"title":"Subscriptions","href":"/api-reference/subscriptions"},{"title":"Payments","href":"/api-reference/payments"},{"title":"Refunds","href":"/api-reference/refunds"},{"title":"Webhooks","description":"Create and manage webhook endpoints","href":"/api-reference/webhooks"},{"title":"Access","href":"/api-reference/usage"}]},{"group":"Reference Data","pages":[{"title":"Assets","description":"Query supported Stellar assets","href":"/api-reference/assets"},{"title":"Currencies","href":"/api-reference/currencies"}]}]}]},"basePath":"","title":"Access - Stellar Tools","deploymentId":"dpl_3VZr4zL4q2wbintGwWjSCGUgnuP7","buildId":"dpl_3VZr4zL4q2wbintGwWjSCGUgnuP7","dynamics":[],"chunks":[]}