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

# Deploy the ACP Handler

> Ship the ACP handler to managed Kubernetes with a deploy button, stateset.yaml, and the env vars that matter.

# Deploy the ACP Handler

[StateSet Deploy](/stateset-deploy-overview) builds the
[ACP handler](/guides/agentic-commerce-protocol-handler) from its repo and runs it on managed
Kubernetes — TLS, health checks, and autoscaling included.

## 1 — Add a deploy button

```markdown theme={null}
[![Deploy to StateSet](https://deploy.stateset.com/button.svg)](https://deploy.stateset.com/deploy?repo=stateset/stateset-acp-handler)
```

## 2 — Add `stateset.yaml`

Optional but recommended — it makes the deployment reproducible instead of click-configured:

```yaml theme={null}
name: stateset-acp-handler
description: ACP handler service

build:
  dockerfile: Dockerfile
  context: .

runtime:
  port: 8080
  health_check: /health
  readiness_check: /ready
```

## 3 — Set environment variables

Set these in `stateset.yaml` or the deploy UI:

| Variable            | Purpose                                            |
| ------------------- | -------------------------------------------------- |
| `ACP_API_KEY`       | Authenticates callers of the handler               |
| `STRIPE_SECRET_KEY` | Only if using the Stripe PaymentIntent integration |
| `REDIS_URL`         | Session store; omit to fall back to in-memory      |
| `COMMERCE_BACKEND`  | `icommerce` for real order execution, else stub    |

<Warning>
  **In-memory sessions do not survive a restart or a scale-out.** A deployment with more than one
  replica, or any deployment you care about, needs `REDIS_URL` set — otherwise a checkout session
  created on one pod is invisible to the next request.
</Warning>

## 4 — Deploy

Click the button, authenticate with GitHub, and wait for the build. The app lands at:

```
https://{app-name}.{slug}.cloud.stateset.com
```

## 5 — Verify

```bash theme={null}
curl https://{app-name}.{slug}.cloud.stateset.com/health
curl https://{app-name}.{slug}.cloud.stateset.com/openapi.json | head
```

The handler serves Swagger UI at `/docs` — a quick way to confirm the surface is up before pointing
ChatGPT at it.

## Related

* [ACP handler guide](/guides/agentic-commerce-protocol-handler) — what you just deployed
* [ACP](/stateset-acp/stateset-acp) — the protocol itself
* [StateSet Deploy](/stateset-deploy-overview) — deployment types, storage, custom domains
