{"openapi":"3.1.0","info":{"title":"Afterword Public API","version":"1.0.0","description":"Read-only public API for Afterword. Lets AI assistants fetch product facts, sample writing prompts, and create Stripe Checkout links. No authentication required. Every purchase ends at Stripe Checkout, confirmed by a human.","contact":{"email":"scott@myafterword.co"},"x-mcp-server":"https://www.myafterword.co/api/mcp"},"servers":[{"url":"https://www.myafterword.co/api/public/v1","description":"Production"}],"paths":{"/info":{"get":{"operationId":"getInfo","summary":"Get Afterword product facts","description":"Returns all public facts about Afterword: description, price, what is included, gift flow, shipping, policies and key page URLs. Sourced from the same single source of truth as the website.","responses":{"200":{"description":"Product facts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Info"}}}}}}},"/sample-prompts":{"get":{"operationId":"getSamplePrompts","summary":"Get sample writing questions","description":"Returns a curated selection of questions from Afterword's 9 guided sections. Useful for showing users what writing an Afterword feels like before they commit.","responses":{"200":{"description":"Sample prompts by section","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamplePrompts"}}}}}}},"/checkout":{"post":{"operationId":"createCheckoutLink","summary":"Create a Stripe Checkout link","description":"Creates a Stripe Checkout session and returns a URL for the user to complete payment. The user always confirms the purchase themselves on the Stripe-hosted page. Nothing charges a card automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Checkout URL ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CheckoutRequest":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["self","gift"],"description":"\"self\" for a personal purchase, \"gift\" to send to someone else."},"recipient_name":{"type":"string","description":"Required when type is \"gift\". The recipient's full name.","maxLength":120},"recipient_email":{"type":"string","format":"email","description":"Optional. When provided with a gift purchase, the recipient receives an invite email automatically after the buyer pays. No form is shown.","maxLength":254},"message":{"type":"string","description":"Optional gift message, stored in the order metadata.","maxLength":500},"code":{"type":"string","description":"Optional promo or contributor discount code.","maxLength":50}}},"CheckoutResponse":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri","description":"Stripe-hosted checkout URL. Valid for 24 hours. Pass this to the user to complete payment."},"expires_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when this checkout session expires."}}},"Info":{"type":"object","description":"All public facts about Afterword."},"SamplePrompts":{"type":"object","description":"Sample writing questions by section."},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}}}