> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatGPT ADK

> Build an e-commerce ChatGPT app with product browsing, cart, and Gr4vy Embed checkout.

A ChatGPT app is an [MCP](https://modelcontextprotocol.io) server that exposes **tools** (actions ChatGPT can invoke) and **resources** (widgets ChatGPT embeds as iframes). This guide walks through building an e-commerce app with widgets for browsing products, managing a cart, and checking out with Gr4vy Embed.

> [!NOTE]
>
> This guide is part of the [Agentic Development Kit (ADK)](https://docs.gr4vy.com/guides/payments/adk/overview.md). The ADK enables merchants to build AI-native storefronts within conversational platforms. This section covers building for **ChatGPT**.

## What you'll build

> [card] MCP server
>
> An HTTP server that declares tools (list products, show cart, start checkout) and resources (widgets) to ChatGPT.

> [card] Widgets
>
> Self-contained HTML widgets that render inside the ChatGPT conversation as iframes—catalog, cart, and checkout.

> [card] Gr4vy Embed
>
> A PCI-compliant payment form loaded into the checkout widget, backed by Gr4vy orchestration and webhook verification.

## Prerequisites

* A ChatGPT **Pro**, **Business**, **Team**, or **Enterprise** subscription. Developer mode is required and is not available on free subscriptions.
* Access to a Gr4vy sandbox environment, including a merchant account, a private API key, and (optionally) a webhook secret. See [Create an API key](https://docs.gr4vy.com/guides/payments/embed/quick-start/key.md) if you haven't set one up yet.
* A local development runtime for your chosen implementation language.
* A tunneling tool such as [ngrok](https://ngrok.com) to expose your local server to ChatGPT during development.

> [!NOTE]
>
> Not every payment method completes inside ChatGPT. Card and Venmo are supported today, and redirect-based methods such as PayPal are not. See [payment method support inside ChatGPT](https://docs.gr4vy.com/guides/payments/chatgpt-app/gr4vy-embed.md#payment-method-support-inside-chatgpt) before deciding which methods to offer.

## User journey

```mermaid theme={"system"}
graph LR
  A["Browse products"] --> B["Manage cart"]
  B --> C["Checkout"]
  C --> D["Confirmation"]
```

**1. Browse**

ChatGPT invokes `list_products` and the catalog widget appears inline.

**2. Manage cart**

The user edits the cart, or asks ChatGPT to open a dedicated cart widget.

**3. Checkout**

The widget triggers `start_checkout` with an order summary and Gr4vy Embed payment form.

**4. Confirmation**

The checkout widget displays a confirmation with the transaction ID and payment details.

## In this guide

**1. Architecture**

[Understand the architecture](https://docs.gr4vy.com/guides/payments/chatgpt-app/architecture.md) — how MCP, tools, widgets, and the three-part return pattern fit together.

**2. Setup**

[Scaffold the project](https://docs.gr4vy.com/guides/payments/chatgpt-app/setup.md) with dependencies and environment variables.

**3. MCP server**

[Build the MCP server](https://docs.gr4vy.com/guides/payments/chatgpt-app/mcp-server.md) — define data types, product catalog, HTTP transport, tools, and resources.

**4. Widgets**

[Build the widgets](https://docs.gr4vy.com/guides/payments/chatgpt-app/widgets.md) — implement the widget bridge and build each widget as a self-contained HTML file.

**5. Gr4vy Embed**

[Integrate Gr4vy Embed](https://docs.gr4vy.com/guides/payments/chatgpt-app/gr4vy-embed.md) — generate embed tokens server-side, render the payment form, and verify webhooks.

**6. Deployment**

[Deploy to ChatGPT](https://docs.gr4vy.com/guides/payments/chatgpt-app/deployment.md) — expose your server over HTTPS, connect to ChatGPT, and go live.

## Useful resources

* [OpenAI Apps SDK](https://openai.com/index/apps-in-chatgpt/)
* [OpenAI Apps SDK examples](https://github.com/openai/openai-apps-sdk-examples)
* [Model Context Protocol specification](https://modelcontextprotocol.io)
* [Gr4vy Embed quick start](https://docs.gr4vy.com/guides/payments/embed/quick-start/overview.md)
* [`@modelcontextprotocol/sdk` on npm](https://www.npmjs.com/package/@modelcontextprotocol/sdk)
* [`fastmcp` on PyPI](https://pypi.org/project/fastmcp/)
* [Reference implementation (TypeScript)](https://github.com/gr4vy/gr4vy-typescript-adk)
* [Reference implementation (Python)](https://github.com/gr4vy/gr4vy-python-adk)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.