Skip to main content
Agentic Commerce Protocol (ACP) Handler is a Rust server that implements OpenAI’s Agentic Commerce Protocol. It provides checkout session APIs, delegated payments, and optional gRPC access so you can keep orders and compliance in your own stack while enabling ChatGPT Instant Checkout experiences.

Key capabilities

  • Full checkout session lifecycle for the ACP spec
  • Delegated payment endpoint with vault token support
  • Optional Stripe PaymentIntent integration
  • Idempotency keys and request tracing
  • Swagger UI at /docs and OpenAPI JSON at /openapi.json
  • gRPC API mirroring the HTTP endpoints

Architecture overview

Quickstart

cargo build --release
cargo run --release
The HTTP server listens on http://0.0.0.0:8080 by default. The gRPC server listens on 0.0.0.0:50051. To run the demo flow:
./demo_test.sh

Create a checkout session

curl -X POST https://yourapp.com:8080/checkout_sessions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer api_key_123" \
  -H "API-Version: 2025-09-29" \
  -d '{
    "items": [{ "id": "item_123", "quantity": 2 }],
    "buyer": { "email": "[email protected]" }
  }'

Core endpoints

MethodEndpointDescription
POST/checkout_sessionsCreate a checkout session
GET/checkout_sessions/:idRetrieve a checkout session
POST/checkout_sessions/:idUpdate a checkout session
POST/checkout_sessions/:id/completeComplete checkout and create order
POST/checkout_sessions/:id/cancelCancel a checkout session
POST/agentic_commerce/delegate_paymentDelegated payment (vault token)
GET/healthHealth check
GET/readyReadiness check
GET/docsSwagger UI
GET/openapi.jsonOpenAPI spec

Delegated payments

The delegated payment endpoint accepts payment tokens from a PSP vault. Tokens are validated for allowance and expiry and are consumed after use.

Stripe integration

Set the following environment variables before starting the server to process delegated payments with Stripe:
  • STRIPE_SECRET_KEY
  • STRIPE_PUBLISHABLE_KEY (optional)
  • STRIPE_WEBHOOK_SECRET (optional, for webhook signature verification)

gRPC access

The gRPC API mirrors the HTTP endpoints and uses the same API keys. Send authorization: Bearer <api_key> as gRPC metadata. The repository also includes:
  • A Next.js dashboard for monitoring checkout sessions
  • A ChatGPT widget server for MCP-based agent flows
  • Kubernetes and Docker Compose deployment assets