# Payhip — how to use (mcp.ai)

Connect your Payhip account and use 9 tools for ecommerce straight from your AI agent. Connect with your own API key. Payhip is an e-commerce platform that enables individuals and businesses to sell digital products, memberships, and physical goods directly to their audience.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_payhip?ms=1787295960000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `payhip_create_coupon`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/payhip`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/payhip/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/payhip/create/coupon` — Tool to create a coupon for discounts in Payhip. Use when you need to create a new coupon code with either percentage or fixed amount discounts. Coupons can apply to single products, all products, or 
  - body: { code: string, notes?: string, amount_off?: integer, coupon_type: string, percent_off?: number, product_key?: string, usage_limit?: integer, collection_id?: string }
- `POST https://api.mcp.ai/api/payhip/delete/coupon` — Tool to delete a coupon by ID. Use when you need to remove a coupon from the Payhip account. Only available in v1 API.
  - body: { id: string }
- `POST https://api.mcp.ai/api/payhip/get/coupon` — Tool to retrieve a coupon with the given ID. Use when you need to fetch details about a specific coupon from Payhip.
  - body: { id: integer }
- `POST https://api.mcp.ai/api/payhip/update/coupon` — Tool to edit an existing coupon in Payhip. Use when you need to modify coupon details like code, percentage, expiry, or usage limit. Only available in v1 API.
  - body: { id: string, code?: string, limit?: string, expiry?: string, percentage?: string, product_id?: string }
- `POST https://api.mcp.ai/api/payhip/verify/coupon` — Tool to verify a Payhip coupon code. Use when you need to check if a coupon code is valid and retrieve its details. Only available in v1 API.
  - body: { code: string }
- `POST https://api.mcp.ai/api/payhip/webhook/event/paid` — Tool to process Payhip's paid webhook event. Use when handling a purchase completion webhook from Payhip.
  - body: { id: string, date: integer, type: string, email: string, items: object[], price: integer, is_gift: boolean, currency: string, signature: string, ip_address: string, payhip_fee: integer, stripe_fee: integer, vat_applied: boolean, payment_type: string, unconsented_from_emails: boolean }
- `POST https://api.mcp.ai/api/payhip/webhook/event/refunded` — Tool to process Payhip's refunded webhook event. Use when handling a payment refund event from Payhip.
  - body: { id: string, type: string, email: string, items: object[], price: integer, is_gift: boolean, currency: string, signature: string, ip_address: string, payhip_fee: integer, stripe_fee: integer, vat_applied: boolean, date_created: integer, payment_type: string, date_refunded: integer, amount_refunded: integer, unconsented_from_emails: boolean }
- `POST https://api.mcp.ai/api/payhip/webhook/event/subscription/created` — Tool to process Payhip's subscription.created webhook event. Use when handling a subscription start event from Payhip.
  - body: { type: string, status: string, plan_name: string, signature: string, customer_id: string, gdpr_consent: string, product_link: string, product_name: string, customer_email: string, subscription_id: string, customer_last_name: string, customer_first_name: string, date_subscription_started: integer }
- `POST https://api.mcp.ai/api/payhip/webhook/event/subscription/deleted` — Tool to process Payhip's 'subscription.deleted' webhook event. Use when handling a subscription cancellation event from Payhip.
  - body: { type: string, status: string, plan_name: string, signature: string, customer_id: string, gdpr_consent: string, product_link: string, product_name: string, customer_email: string, subscription_id: string, customer_last_name: string, customer_first_name: string, date_subscription_deleted: integer, date_subscription_started: integer }

## Example prompts
- "What can I do in Payhip?"
- "Show me a summary of my Payhip account"

## More
- Page: https://mcp.ai/payhip
- Agent spec (llms.txt): https://mcp.ai/payhip/llms.txt
- Postman collection: https://mcp.ai/payhip/postman.json
