Credits are a prepaid balance that pays for letters. POST /v1/orders with a credit_code redeems from the balance instead of charging a card. There’s no account to manage — the code is the balance.
Under the federal CARD Act, purchased stored value must stay spendable for at least 5 years. Several states are stricter. So a credit account splits into two buckets:
Bucket
Expiry
Spent when
face_cents
5 years
after bonus
bonus_cents
12 months
first
GET /v1/credits/{code} returns both, plus spendable:
POST /v1/credits/checkout creates a checkout session. The credit code is emailed once payment settles, regardless of which mode created the session.By default (checkout_ui_mode: "hosted", or the field omitted entirely) it returns a hosted checkout URL (a paperplane payment link) to redirect to:
Pass checkout_ui_mode: "embedded" and it instead returns an embedded-checkout payment_client_secret to mount in place with initEmbeddedCheckout — for a page (like paperplane’s own /embed widget) that can’t redirect or open a new tab. The response is a discriminated union keyed on checkout_ui_mode: exactly one of payment_url / payment_client_secret is ever present, and the field itself says unambiguously which:
POST /v1/credits/checkout always requires payments to be configured — there is no sandbox flag on this endpoint, and it fails closed with 503 payments_not_configured if STRIPE_SECRET_KEY is unset, regardless of what else the deployment is doing in sandbox. A credit_code on a sandbox order, by contrast, is never actually charged or even looked up — sandbox orders skip payment entirely, so any code (real, fake, or omitted) is accepted. See Sandbox mode.
High-volume or recurring senders who don’t want a card prompt per letter.
Budget controls — top up a fixed amount and it can’t be exceeded.
Gifting or distributing “send N letters” to other people.
Last modified on September 28, 2026
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"paperplane","description":"Letters, Certified Mail and postcards from REST, MCP or the CLI. No API key, no account. Quote, confirm, send.","colors":{"primary":"#1D3FD9","light":"#7A93FF","dark":"#1D3FD9"},"logo":{"light":"https://mintcdn.com/paperplane-524ba6ed/CI1myMp-UEMu_In3/logo/light.svg?fit=max\u0026auto=format\u0026n=CI1myMp-UEMu_In3\u0026q=85\u0026s=f55c736411df18b714c822940c2d1bda","dark":"https://mintcdn.com/paperplane-524ba6ed/CI1myMp-UEMu_In3/logo/dark.svg?fit=max\u0026auto=format\u0026n=CI1myMp-UEMu_In3\u0026q=85\u0026s=22af375831e59b4cdf1c027b5d2c66f3","href":"https://sendpaperplane.com"},"favicon":"https://mintcdn.com/paperplane-524ba6ed/5CDM74Ig-FbdKIpE/favicon.svg?fit=max\u0026auto=format\u0026n=5CDM74Ig-FbdKIpE\u0026q=85\u0026s=ce5eb5f7030b907ba20b5f0f214cfeac","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript","typescript","go","ruby","php","java"],"prefill":true}},"appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#0B0E14"}},"navbar":{"links":[{"href":"https://sendpaperplane.com/send","label":"Send a letter"}],"primary":{"type":"button","label":"Back to paperplane","href":"https://sendpaperplane.com"}},"footer":{"links":[{"header":"Product","items":[{"label":"Send a letter","href":"https://sendpaperplane.com/send"},{"label":"Letter credits","href":"https://sendpaperplane.com/credits"},{"label":"Letter templates","href":"https://sendpaperplane.com/templates"},{"label":"Certified Mail","href":"https://sendpaperplane.com/guides/send-certified-mail-online"}]},{"header":"Developers","items":[{"label":"Docs","href":"/"},{"label":"API reference","href":"/api-reference/mail/price-a-letter-before-sending-it"},{"label":"Changelog","href":"/changelog"},{"label":"Status","href":"https://sendpaperplane.com/status"}]},{"header":"Integrations","items":[{"label":"ChatGPT","href":"https://sendpaperplane.com/integrations/chatgpt"},{"label":"Claude \u0026 MCP","href":"https://sendpaperplane.com/integrations/claude-mcp"},{"label":"Zapier","href":"https://sendpaperplane.com/integrations/zapier"},{"label":"Make","href":"https://sendpaperplane.com/integrations/make"},{"label":"n8n","href":"https://sendpaperplane.com/integrations/n8n"}]},{"header":"Company","items":[{"label":"Help center","href":"https://sendpaperplane.com/help"},{"label":"Contact us","href":"https://sendpaperplane.com/contact"},{"label":"Terms of service","href":"https://sendpaperplane.com/terms"},{"label":"Privacy policy","href":"https://sendpaperplane.com/privacy"}]}]},"seo":{"organization":{"name":"paperplane","url":"https://sendpaperplane.com","logo":"https://sendpaperplane.com/logo/dark.svg"}},"fonts":{"family":"Manrope","weight":400},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":true},"errors":{"404":{"redirect":true,"title":"Page not found"}},"contextual":{"options":["copy","view","claude","chatgpt","grok","aistudio","perplexity","windsurf","cursor","vscode","mcp","add-mcp","download-spec"],"display":"header"},"metadata":{"timestamp":true},"navigation":{"global":{"anchors":[{"anchor":"You're an agent? Start here","icon":"bot","href":"/agents"},{"anchor":"Changelog","icon":"list","href":"/changelog"},{"anchor":"Status","icon":"activity","href":"https://sendpaperplane.com/status"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"paperplane-524ba6ed","hasAudioNarration":false,"actualSubdomain":"paperplane-524ba6ed","customDomains":["paperplane-justin-winter-s-projects.vercel.app"],"gitSource":{"type":"github","owner":"justinwinter","repo":"paperplane","deployBranch":"main","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac06760f8efb5c3b739dff6","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Overview","count":30},{"language":"default","tag":"Guides","count":21},{"language":"default","tag":"API Reference","count":18},{"language":"default","tag":"Mail","count":8},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Credits","count":3},{"language":"default","tag":"Tutorials","count":2},{"language":"default","tag":"Addresses","count":2},{"language":"default","tag":"Meta","count":2},{"language":"default","tag":"Reviews","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"guides/credits","slug":"/guides/credits","pageMetadata":{"title":"Credits","description":"Prepaid balances that pay for letters without a card at every checkout.","sidebarTitle":"Prepaid credits","icon":"coins","href":"/guides/credits"},"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: \"Prepaid balances that pay for letters without a card at every checkout.\"\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`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`what-credits-are`,children:`What credits are`}),`\n`,_jsxs(_components.p,{children:[`Credits are a prepaid balance that pays for letters. `,_jsx(_components.code,{children:`POST /v1/orders`}),` with a `,_jsx(_components.code,{children:`credit_code`}),` redeems from the balance instead of charging a card. There’s no account to manage — the code `,_jsx(_components.em,{children:`is`}),` the balance.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-two-part-balance-card-act`,children:`The two-part balance (CARD Act)`}),`\n`,_jsx(_components.p,{children:`Under the federal CARD Act, purchased stored value must stay spendable for at least 5 years. Several states are stricter. So a credit account splits into two buckets:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Bucket`}),_jsx(_components.th,{children:`Expiry`}),_jsx(_components.th,{children:`Spent when`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`face_cents`})}),_jsx(_components.td,{children:`5 years`}),_jsx(_components.td,{children:`after bonus`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`bonus_cents`})}),_jsx(_components.td,{children:`12 months`}),_jsx(_components.td,{children:`first`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /v1/credits/{code}`}),` returns both, plus `,_jsx(_components.code,{children:`spendable`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://sendpaperplane.com/v1/credits/pp-1a2b-3c4d-5e6f`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_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:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pp-1a2b-3c4d-5e6f\"`}),_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:` \"balance_cents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5500`}),_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:` \"face_cents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5000`}),_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:` \"bonus_cents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`500`}),_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:` \"bonus_expires_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"face_expires_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`balance_cents`}),` is the total spendable now (`,_jsx(_components.code,{children:`face_cents`}),` + unexpired `,_jsx(_components.code,{children:`bonus_cents`}),`) — the number to show a caller checking their balance.`]}),`\n`,_jsx(Heading,{level:`2`,id:`buying-credits`,children:`Buying credits`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /v1/credits/checkout`}),` creates a checkout session. The credit code is `,_jsx(_components.strong,{children:`emailed`}),` once payment settles, regardless of which mode created the session.`]}),`\n`,_jsxs(_components.p,{children:[`By default (`,_jsx(_components.code,{children:`checkout_ui_mode: \"hosted\"`}),`, or the field omitted entirely) it returns a hosted checkout URL (a paperplane payment link) to redirect to:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_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:` \"checkout_ui_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hosted\"`}),_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_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://checkout.stripe.com/...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`checkout_ui_mode: \"embedded\"`}),` and it instead returns an embedded-checkout `,_jsx(_components.code,{children:`payment_client_secret`}),` to mount in place with `,_jsx(_components.code,{children:`initEmbeddedCheckout`}),` — for a page (like paperplane’s own `,_jsx(_components.code,{children:`/embed`}),` widget) that can’t redirect or open a new tab. The response is a discriminated union keyed on `,_jsx(_components.code,{children:`checkout_ui_mode`}),`: exactly one of `,_jsx(_components.code,{children:`payment_url`}),` / `,_jsx(_components.code,{children:`payment_client_secret`}),` is ever present, and the field itself says unambiguously which:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_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:` \"checkout_ui_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"embedded\"`}),_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_client_secret\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cs_test_..._secret_...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /v1/credits/checkout`}),` always requires payments to be configured — there is no `,_jsx(_components.code,{children:`sandbox`}),` flag on this endpoint, and it fails closed with `,_jsx(_components.code,{children:`503 payments_not_configured`}),` if `,_jsx(_components.code,{children:`STRIPE_SECRET_KEY`}),` is unset, regardless of what else the deployment is doing in sandbox. A `,_jsx(_components.code,{children:`credit_code`}),` on a `,_jsx(_components.strong,{children:`sandbox order`}),`, by contrast, is never actually charged or even looked up — sandbox orders skip payment entirely, so any code (real, fake, or omitted) is accepted. See `,_jsx(_components.a,{href:`/sandbox`,children:`Sandbox mode`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`codes`,children:`Codes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Format `,_jsx(_components.code,{children:`pp-xxxx-xxxx-xxxx`}),`, case-insensitive (we lower-case on input).`]}),`\n`,_jsxs(_components.li,{children:[`Redeemed at order creation — pass `,_jsx(_components.code,{children:`credit_code`}),` alongside your letter.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`when-to-prefer-credits`,children:`When to prefer credits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`High-volume or recurring senders who don’t want a card prompt per letter.`}),`\n`,_jsx(_components.li,{children:`Budget controls — top up a fixed amount and it can’t be exceeded.`}),`\n`,_jsx(_components.li,{children:`Gifting or distributing “send N letters” to other people.`}),`\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":"Credits","description":"Prepaid balances that pay for letters without a card at every checkout.","sidebarTitle":"Prepaid credits","icon":"coins","href":"/guides/credits"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What credits are","slug":"what-credits-are","depth":2,"children":[]},{"title":"The two-part balance (CARD Act)","slug":"the-two-part-balance-card-act","depth":2,"children":[]},{"title":"Buying credits","slug":"buying-credits","depth":2,"children":[]},{"title":"Codes","slug":"codes","depth":2,"children":[]},{"title":"When to prefer credits","slug":"when-to-prefer-credits","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"paperplane-524ba6ed","siteName":"paperplane","title":"Credits - paperplane","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-28T22:34:29.141Z","gitLastModified":"2026-09-28T22:33:39.000Z","originalFileLocation":"guides/credits.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=\"dark\"}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=\"Prepaid balances that pay for letters without a card at every checkout.\">\u003cmeta data-mint-head name=\"application-name\" content=\"paperplane\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_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=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Credits - paperplane\">\u003cmeta data-mint-head property=\"og:description\" content=\"Prepaid balances that pay for letters without a card at every checkout.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"paperplane\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://paperplane-524ba6ed.mintlify.site/docs/_mintlify/api/og/v2?division=Guides\u0026amp;title=Credits\u0026amp;description=Prepaid+balances+that+pay+for+letters+without+a+card+at+every+checkout.\u0026amp;theme=2f654f31cdda48e5bfdf92ff\u0026amp;signature=6a2c4d00df4b91b82239500cd29963bcdb0f3802a4777e3526a19b17a0280371\">\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=\"Credits - paperplane\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Prepaid balances that pay for letters without a card at every checkout.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://paperplane-524ba6ed.mintlify.site/docs/_mintlify/api/og/v2?division=Guides\u0026amp;title=Credits\u0026amp;description=Prepaid+balances+that+pay+for+letters+without+a+card+at+every+checkout.\u0026amp;theme=2f654f31cdda48e5bfdf92ff\u0026amp;signature=6a2c4d00df4b91b82239500cd29963bcdb0f3802a4777e3526a19b17a0280371\">\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=\"/docs/mintlify-assets/_mintlify/favicons/paperplane-524ba6ed/4_JfwOH6MgSv74fH/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"paperplane\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1D3FD9\">\u003clink data-mint-head rel=\"canonical\" href=\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/guides/credits.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://sendpaperplane.com/#organization\",\"name\":\"paperplane\",\"url\":\"https://sendpaperplane.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://sendpaperplane.com/logo/dark.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs#website\",\"name\":\"paperplane\",\"url\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs\",\"publisher\":{\"@id\":\"https://sendpaperplane.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits#webpage\",\"url\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits\",\"name\":\"Credits\",\"description\":\"Prepaid balances that pay for letters without a card at every checkout.\",\"dateModified\":\"2026-09-28T22:33:39.000Z\",\"isPartOf\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs#website\"},\"breadcrumb\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/mcp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Credits\",\"item\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits#article\",\"headline\":\"Credits\",\"name\":\"Credits\",\"description\":\"Prepaid balances that pay for letters without a card at every checkout.\",\"url\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits\",\"mainEntityOfPage\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/guides/credits#webpage\"},\"dateModified\":\"2026-09-28T22:33:39.000Z\",\"publisher\":{\"@id\":\"https://sendpaperplane.com/#organization\"},\"isPartOf\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"paperplane\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"paperplane\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/guides/credits.md","siteName":"paperplane","nav":{"global":{"anchors":[{"anchor":"You're an agent? Start here","icon":"bot","href":"/agents"},{"anchor":"Changelog","icon":"list","href":"/changelog"},{"anchor":"Status","icon":"activity","href":"https://sendpaperplane.com/status"}]},"tabs":[{"tab":"Overview","icon":"book-open","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"paperplane — Mail a real letter from code","sidebarTitle":"Home","icon":"house","href":""},{"title":"Quickstart","sidebarTitle":"Quickstart","icon":"rocket","href":"/quickstart"},{"title":"Build with agents","sidebarTitle":"Build with agents","icon":"bot","href":"/agents"},{"title":"The delivery guarantee","sidebarTitle":"Guarantee","icon":"shield-check","href":"/guarantee"},{"title":"Core concepts","sidebarTitle":"Core concepts","icon":"lightbulb","href":"/concepts"},{"title":"Sandbox mode","sidebarTitle":"Sandbox mode","icon":"flask-conical","tag":"FREE","href":"/sandbox"},{"title":"Agent benchmark","sidebarTitle":"Agent benchmark","icon":"gauge","href":"/benchmark"}]},{"group":"Guides","icon":"book","pages":[{"title":"MCP server","sidebarTitle":"MCP server","icon":"bot","tag":"AGENTS","href":"/guides/mcp"},{"title":"Order lifecycle overview","sidebarTitle":"Lifecycle overview","icon":"route","href":"/guides/lifecycle"},{"title":"Error contract","sidebarTitle":"Error contract","icon":"triangle-alert","href":"/guides/errors"},{"title":"Send Policies","sidebarTitle":"Send Policies","icon":"shield-half","href":"/guides/send-policies"},{"title":"CLI","sidebarTitle":"CLI","icon":"terminal","tag":"DEVELOPERS","href":"/guides/cli"},{"title":"Payments","description":"How orders get paid — paperplane payment links and prepaid credit codes, and what the confirmation flow requires.","sidebarTitle":"Payments \u0026 confirmation","icon":"credit-card","href":"/guides/payments"},{"title":"Credits","sidebarTitle":"Prepaid credits","icon":"coins","href":"/guides/credits"},{"title":"Agent payments (x402)","description":"Let a funded agent wallet pay for postage directly — no human checkout, no card.","sidebarTitle":"Agent payments (x402)","icon":"wallet","tag":"STAGED","href":"/guides/agent-payments"},{"title":"ROI calculator","sidebarTitle":"ROI calculator","icon":"calculator","href":"/guides/roi-calculator"},{"title":"Addresses","sidebarTitle":"Address handling","icon":"map-pin","href":"/guides/addresses"},{"title":"Bulk sending (CSV import)","sidebarTitle":"Bulk sending","icon":"table","href":"/guides/bulk-import"},{"title":"Cancel \u0026 track","sidebarTitle":"Cancel \u0026 track","icon":"radar","href":"/guides/cancel-track"},{"title":"Embed the send flow","sidebarTitle":"Embed widget","icon":"code","href":"/guides/embed"},{"title":"Send by email","sidebarTitle":"Send by email","icon":"mail","href":"/guides/email-to-send"},{"title":"Send by text (SMS)","sidebarTitle":"Send by text (SMS)","icon":"message-circle","href":"/guides/imessage-to-send"},{"title":"Preview before you pay","sidebarTitle":"Print preflight","icon":"file-search","href":"/guides/print-preflight"},{"title":"Letter templates","sidebarTitle":"Letter templates","icon":"file-pen","href":"/guides/templates"},{"title":"Delivery webhooks","sidebarTitle":"Delivery webhooks","icon":"webhook","href":"/guides/webhooks"},{"title":"Integrations (Zapier, n8n, Make)","sidebarTitle":"Integrations","icon":"plug","href":"/guides/integrations"},{"title":"Rate limits","sidebarTitle":"Rate limits \u0026 caps","icon":"gauge","href":"/guides/rate-limits"},{"title":"Agent feedback","sidebarTitle":"Agent feedback","icon":"message-square-warning","tag":"AGENTS","href":"/guides/agent-feedback"}]},{"group":"Tutorials","icon":"graduation-cap","pages":[{"title":"Tutorial: send a security deposit demand letter","sidebarTitle":"Surface a demand letter","icon":"file-text","href":"/tutorials/demand-letter"},{"title":"Tutorial: an agent sending mail on its own","sidebarTitle":"Agent sends a letter","icon":"robot","href":"/tutorials/agent-workflow"}]}]},{"tab":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/mail/price-a-letter-before-sending-it"}]}]},"basePath":"","title":"Credits - paperplane","buildId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","deploymentId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","dynamics":[],"chunks":[]}