Create a mail order draft from letter text
postalform.create_letter_order_draftPrepare letter text for mailing and return the order ID, total, hosted checkout URL, and checkout session. Accepts text directly; no PDF upload or browser is needed. Letter drafts may include typed or drawn signatures. After buyer approval, a compatible client can use complete_checkout with a Stripe shared payment token; otherwise present the hosted checkout URL. To prepare for MPP, set payment_protocol=mpp and buyer_email; receive a PDF preview, hosted checkout_url fallback and MPP challenge, then use postalform.pay_order with the order_id after buyer approval. Draft creation never pays. For x402, use postalform.create_machine_order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | ||
| letter | Yes | ||
| certified | No | ||
| buyer_name | No | Receipt name; defaults to sender_name for MPP. | |
| mail_class | No | ||
| request_id | No | ||
| buyer_email | No | Required for MPP receipt delivery. | |
| sender_name | Yes | ||
| double_sided | No | ||
| recipient_name | Yes | ||
| payment_protocol | No | Optional payment path. Defaults to hosted checkout. Choose mpp to return a payment challenge for this same prepared order; buyer_email is required. Draft creation never pays. | |
| sender_address_id | No | ||
| sender_address_text | No | ||
| sender_address_type | Yes | ||
| recipient_address_id | No | ||
| sender_address_manual | No | ||
| recipient_address_text | No | ||
| recipient_address_type | Yes | ||
| certified_return_receipt | No | ||
| recipient_address_manual | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | Yes | ||
| payment | No | ||
| order_id | Yes | ||
| price_usd | Yes | ||
| page_count | Yes | ||
| preview_url | No | ||
| sender_name | Yes | ||
| checkout_url | Yes | ||
| recipient_name | Yes | ||
| checkout_session | No | ||
| payment_protocol | No | ||
| sender_address_text | Yes | ||
| recipient_address_text | Yes |