Checkout
tinytales_checkout checkout:write
Approve a preview, make a Polar checkout or reprint link, or join the waitlist. Actions: approve, create, reprint, waitlist. Does not charge a card.
Actions: approve, create, reprint, waitlist.
01Access
The signed-in customer must have approved checkout:write. Calls stay inside that account.
02Annotations
The tool records preview approval or creates a pending Polar checkout URL.
No card is charged and no print job is created. The person completes payment in the browser.
This tool only reads or changes the signed-in TinyTales account. It does not post to the public internet or to other people’s services.
Repeating the call can create another record.
03Input
Which action to run: approve, create, reprint, waitlist.
Book id from tinytales_books action list or tinytales_books_write action create.
Number of printed copies. When omitted, uses the curation profile defaultQuantity, or 1 if no profile is set. 1 means one shared copy.
Optional JSON shipping address to echo on the response. When omitted, uses the curation profile shipping address if one was saved. Polar still collects the paid address in the browser.
json returns structured data. markdown returns the same data as a short readable summary. Defaults to json.
04Output
True when the underlying TinyTales route accepted the call.
One-line result for the model to read.
Present when ok is false. Names the failed state and the next action to call.
Polar URL where the person pays. Absent when ordering is closed.
Copy count used for this checkout link.
Shipping address echoed for display. Null when none was provided or saved. Polar still collects the paid address in the browser.
Price breakdown from the same Polar config checkout uses: unitPriceCents (promo when active), listPriceCents, additionalCopyPriceCents, promoActive, shippingIncluded, currency, quantity, and totalCents.
05Errors
- Every page must be finished generating before you approve the preview.
- Checkout is blocked until every page is rendered
- Checkout is blocked until the person approves a full preview
- No completed print order exists for this book. Use tinytales_checkout action create for a first print.
- Ordering is not yet open. Use tinytales_checkout action waitlist.
- Book not found
06Example request
{
"action": "create",
"book_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"quantity": 1
}
07Example response
{
"ok": true,
"summary": "Checkout link is ready. The person pays in the browser. No card was charged.",
"checkout_url": "https://polar.sh/checkout/example",
"quantity": 1,
"shipping_address": null,
"pricing": {
"currency": "USD",
"shippingIncluded": true,
"promoActive": true,
"listPriceCents": 2500,
"unitPriceCents": 1500,
"additionalCopyPriceCents": 800,
"quantity": 1,
"totalCents": 1500
}
}