Create or pay a machine order
postalform.create_machine_orderCreate a single PDF, letter, workflow-form order, or bulk letter campaign and pay through MPP or x402 after buyer approval. For bulk, provide exactly one of bulk.csv_content or bulk.recipients (JSON address objects with optional merge_fields), plus a shared PDF or text/HTML template. Omit top-level recipient fields and review campaign_url, recipient count and total. Bulk MPP orders can also use postalform.pay_order after fetching its challenge. The unpaid response also includes checkout_url and status_url for this same order. Without an available compatible wallet, give the buyer checkout_url and poll status_url; never recreate the order to change payment paths. Single-recipient clients with a Stripe shared payment token can instead use a draft tool followed by complete_checkout; other clients should present the hosted checkout URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Existing PDF to mail. For a single recipient, provide exactly one of pdf, letter, or form. For bulk.content_mode=pdf, this PDF is sent to every CSV or JSON recipient. Prefer upload_token from postalform.create_pdf_upload. | ||
| bulk | No | Bulk letter campaign: exactly one of csv_content or recipients (JSON list), plus shared PDF or text/HTML template. Omit single-recipient fields, letter, form, and postcard options. color and double_sided apply to every mailpiece. | |
| form | No | Workflow form payload from postalform.get_form_schema. Provide exactly one of pdf, letter, or form. | |
| color | No | ||
| letter | No | Letter text to render and mail. Provide exactly one of pdf, letter, or form. Optional format may be text, html, markdown, or rtf; default is text. Optional signature may be a typed string or drawn signature payload. | |
| certified | No | ||
| file_name | No | ||
| buyer_name | Yes | Buyer name for receipts. | |
| mail_class | No | ||
| request_id | No | Idempotency key. Reuse the same value and same order fields after a payment challenge. | |
| buyer_email | Yes | Buyer email for receipts. | |
| sender_name | Yes | ||
| double_sided | No | ||
| postcard_size | No | ||
| mailpiece_type | No | ||
| recipient_name | No | Required for a single recipient. Omit when bulk supplies the recipient list. | |
| payment_protocol | No | Direct machine payment protocol. Use mpp for Link CLI/Link MCP or Stripe SPT; use x402 for x402 wallet clients. Defaults to mpp. | |
| payment_signature | No | x402 retry value after paying the PAYMENT-REQUIRED challenge. | |
| sender_address_id | No | ||
| signature_required | No | ||
| sender_address_text | No | ||
| sender_address_type | No | ||
| recipient_address_id | No | ||
| payment_authorization | No | MPP retry value after paying with Link CLI/Link MCP. Pass the full Authorization header value, usually "Payment ...". | |
| sender_address_manual | No | ||
| recipient_address_text | No | ||
| recipient_address_type | No | ||
| certified_return_receipt | No | ||
| recipient_address_manual | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bulk | No | ||
| view | Yes | ||
| status | Yes | ||
| is_paid | Yes | ||
| payment | No | ||
| currency | Yes | ||
| endpoint | Yes | ||
| order_id | Yes | ||
| protocol | Yes | ||
| next_step | No | ||
| price_usd | Yes | ||
| page_count | No | ||
| request_id | Yes | ||
| status_url | No | ||
| next_action | No | ||
| preview_url | No | ||
| campaign_url | No | ||
| checkout_url | No | ||
| postcard_size | Yes | ||
| mailpiece_type | Yes | ||
| payment_status | Yes | ||
| payment_options | No | ||
| order_complete_url | Yes |