# Apple Pay checkout inside iMessage with an AI agent

Put your product in iMessage with Keiki and let customers order and pay with Apple Pay without leaving the conversation.

[View imessage-apple-pay-checkout on GitHub](https://github.com/Mail-0/imessage-apple-pay-checkout)

## How do I take Apple Pay payments inside an iMessage conversation?

1. Clone and deploy: `git clone https://github.com/Mail-0/imessage-apple-pay-checkout && cd imessage-apple-pay-checkout && npm install`, then deploy to Vercel with `OPENAI_API_KEY` set.
2. Connect the app to an agent with `npx @onkeiki/cli init --dispatch-url https://your-app.vercel.app/api/keiki` and turn on Payments. [Connect and verify your payment account](https://onkeiki.com/docs/payments), create a payee linked to the agent with an approved limit, and set `KEIKI_PAYEE_ID` to its id.
3. Attach a dedicated iMessage line to the agent in the Keiki dashboard and text it: "Two bags of beans and a mug, please."

Your code, your model, your servers. Keiki only handles the channels.

## Details

- Stack: Next.js, Vercel AI SDK, TypeScript, @onkeiki/ai-sdk
- Channels: iMessage
- Docs: [/docs/payments](https://onkeiki.com/docs/payments)
- Guide: [How do I take Apple Pay payments inside an iMessage conversation?](https://onkeiki.com/content/how-do-i-take-apple-pay-payments-inside-an-imessage-conversation)
