Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url.
Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry.
On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.
Optional developer API key: Authorization: Bearer pp_live_… (or pp_test_… for a sandbox-only key). Omitting it is a supported way to call every route. A key that is sent and does not verify is refused with 401 rather than treated as anonymous, so a typo fails loudly instead of quietly losing the restriction you meant to apply. Enabled per deployment via SCOPED_API_KEYS.
The physical piece to mail. Defaults to 'letter'. Postcards (postcard_4x6 $0.99, postcard_6x9 $2.99, postcard_6x11 $3.49) and the notecard (notecard from $1.99 — a folded card, enclosed like a greeting card rather than open-face like a postcard; set handwriting to 'pen' for $2.99) are message-only today: text prints on the piece itself (handwriting typography, or a real pen for the notecard upsell), no custom photo or artwork side, and no PDF/upload path; printing and First-Class postage are both included in the price. All of them allow only mail_class='first_class' and carry no tracking.
Notecard only. 'script' (default): printed handwriting typography, $1.99. 'pen': +$1 ($2.99), a robot hand-writes it with a real pen in real ink. Must match what you quoted.
Pay to leave the "Mailed via paperplane" mark off this envelope. Only charged where a mark would otherwise have been printed — never on Certified, Priority, or postcards, which carry no mark to begin with.
Idempotent replay. The Idempotency-Key was already used, so the original order is returned with replayed: true and nothing new was created or charged. Distinguishable from a fresh send by the status code alone.
{"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":"api-reference/mail/send-a-letter","slug":"/api-reference/mail/send-a-letter","pageMetadata":{"title":"Send a letter","description":"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. **This spends money and mails a physical object to a real address.** Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned `payment_url` is paid — or spends a sandbox no-op if `sandbox: true` for a free, instant, end-to-end simulation. Provide exactly one of `text`, `upload_key`, `pdf_base64`, or `pdf_url`.\n\nSend an `Idempotency-Key` header on every call. A repeat with the same key returns the original order with `replayed: true` and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry.\n\nOn the agent path a `confirmation_token` from `POST /v1/quotes` is required; without one the call fails `428 confirmation_required` rather than sending.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/orders","href":"/api-reference/mail/send-a-letter","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. \", _jsx(_components.strong, {\n children: \"This spends money and mails a physical object to a real address.\"\n }), \" Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned \", _jsx(_components.code, {\n children: \"payment_url\"\n }), \" is paid — or spends a sandbox no-op if \", _jsx(_components.code, {\n children: \"sandbox: true\"\n }), \" for a free, instant, end-to-end simulation. Provide exactly one of \", _jsx(_components.code, {\n children: \"text\"\n }), \", \", _jsx(_components.code, {\n children: \"upload_key\"\n }), \", \", _jsx(_components.code, {\n children: \"pdf_base64\"\n }), \", or \", _jsx(_components.code, {\n children: \"pdf_url\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Send an \", _jsx(_components.code, {\n children: \"Idempotency-Key\"\n }), \" header on every call. A repeat with the same key returns the original order with \", _jsx(_components.code, {\n children: \"replayed: true\"\n }), \" and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"On the agent path a \", _jsx(_components.code, {\n children: \"confirmation_token\"\n }), \" from \", _jsx(_components.code, {\n children: \"POST /v1/quotes\"\n }), \" is required; without one the call fails \", _jsx(_components.code, {\n children: \"428 confirmation_required\"\n }), \" rather than sending.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Send a letter","description":"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. **This spends money and mails a physical object to a real address.** Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned `payment_url` is paid — or spends a sandbox no-op if `sandbox: true` for a free, instant, end-to-end simulation. Provide exactly one of `text`, `upload_key`, `pdf_base64`, or `pdf_url`.\n\nSend an `Idempotency-Key` header on every call. A repeat with the same key returns the original order with `replayed: true` and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry.\n\nOn the agent path a `confirmation_token` from `POST /v1/quotes` is required; without one the call fails `428 confirmation_required` rather than sending.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/orders","href":"/api-reference/mail/send-a-letter","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createOrder","summary":"Send a letter","description":"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. **This spends money and mails a physical object to a real address.** Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned `payment_url` is paid — or spends a sandbox no-op if `sandbox: true` for a free, instant, end-to-end simulation. Provide exactly one of `text`, `upload_key`, `pdf_base64`, or `pdf_url`.\n\nSend an `Idempotency-Key` header on every call. A repeat with the same key returns the original order with `replayed: true` and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry.\n\nOn the agent path a `confirmation_token` from `POST /v1/quotes` is required; without one the call fails `428 confirmation_required` rather than sending.","tags":["Mail"],"security":["776ec688-a7a3-43fe-8398-cdb16183dc41","961b2fca-418b-4cb5-9582-7b1ea4dbdacf"],"parameters":["4c651786-b357-43ed-9f87-022c27802236"],"requestBody":"57f081b7-484a-463f-8156-ec2e35c7253b","responses":{"200":"85dac03f-6096-41e2-8bad-b01d887c58ae","201":"c4a5135f-f7f6-4680-9285-73bcd1074678","400":"62feebbb-9332-4abd-b9e5-61a545bbffe2","401":"a15a687b-da01-435f-bbc3-2bc4b93ab60a","402":"f514f818-425e-4590-8dc7-91c4533b2871","403":"efb1d368-cd2e-4457-99ad-6a6be0abccd2","409":"36f88267-cd3b-494d-9546-beeb0bd92b34","422":"31e09c46-b319-45e7-ac59-1f871ba9e668","428":"bb4fd2cb-837c-46fe-a748-828d524a32cc","429":"a2d97092-9dd6-4716-89f0-74c3c08d2b25","503":"fa33e838-b4ca-493d-bcfa-232740ca874a"},"method":"post","type":"path","servers":["f186af28-fc7f-4e4d-ae07-81b0958d61e8"],"path":"/v1/orders","baseUrlOptions":["https://sendpaperplane.com"],"title":"Send a letter","codeSamples":[],"requestExampleLanguages":["bash","python","javascript","typescript","go","ruby","php","java"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.mail_class":"first_class","body.to.name":"Jordan Rivera","body.to.line1":"742 Evergreen Terrace","body.to.city":"Springfield","body.to.state":"IL","body.to.zip":"62704","body.from.name":"Alex Chen","body.from.line1":"221B Baker St","body.from.city":"Springfield","body.from.state":"IL","body.from.zip":"62701","body.text":"Dear Jordan,\n\nThis is a letter sent through paperplane.\n\nBest,\nAlex","body.sandbox":true}]},"dependencies":{"parameters":{"4c651786-b357-43ed-9f87-022c27802236":{"name":"Idempotency-Key","in":"header","required":false,"description":"Caller-chosen unique string. A retry with the same value replays the original order (HTTP 200, `replayed: true`) instead of creating a second one.","schema":{"type":"string","isRequired":false,"description":"Caller-chosen unique string. A retry with the same value replays the original order (HTTP 200, `replayed: true`) instead of creating a second one.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"mail_class","typeLabel":"enum\u003cstring>"},"to":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"to.name","typeLabel":"string"},"line1":{"type":"string","minLength":1,"maxLength":120,"isRequired":true,"uniqueKey":"to.line1","typeLabel":"string"},"city":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"to.city","typeLabel":"string"},"state":{"type":"string","minLength":2,"maxLength":2,"isRequired":true,"uniqueKey":"to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"to.country","typeLabel":"string"}},"required":["name","line1","city","state","zip"],"isRequired":true,"uniqueKey":"to","typeLabel":"object"},"from":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"from.name","typeLabel":"string"},"line1":{"type":"string","minLength":1,"maxLength":120,"isRequired":true,"uniqueKey":"from.line1","typeLabel":"string"},"city":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"from.city","typeLabel":"string"},"state":{"type":"string","minLength":2,"maxLength":2,"isRequired":true,"uniqueKey":"from.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"from.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"from.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"from.country","typeLabel":"string"}},"required":["name","line1","city","state","zip"],"isRequired":true,"uniqueKey":"from","typeLabel":"object"},"color":{"type":"boolean","uniqueKey":"color","typeLabel":"boolean"},"tracking":{"type":"boolean","uniqueKey":"tracking","typeLabel":"boolean"},"text":{"type":"string","maxLength":50000,"uniqueKey":"text","typeLabel":"string"},"font":{"type":"string","maxLength":40,"uniqueKey":"font","typeLabel":"string"},"upload_key":{"type":"string","pattern":"^up_[0-9a-f]{32}\\.pdf$","uniqueKey":"upload_key","typeLabel":"string"},"pdf_base64":{"type":"string","maxLength":14000000,"uniqueKey":"pdf_base64","typeLabel":"string"},"pdf_url":{"type":"string","format":"uri","uniqueKey":"pdf_url","typeLabel":"string\u003curi>"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","uniqueKey":"email","typeLabel":"string\u003cemail>"},"credit_code":{"type":"string","pattern":"^pp-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}$","uniqueKey":"credit_code","typeLabel":"string"},"account_session":{"type":"string","maxLength":2000,"uniqueKey":"account_session","typeLabel":"string"},"webhook_url":{"type":"string","format":"uri","uniqueKey":"webhook_url","typeLabel":"string\u003curi>"},"sandbox":{"type":"boolean","uniqueKey":"sandbox","typeLabel":"boolean"},"format":{"default":"letter","description":"The physical piece to mail. Defaults to 'letter'. Postcards (postcard_4x6 $0.99, postcard_6x9 $2.99, postcard_6x11 $3.49) and the notecard (`notecard` from $1.99 — a folded card, enclosed like a greeting card rather than open-face like a postcard; set `handwriting` to 'pen' for $2.99) are message-only today: `text` prints on the piece itself (handwriting typography, or a real pen for the notecard upsell), no custom photo or artwork side, and no PDF/upload path; printing and First-Class postage are both included in the price. All of them allow only mail_class='first_class' and carry no tracking.","type":"string","enum":["letter","letter_windowed","notecard","postcard_4x6","postcard_6x9","postcard_6x11"],"uniqueKey":"format","typeLabel":"enum\u003cstring>"},"handwriting":{"description":"Notecard only. 'script' (default): printed handwriting typography, $1.99. 'pen': +$1 ($2.99), a robot hand-writes it with a real pen in real ink. Must match what you quoted.","type":"string","enum":["script","pen"],"uniqueKey":"handwriting","typeLabel":"enum\u003cstring>"},"remove_branding":{"description":"Pay to leave the \"Mailed via paperplane\" mark off this envelope. Only charged where a mark would otherwise have been printed — never on Certified, Priority, or postcards, which carry no mark to begin with.","type":"boolean","uniqueKey":"remove_branding","typeLabel":"boolean"},"confirmation_token":{"type":"string","maxLength":2000,"uniqueKey":"confirmation_token","typeLabel":"string"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"uniqueKey":"checkout_ui_mode","typeLabel":"enum\u003cstring>"}},"required":["mail_class","to","from"],"uniqueKey":"","typeLabel":"object"},"example":{"mail_class":"first_class","to":{"name":"Jordan Rivera","line1":"742 Evergreen Terrace","city":"Springfield","state":"IL","zip":"62704"},"from":{"name":"Alex Chen","line1":"221B Baker St","city":"Springfield","state":"IL","zip":"62701"},"text":"Dear Jordan,\n\nThis is a letter sent through paperplane.\n\nBest,\nAlex","sandbox":true},"examples":{"Example":{"title":"Example","value":{"mail_class":"first_class","to":{"name":"Jordan Rivera","line1":"742 Evergreen Terrace","city":"Springfield","state":"IL","zip":"62704"},"from":{"name":"Alex Chen","line1":"221B Baker St","city":"Springfield","state":"IL","zip":"62701"},"text":"Dear Jordan,\n\nThis is a letter sent through paperplane.\n\nBest,\nAlex","sandbox":true}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"85dac03f-6096-41e2-8bad-b01d887c58ae":{"description":"Idempotent replay. The `Idempotency-Key` was already used, so the original order is returned with `replayed: true` and nothing new was created or charged. Distinguishable from a fresh send by the status code alone.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["status","order"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"isRequired":true,"uniqueKey":"oneOf.0.status","typeLabel":"enum\u003cstring>"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.0.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.0.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.order","typeLabel":"object"},"reason":{"type":"string","uniqueKey":"oneOf.0.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.next.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.next","typeLabel":"string[]"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.0.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.0.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.0.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.0.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.0.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.0.replayed","typeLabel":"boolean"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"uniqueKey":"oneOf.0.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_url":{"type":"string","format":"uri","uniqueKey":"oneOf.0.payment_url","typeLabel":"string\u003curi>"},"payment_client_secret":{"type":"string","uniqueKey":"oneOf.0.payment_client_secret","typeLabel":"string"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["status","order","checkout_ui_mode","payment_url","reason","next"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"const":"action_required","isRequired":true,"uniqueKey":"oneOf.1.status","typeLabel":"enum\u003cstring>"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"const":"hosted","isRequired":true,"uniqueKey":"oneOf.1.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_url":{"type":"string","format":"uri","isRequired":true,"uniqueKey":"oneOf.1.payment_url","typeLabel":"string\u003curi>"},"reason":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.1.next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.1.next","typeLabel":"string[]"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.1.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.1.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.1.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.1.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.1.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.order","typeLabel":"object"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.1.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.1.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.1.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.1.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.1.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.1.replayed","typeLabel":"boolean"},"payment_client_secret":{"type":"string","uniqueKey":"oneOf.1.payment_client_secret","typeLabel":"string"}},"uniqueKey":"oneOf.1","typeLabel":"object"},{"type":"object","required":["status","order","checkout_ui_mode","payment_client_secret","reason","next"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"const":"action_required","isRequired":true,"uniqueKey":"oneOf.2.status","typeLabel":"enum\u003cstring>"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"const":"embedded","isRequired":true,"uniqueKey":"oneOf.2.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_client_secret":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.payment_client_secret","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.2.next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.2.next","typeLabel":"string[]"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.2.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.2.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.2.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.2.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.2.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.2.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.2.order","typeLabel":"object"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.2.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.2.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.2.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.2.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.2.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.2.replayed","typeLabel":"boolean"},"payment_url":{"type":"string","format":"uri","uniqueKey":"oneOf.2.payment_url","typeLabel":"string\u003curi>"}},"uniqueKey":"oneOf.2","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"example":{"status":"ok","order":{"id":"ord_test_1a2b3c4d5e6f7a8b","status":"submitted","sandbox":true,"mail_class":"first_class","page_count":1,"color":false,"to":{"name":"Jordan Rivera","city":"Springfield","state":"IL","zip":"62704"},"price_cents":99,"breakdown":[{"id":"first_class_letter_1_page","label":"First-Class letter, 1 page","amount_cents":99}],"tracking_number":null,"expected_delivery_date":null,"refusal_reason":null,"created_at":"2026-08-23T12:00:00.000Z","updated_at":"2026-08-23T12:00:00.000Z"},"replayed":true,"capability":{"cancel_token":"ppc_a1b2c3d4","review_token":"ppc_e5f6g7h8"}},"examples":{"Example":{"title":"Example","value":{"status":"ok","order":{"id":"ord_test_1a2b3c4d5e6f7a8b","status":"submitted","sandbox":true,"mail_class":"first_class","page_count":1,"color":false,"to":{"name":"Jordan Rivera","city":"Springfield","state":"IL","zip":"62704"},"price_cents":99,"breakdown":[{"id":"first_class_letter_1_page","label":"First-Class letter, 1 page","amount_cents":99}],"tracking_number":null,"expected_delivery_date":null,"refusal_reason":null,"created_at":"2026-08-23T12:00:00.000Z","updated_at":"2026-08-23T12:00:00.000Z"},"replayed":true,"capability":{"cancel_token":"ppc_a1b2c3d4","review_token":"ppc_e5f6g7h8"}}}},"exampleType":"examples"}},"exampleType":"examples"},"c4a5135f-f7f6-4680-9285-73bcd1074678":{"description":"Order created. `status: \"ok\"` means it is paid and moving; `status: \"action_required\"` means a payment step is outstanding — `checkout_ui_mode` says whether that's a `payment_url` to open (`\"hosted\"`, the default) or a `payment_client_secret` to mount in place (`\"embedded\"`). A replay of an order still `pending_payment` can also return `action_required` with neither field — its payment step was minted for the original request; poll `GET /v1/orders/{id}` to resume it.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["status","order"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"isRequired":true,"uniqueKey":"oneOf.0.status","typeLabel":"enum\u003cstring>"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.0.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.0.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.0.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.order","typeLabel":"object"},"reason":{"type":"string","uniqueKey":"oneOf.0.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.next.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.next","typeLabel":"string[]"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.0.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.0.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.0.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.0.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.0.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.0.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.0.replayed","typeLabel":"boolean"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"uniqueKey":"oneOf.0.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_url":{"type":"string","format":"uri","uniqueKey":"oneOf.0.payment_url","typeLabel":"string\u003curi>"},"payment_client_secret":{"type":"string","uniqueKey":"oneOf.0.payment_client_secret","typeLabel":"string"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["status","order","checkout_ui_mode","payment_url","reason","next"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"const":"action_required","isRequired":true,"uniqueKey":"oneOf.1.status","typeLabel":"enum\u003cstring>"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"const":"hosted","isRequired":true,"uniqueKey":"oneOf.1.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_url":{"type":"string","format":"uri","isRequired":true,"uniqueKey":"oneOf.1.payment_url","typeLabel":"string\u003curi>"},"reason":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.1.next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.1.next","typeLabel":"string[]"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.1.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.1.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.1.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.1.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.1.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.1.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.order","typeLabel":"object"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.1.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.1.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.1.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.1.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.1.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.1.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.1.replayed","typeLabel":"boolean"},"payment_client_secret":{"type":"string","uniqueKey":"oneOf.1.payment_client_secret","typeLabel":"string"}},"uniqueKey":"oneOf.1","typeLabel":"object"},{"type":"object","required":["status","order","checkout_ui_mode","payment_client_secret","reason","next"],"properties":{"status":{"type":"string","enum":["ok","action_required","failed"],"const":"action_required","isRequired":true,"uniqueKey":"oneOf.2.status","typeLabel":"enum\u003cstring>"},"checkout_ui_mode":{"type":"string","enum":["hosted","embedded"],"const":"embedded","isRequired":true,"uniqueKey":"oneOf.2.checkout_ui_mode","typeLabel":"enum\u003cstring>"},"payment_client_secret":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.payment_client_secret","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.2.next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.2.next","typeLabel":"string[]"},"order":{"type":"object","required":["id","status","sandbox","mail_class","page_count","color","to","price_cents","breakdown","tracking_number","expected_delivery_date","refusal_reason","created_at","updated_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.id","typeLabel":"string"},"status":{"type":"string","enum":["draft","pending_payment","screening","held_for_review","submitted","mailed","delivered","refused","canceled","failed"],"isRequired":true,"uniqueKey":"oneOf.2.order.status","typeLabel":"enum\u003cstring>"},"sandbox":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.2.order.sandbox","typeLabel":"boolean"},"mail_class":{"type":"string","enum":["first_class","certified","certified_err","priority"],"isRequired":true,"uniqueKey":"oneOf.2.order.mail_class","typeLabel":"enum\u003cstring>"},"page_count":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.page_count","typeLabel":"integer"},"color":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.2.order.color","typeLabel":"boolean"},"to":{"type":"object","required":["name","city","state","zip"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.name","typeLabel":"string"},"city":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.city","typeLabel":"string"},"state":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.state","typeLabel":"string"},"zip":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.to.zip","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.2.order.to","typeLabel":"object"},"price_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.price_cents","typeLabel":"integer"},"breakdown":{"type":"array","items":{"type":"object","required":["id","label","amount_cents"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].id","typeLabel":"string"},"label":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].label","typeLabel":"string"},"amount_cents":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"isRequired":true,"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX].amount_cents","typeLabel":"integer"}},"uniqueKey":"oneOf.2.order.breakdown.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.2.order.breakdown","typeLabel":"object[]"},"tracking_number":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.tracking_number","typeLabel":"string | null"},"expected_delivery_date":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.expected_delivery_date","typeLabel":"string | null"},"refusal_reason":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.order.refusal_reason","typeLabel":"string | null"},"created_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.created_at","typeLabel":"string"},"updated_at":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.order.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.2.order","typeLabel":"object"},"corrected_to":{"type":"object","required":["name","line1","city","state","zip"],"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.name","typeLabel":"string"},"line1":{"type":"string","maxLength":120,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.line1","typeLabel":"string"},"city":{"type":"string","maxLength":80,"minLength":1,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.city","typeLabel":"string"},"state":{"type":"string","maxLength":2,"minLength":2,"isRequired":true,"uniqueKey":"oneOf.2.corrected_to.state","typeLabel":"string"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$","isRequired":true,"uniqueKey":"oneOf.2.corrected_to.zip","typeLabel":"string"},"line2":{"type":"string","maxLength":120,"uniqueKey":"oneOf.2.corrected_to.line2","typeLabel":"string"},"country":{"type":"string","const":"US","uniqueKey":"oneOf.2.corrected_to.country","typeLabel":"string"}},"uniqueKey":"oneOf.2.corrected_to","typeLabel":"object"},"capability":{"type":"object","required":["cancel_token","review_token"],"properties":{"cancel_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.capability.cancel_token","typeLabel":"string"},"review_token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.capability.review_token","typeLabel":"string"}},"uniqueKey":"oneOf.2.capability","typeLabel":"object"},"replayed":{"type":"boolean","uniqueKey":"oneOf.2.replayed","typeLabel":"boolean"},"payment_url":{"type":"string","format":"uri","uniqueKey":"oneOf.2.payment_url","typeLabel":"string\u003curi>"}},"uniqueKey":"oneOf.2","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"example":{"status":"ok","order":{"id":"ord_test_1a2b3c4d5e6f7a8b","status":"submitted","sandbox":true,"mail_class":"first_class","page_count":1,"color":false,"to":{"name":"Jordan Rivera","city":"Springfield","state":"IL","zip":"62704"},"price_cents":99,"breakdown":[{"id":"first_class_letter_1_page","label":"First-Class letter, 1 page","amount_cents":99}],"tracking_number":null,"expected_delivery_date":null,"refusal_reason":null,"created_at":"2026-08-23T12:00:00.000Z","updated_at":"2026-08-23T12:00:00.000Z"},"capability":{"cancel_token":"ppc_a1b2c3d4","review_token":"ppc_e5f6g7h8"}},"examples":{"Example":{"title":"Example","value":{"status":"ok","order":{"id":"ord_test_1a2b3c4d5e6f7a8b","status":"submitted","sandbox":true,"mail_class":"first_class","page_count":1,"color":false,"to":{"name":"Jordan Rivera","city":"Springfield","state":"IL","zip":"62704"},"price_cents":99,"breakdown":[{"id":"first_class_letter_1_page","label":"First-Class letter, 1 page","amount_cents":99}],"tracking_number":null,"expected_delivery_date":null,"refusal_reason":null,"created_at":"2026-08-23T12:00:00.000Z","updated_at":"2026-08-23T12:00:00.000Z"},"capability":{"cancel_token":"ppc_a1b2c3d4","review_token":"ppc_e5f6g7h8"}}}},"exampleType":"examples"}},"exampleType":"examples"},"62feebbb-9332-4abd-b9e5-61a545bbffe2":{"description":"`validation_error` or a document error (`invalid_pdf`, `empty_document`, `pdf_fetch_failed`, `page_limit_exceeded`, …). Same input will fail the same way.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"a15a687b-da01-435f-bbc3-2bc4b93ab60a":{"description":"`invalid_key` — an Authorization header was sent and it did not verify. A presented credential is never silently downgraded to anonymous.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"f514f818-425e-4590-8dc7-91c4533b2871":{"description":"The credit code is unknown, or has insufficient balance.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"efb1d368-cd2e-4457-99ad-6a6be0abccd2":{"description":"`key_disabled`, or `insufficient_scope` when the key is valid but does not carry the scope this route needs.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"36f88267-cd3b-494d-9546-beeb0bd92b34":{"description":"`confirmation_mismatch` — the letter does not match the quote the token was issued for — or `confirmation_used`, meaning that token already mailed a letter: re-quote, do not resend. Or `idempotency_in_flight`, meaning an earlier request with this `Idempotency-Key` has not finished: retry with the SAME key after `Retry-After` to receive its order, never with a new one.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"31e09c46-b319-45e7-ac59-1f871ba9e668":{"description":"USPS cannot deliver to the recipient address as entered, or the fulfillment provider terminally rejected the letter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"bb4fd2cb-837c-46fe-a748-828d524a32cc":{"description":"`confirmation_required` — no `confirmation_token` was supplied on a surface that requires one. Quote first, then send with the token. `status` is `action_required`, not `failed`.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"a2d97092-9dd6-4716-89f0-74c3c08d2b25":{"description":"Velocity cap reached (5/day, 20/month per sender fingerprint), or a per-credential spend cap.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","example":60}}},"exampleType":"generated"},"fa33e838-b4ca-493d-bcfa-232740ca874a":{"description":"Transient fulfillment failure (safe to retry), no rail configured for the requested format, or the API-key store was unreachable.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","action_required"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"reason","typeLabel":"string"},"next":{"type":"array","items":{"type":"string","uniqueKey":"next.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"next","typeLabel":"string[]"}},"required":["status","code","reason","next"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"failed","code":"\u003cstring>","reason":"\u003cstring>","next":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"776ec688-a7a3-43fe-8398-cdb16183dc41":{},"961b2fca-418b-4cb5-9582-7b1ea4dbdacf":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Optional developer API key: `Authorization: Bearer pp_live_…` (or `pp_test_…` for a sandbox-only key). Omitting it is a supported way to call every route. A key that is sent and does not verify is refused with 401 rather than treated as anonymous, so a typo fails loudly instead of quietly losing the restriction you meant to apply. Enabled per deployment via `SCOPED_API_KEYS`.","scopes":[]}}},"servers":{"f186af28-fc7f-4e4d-ae07-81b0958d61e8":{"url":"https://sendpaperplane.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Optional developer API key: `Authorization: Bearer pp_live_…` (or `pp_test_…` for a sandbox-only key). Omitting it is a supported way to call every route. A key that is sent and does not verify is refused with 401 rather than treated as anonymous, so a typo fails loudly instead of quietly losing the restriction you meant to apply. Enabled per deployment via `SCOPED_API_KEYS`.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Optional developer API key: `Authorization: Bearer pp_live_…` (or `pp_test_…` for a sandbox-only key). Omitting it is a supported way to call every route. A key that is sent and does not verify is refused with 401 rather than treated as anonymous, so a typo fails loudly instead of quietly losing the restriction you meant to apply. Enabled per deployment via `SCOPED_API_KEYS`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"paperplane-524ba6ed","siteName":"paperplane","title":"Send a letter - paperplane","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-01T20:21:20.780Z","originalFileLocation":"api-reference/mail/send-a-letter.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=\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url. Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry. On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.\">\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=\"Send a letter - paperplane\">\u003cmeta data-mint-head property=\"og:description\" content=\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url. Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry. On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.\">\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/api-reference/mail/send-a-letter\">\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=Mail\u0026amp;title=Send+a+letter\u0026amp;description=Renders+the+document%2C+prices+it%2C+verifies+both+addresses+with+USPS%2C+then+either+charges+a+prepaid+credit+code+or+returns+a+paperplane+payment+link.+**This+spend\u0026amp;theme=2f654f31cdda48e5bfdf92ff\u0026amp;signature=dfa231e3b278865b2791bd67736f110d8ebf7ccc6ef382c7932f138920b7187e\">\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=\"Send a letter - paperplane\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url. Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry. On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://paperplane-524ba6ed.mintlify.site/docs/_mintlify/api/og/v2?division=Mail\u0026amp;title=Send+a+letter\u0026amp;description=Renders+the+document%2C+prices+it%2C+verifies+both+addresses+with+USPS%2C+then+either+charges+a+prepaid+credit+code+or+returns+a+paperplane+payment+link.+**This+spend\u0026amp;theme=2f654f31cdda48e5bfdf92ff\u0026amp;signature=dfa231e3b278865b2791bd67736f110d8ebf7ccc6ef382c7932f138920b7187e\">\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/api-reference/mail/send-a-letter\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/mail/send-a-letter.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/api-reference/mail/send-a-letter#webpage\",\"url\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter\",\"name\":\"Send a letter\",\"description\":\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url. Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry. On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.\",\"dateModified\":\"2026-10-01T20:21:20.780Z\",\"isPartOf\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs#website\"},\"breadcrumb\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Mail\",\"item\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/price-a-letter-before-sending-it\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send a letter\",\"item\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter#apireference\",\"headline\":\"Send a letter\",\"name\":\"Send a letter\",\"description\":\"Renders the document, prices it, verifies both addresses with USPS, then either charges a prepaid credit code or returns a paperplane payment link. This spends money and mails a physical object to a real address. Charges the sender once payment is captured — immediately if a credit code covers it, otherwise when the returned payment_url is paid — or spends a sandbox no-op if sandbox: true for a free, instant, end-to-end simulation. Provide exactly one of text, upload_key, pdf_base64, or pdf_url. Send an Idempotency-Key header on every call. A repeat with the same key returns the original order with replayed: true and HTTP 200 instead of mailing a second letter, which makes a timeout safe to retry. On the agent path a confirmation_token from POST /v1/quotes is required; without one the call fails 428 confirmation_required rather than sending.\",\"url\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter\",\"mainEntityOfPage\":{\"@id\":\"https://paperplane-justin-winter-s-projects.vercel.app/docs/api-reference/mail/send-a-letter#webpage\"},\"dateModified\":\"2026-10-01T20:21:20.780Z\",\"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/api-reference/mail/send-a-letter.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","pages":[{"title":"Overview","href":""}]},{"tab":"API Reference","icon":"square-terminal","groups":[{"group":"Mail","pages":[{"title":"Price a letter before sending it","description":"Free — creates nothing and never touches payment. The price is all-in (postage, printing and the envelope included); `breakdown` lists the piece and any options that make up the total. Quoting first is the recommended shape for agents: it is the safe call, and it tells the user what a send will cost.\n\nSupply `to` plus `text` (or `pdf_url`) and the response also carries a single-use `confirmation_token` bound to that exact letter and price. `POST /v1/orders` requires one on the agent path, so this is where a send begins.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/quotes","href":"/api-reference/mail/price-a-letter-before-sending-it"},{"title":"Send a letter","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/orders","href":"/api-reference/mail/send-a-letter"},{"title":"Fetch an order","description":"Free — read-only, no charge. Poll this for status after a send. Terminal statuses are `delivered`, `refused`, `canceled`, and `failed`; the rest (`draft`, `pending_payment`, `screening`, `held_for_review`, `submitted`, `mailed`) still move. Prefer `webhook_url` on the order over polling.","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/orders/{id}","href":"/api-reference/mail/fetch-an-order"},{"title":"Cancel an order","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/orders/{id}","href":"/api-reference/mail/cancel-an-order"},{"title":"Get a signed URL to upload a PDF","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/uploads","href":"/api-reference/mail/get-a-signed-url-to-upload-a-pdf"},{"title":"Upload PDF bytes (keyless dev only)","deprecated":null,"version":null,"openapi":"/openapi.json put /v1/uploads/{key}","href":"/api-reference/mail/upload-pdf-bytes-keyless-dev-only"},{"title":"Propose a header→field mapping for a bulk import","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/csv-map","href":"/api-reference/mail/propose-a-header→field-mapping-for-a-bulk-import"},{"title":"Suggest a mail class for a draft","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/suggest-class","href":"/api-reference/mail/suggest-a-mail-class-for-a-draft"}]},{"group":"Credits","pages":[{"title":"Look up a prepaid credit balance","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/credits/{code}","href":"/api-reference/credits/look-up-a-prepaid-credit-balance"},{"title":"Buy a credit pack","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/credits/checkout","href":"/api-reference/credits/buy-a-credit-pack"},{"title":"Buy a credit pack via x402 (agent payments)","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/x402/credits","href":"/api-reference/credits/buy-a-credit-pack-via-x402-agent-payments"}]},{"group":"Reviews","pages":[{"title":"List published reviews","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/reviews","href":"/api-reference/reviews/list-published-reviews"},{"title":"Review a delivered order","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/reviews","href":"/api-reference/reviews/review-a-delivered-order"}]},{"group":"Feedback","pages":[{"title":"Report a problem to paperplane","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/feedback","href":"/api-reference/feedback/report-a-problem-to-paperplane"}]},{"group":"Addresses","pages":[{"title":"Address typeahead","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/address/autocomplete","href":"/api-reference/addresses/address-typeahead"},{"title":"Nearest mailable address for a coordinate","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/address/reverse","href":"/api-reference/addresses/nearest-mailable-address-for-a-coordinate"}]},{"group":"Meta","pages":[{"title":"Public site totals","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/stats","href":"/api-reference/meta/public-site-totals"},{"title":"This document","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/openapi.json","href":"/api-reference/meta/this-document"}]}]}]},"basePath":"","title":"Send a letter - paperplane","buildId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","deploymentId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-EBSrFTg1.js","utils-Y_7TcRh4.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D1wvvkPH.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-aT0ty6oN.js","snippetPresets-DoNRuyJc.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CXRajFpn.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BAyOsINj.js","shallow-CIcHqV1v.js","getApiPlaygroundDisplay-C5igZwEf.js","CodeSnippet-BFWnQLNh.js","CodeSnippets-Cx2mFgZW.js","Page-DCFaZE46.js","getPastedJson-BOy09PZp.js","icon-BwmYtB6R.js","MethodPill-DAIhq-iu.js","DuplicateIcon-DFM8Q3ph.js","createIcon-0UdvzB4Z.js","DynamicMarkdown-DYYZTGpa.js","SectionHeading-BFCDRUuH.js","axios-vUo_bRtp.js","Markdown-C6TcKjiR.js","clsx-Y_UC780V.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-PCbBHBTv.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-D4q_oRML.js"]}