# Sorai Docs - Developers: Build on Sorai from code - Guides: CLI, sorai-js and MCP - [Introduction](/): Build on Sorai, where creators sell digital products. - **CLI** - [Overview](/cli): Run your Sorai store from the terminal with the sorai CLI. - [Quickstart](/cli/quickstart): Install the CLI, sign in, and put a product and its page on sale. - Command reference - [Command reference](/cli/commands): Every sorai command, with its flags and the key permissions it needs. - [sorai login](/cli/commands/login): Sign in with a secret key (ssk_...) from the API keys page of your Sorai console. - [sorai logout](/cli/commands/logout): Forget the saved key on this machine. - auth - [sorai auth status](/cli/commands/auth/status): Show the signed-in key: its name, prefix, scopes and stores, the default store, and whether it came from the saved login or SORAI_API_KEY. - [sorai whoami](/cli/commands/whoami): Show the key's name, scopes and stores, and the API it acts on. - stores - [sorai stores list](/cli/commands/stores/list): List the stores this key's organization runs, with each store's id, slug, name, currency and status. - [sorai stores get](/cli/commands/stores/get): Get one store's settings: theme, notifications, enabled payment methods and tracking pixels. - products - [sorai products list](/cli/commands/products/list): List a store's products, newest first, with the total for paging. - [sorai products get](/cli/commands/products/get): Get one product: its fields, selling content and fulfilment settings. - [sorai products create](/cli/commands/products/create): Create a product. - [sorai products files](/cli/commands/products/files): List the files buyers get from a product, with each one's status. - [sorai products delete-file](/cli/commands/products/delete-file): Remove a file from a product. - [sorai products update](/cli/commands/products/update): Change some of a product's fields. - [sorai products archive](/cli/commands/products/archive): Take a product off sale. - [sorai products upload-file](/cli/commands/products/upload-file): Upload a file buyers get after paying, such as an ebook or a zip, to a product. - prices - [sorai prices list](/cli/commands/prices/list): List a product's prices. - [sorai prices create](/cli/commands/prices/create): Add a price to a product. - [sorai prices update](/cli/commands/prices/update): Change some of a price's fields. - [sorai prices delete](/cli/commands/prices/delete): Remove a price from a product. - media - [sorai media list](/cli/commands/media/list): List a store's uploaded images, newest first. - [sorai media upload](/cli/commands/media/upload): Upload an image (JPEG, PNG, WebP or GIF, up to 20 MB) to the store's media library. - courses - [sorai courses get](/cli/commands/courses/get): Get a course product's sections and lessons in order, with each lesson's file status. - [sorai courses add-section](/cli/commands/courses/add-section): Add a section to the end of a course. - [sorai courses rename-section](/cli/commands/courses/rename-section): Change a section's title. - [sorai courses delete-section](/cli/commands/courses/delete-section): Delete a section and every lesson in it. - [sorai courses add-lesson](/cli/commands/courses/add-lesson): Add a lesson to the end of a section. - [sorai courses update-lesson](/cli/commands/courses/update-lesson): Change some of a lesson's fields, such as published. - [sorai courses delete-lesson](/cli/commands/courses/delete-lesson): Delete a lesson. - bundles - [sorai bundles list](/cli/commands/bundles/list): List the products inside a bundle. - [sorai bundles add](/cli/commands/bundles/add): Put a product from the same store into a bundle. - [sorai bundles update](/cli/commands/bundles/update): Change a component's quantity or position. - [sorai bundles remove](/cli/commands/bundles/remove): Take a product out of a bundle. - orders - [sorai orders list](/cli/commands/orders/list): List a store's orders, newest first, with the total for paging. - [sorai orders get](/cli/commands/orders/get): Get one order, with the buyer, attribution and payment detail. - checkout - [sorai checkout create](/cli/commands/checkout/create): Open a checkout link for one price of an active product, to send to a buyer. - pages - [sorai pages list](/cli/commands/pages/list): List a store's pages with their slug, kind and publish state. - [sorai pages get](/cli/commands/pages/get): Get one page: its slug, kind, SEO metadata and header and footer setting. - [sorai pages update](/cli/commands/pages/update): Change a page's slug, kind, SEO metadata or header and footer setting. - [sorai pages create](/cli/commands/pages/create): Create a page as an unpublished draft with no content yet. - analytics - [sorai analytics overview](/cli/commands/analytics/overview): Revenue by currency, orders, visitors, and the view, checkout and purchase funnel for a date range. - [sorai guide](/cli/commands/guide): Print a Markdown guide to every command and flag, for AI agents. - [sorai version](/cli/commands/version): Print the version of sorai. - **sorai-js** - [Overview](/sorai-js): The browser runtime that opens checkout, records attribution and tracks events on a Sorai store page. - [Opening checkout](/sorai-js/checkout): Open Sorai checkout from any element, fill hidden fields, and react when the buyer pays. - [Custom elements](/sorai-js/elements): Buy buttons, prices and product links in plain HTML, with no JavaScript of your own. - [Events and attribution](/sorai-js/events): What sorai-js sends, where it sends it, and how a sale gets credited to the campaign that earned it. - [Reading products](/sorai-js/products): Load a product's public data and show its prices correctly in any currency. - [Reference](/sorai-js/reference): Every method and type sorai-js exposes. - **MCP** - [Coming soon](/mcp): Connect an AI assistant to your Sorai store over the Model Context Protocol. - API reference: Endpoints and webhooks - [Overview](/api): The public Sorai API, how to authenticate, and how to try it from these pages. - [Webhooks](/api/webhooks): Get order and buyer events from Sorai as they happen, and verify that each one came from Sorai. - Storefront - [The store's affiliate offer, for its own join page](/api/reference/storefront/get-affiliate-program) - [Get a page's published display](/api/reference/storefront/get-page-display) - [Get the browser-safe subset of a store](/api/reference/storefront/get-store) - [List a store's pages, optionally filtered by slug](/api/reference/storefront/list-pages) - [Report a store to Sorai](/api/reference/storefront/report-store) - [Resolve a hostname or store id to its store](/api/reference/storefront/resolve-host) - Catalog - [Get a short-lived media URL for a free-preview lesson](/api/reference/catalog/get-course-lesson-media) - [Redirect to a media asset at a given width](/api/reference/catalog/get-media-width) - [Redirect to a media asset](/api/reference/catalog/get-media) - [Get one active product by its store-scoped slug](/api/reference/catalog/get-product) - [Batch-fetch active products by id](/api/reference/catalog/list-products) - Payments - [The payment rails this store can offer for a currency](/api/reference/payments/list-payment-methods) - Checkout - [Accept a post-payment offer, creating a second order](/api/reference/checkout/accept-checkout-offer) - [Ask for the order a checkout retry is walking away from to be cancelled](/api/reference/checkout/cancel-order) - [Create an order and its payment session](/api/reference/checkout/create-checkout) - [Get the store's checkout form](/api/reference/checkout/get-checkout-form) - [What a checkout link opened by the merchant's server sells](/api/reference/checkout/get-checkout-session) - [Poll one order, with the token returned from checkout](/api/reference/checkout/get-order-status) - [Read what a link back to an unpaid order fills in](/api/reference/checkout/recover-checkout) - [Stop reminder emails about unpaid orders from one store](/api/reference/checkout/unsubscribe-recovery) - Library - [Exchange a magic-link token for a library session cookie](/api/reference/library/create-library-session) - [Sign out of the library everywhere](/api/reference/library/delete-library-session) - [Redeem a download token for the file](/api/reference/library/download) - [A purchased course, with the buyer's own progress](/api/reference/library/get-library-course) - [Get a short-lived media URL for a purchased lesson](/api/reference/library/get-library-lesson-media) - [Everything the signed-in buyer owns](/api/reference/library/get-library) - [Email a buyer a link back into their library](/api/reference/library/request-library-magic-link) - [Record the buyer's position on a lesson](/api/reference/library/write-lesson-progress) - Licenses - [Claim one activation slot for an instance](/api/reference/licenses/activate-license) - [Check whether a license key is good](/api/reference/licenses/verify-license) - Tracking - [Record one tracking event (page view, checkout step, custom)](/api/reference/tracking/ingest-event) - Help Center: Run your store from the console - [Help Center](/help): Set up your store, sell your work and get paid, all from the Sorai console. - **Getting started** - [Getting started](/help/getting-started): Create your account, set up your first store and learn your way around the console. - [Create your account](/help/getting-started/create-your-account): Sign up for Sorai with Google or with your email address. - [Set up your store](/help/getting-started/set-up-your-store): Name your business, choose where it is based, and create your first store. - [Find your way around](/help/getting-started/find-your-way-around): The top bar, the sidebar, and the banners that ask you to act. - [Dashboard](/help/getting-started/dashboard): Your setup checklist, then revenue, traffic and recent orders for one store. - [Stores](/help/getting-started/stores): Switch between stores and create another one in your organization. - **Products** - [Products](/help/products): What you sell, how each type reaches your buyer, and who can see it. - [Create a product](/help/products/create-a-product): Pick what you're selling, fill in its page, and put it on sale. - [Prices and editions](/help/products/prices): Set what a product costs, let buyers choose the amount, or sell it in more than one edition. - [Files and delivery](/help/products/files-and-delivery): Give each type of product what the buyer receives after they pay. - [Courses](/help/products/courses): Build a course from sections and lessons, and see how far buyers get. - [Checkout offers](/help/products/offers): Offer one more product at checkout, and a follow-up right after payment. - [Discount codes](/help/products/discount-codes): Give buyers a percentage or a fixed amount off when they type a code at checkout. - [Media](/help/products/media): Upload the images for your products and pages, and see where each one is used. - **Pages and your shop** - [Pages and your shop](/help/pages): Build the pages buyers land on, publish your homepage and make the shop look like yours. - [Create a page](/help/pages/create-a-page): Start a page with AI, from a template, or from a blank page. - [The page builder](/help/pages/page-builder): Add blocks, edit what they say and how they look, and preview the page. - [AI assistant](/help/pages/ai-assistant): Have a page drafted for you, then ask for changes in your own words. - [Publish your shop](/help/pages/publish-your-shop): Put a page live, choose your homepage, and take a page down. - [Theme and colours](/help/pages/theme): Set the fonts, colours and corners your whole shop uses, then override them where you need to. - [Store settings](/help/pages/store-settings): Your store's name, logo, language, currency, payment methods and branding. - [Add a custom domain](/help/pages/custom-domains): Serve your shop and checkout from a domain you own. - **Selling** - [Selling](/help/selling): Shape how buyers pay, win back unpaid checkouts and measure what brings sales in. - [Set up checkout](/help/selling/checkout): Choose the questions your checkout asks and where buyers land after they pay. - [Payment methods](/help/selling/payment-methods): Choose what your buyers can pay with, and who pays the payment fee. - [Unpaid checkouts](/help/selling/abandoned-checkouts): Win back buyers who started a checkout and left without paying. - [Tracking pixels](/help/selling/tracking): Send your store's purchases to Meta, TikTok and Google Analytics, and load Google Tag Manager. - [Sale alerts and webhooks](/help/selling/integrations): Get told about each paid order by email or Telegram, or send order events to your own tools. - **Orders** - [Orders](/help/orders): Find every purchase from your store, filter the list and export it. - [Order details](/help/orders/order-details): What one order shows you, from the items and payment to what the buyer received. - [Refunds and cancellations](/help/orders/refunds-and-cancellations): Cancel an order that hasn't been paid, or refund one that has. - [What buyers receive](/help/orders/what-buyers-receive): The emails Sorai sends your buyers, and where they find what they bought. - **Money** - [Money](/help/money): How money from your sales reaches your bank, and what you pay Sorai. - [Verify your business](/help/money/verification): Confirm who you are so Sorai can accept payments and pay you out. - [Earnings and payouts](/help/money/earnings-and-payouts): Read your balance and withdraw it to your bank account. - [Plans and billing](/help/money/plans-and-billing): Choose a Sorai plan, pay for it, change or cancel it, and buy AI credits. - [Payment history and receipts](/help/money/receipts): See every payment you have made to Sorai, and print a receipt for each. - **Affiliates** - [Affiliates](/help/affiliates): Pay people a commission for sales they send to your store, or earn one yourself. - [Run an affiliate program](/help/affiliates/run-a-program): Open your store's affiliate program, set its rate, and share the join page. - [Manage your affiliates](/help/affiliates/manage-affiliates): Approve applications, invite affiliates, change their rates, and suspend them. - [Pay your affiliates](/help/affiliates/pay-affiliates): How commission is held and becomes payable, and how to record what you paid. - [My affiliate links](/help/affiliates/my-affiliate-links): Promote another creator's shop, share your link, and follow what you have earned. - [Refer creators](/help/affiliates/refer-creators): Invite other creators to Sorai with your link, and earn a share of what Sorai charges them. - **Your account** - [Your account](/help/account): Your own profile and settings, the organizations you belong to, your team and your API keys. - [Profile and preferences](/help/account/profile-and-preferences): Change your name, email or password, and set your language, appearance and cookie choices. - [Organizations](/help/account/organizations): What an organization is, how to switch between them, and how to create another. - [Members and roles](/help/account/members): Invite people to your organization and choose what each of them can do. - [API keys](/help/account/api-keys): Create a key for the Sorai CLI, the API or sorai.js on your own site, and revoke one you no longer need.