Pay for an order
pay_orderPay for an unpaid order with a Stripe shared payment token (spt_…) the user approved, scoped to at least the order amount in USD. For an order created with recipients, this pays for the whole group at once (scope the token to batch.price). On success the order is paid and goes to print. Use only after the user approved the purchase.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"order_id": "<order_id>",
"shared_payment_token": "<shared_payment_token>"
},
"name": "pay_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order id from create_postcard or create_letter, ord_… | |
| shared_payment_token | Yes | Stripe shared payment token, spt_… |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Order id, ord_… | |
| batch | No | Present when the order was created with recipients: the whole group. The top-level fields describe the first recipient's order; use batch.price and batch.checkout_url for the total and payment. | |
| price | Yes | ||
| object | Yes | ||
| orders | No | Every order in the group, when created with recipients | |
| status | Yes | awaiting_payment, paid, printing, mailed, cancelled or refunded | |
| product | Yes | Product id, e.g. postcard_4x6 or letter_certified | |
| discount | Yes | First-order discount, already taken off price; null when none applies | |
| tracking | Yes | USPS tracking, for Certified Mail once printed | |
| certified | Yes | none, certified or certified_return_receipt | |
| order_url | Yes | Order status page | |
| preview_url | Yes | Exact print preview | |
| checkout_url | Yes | Where the user pays; null once paid or cancelled | |
| product_name | Yes | ||
| status_detail | Yes | Plain-English status to show the user | |
| preview_image_url | No | PNG picture of the piece (postcard front and back, or the letter's first page) to show the user |