# Payhip MCP

> Payhip MCP Server lets your AI client manage the entire lifecycle of digital product sales. You can use natural language to run `verify_license` checks, create new discount codes with `create_coupon`, and track usage counts via `update_license_usage`. This is for founders who need full control over licensing, memberships, and promotions without opening a separate dashboard.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** digital-downloads, license-keys, coupons, membership-management, creator-economy

## Description

This Payhip MCP Server lets your AI client run shop for you. You get total command over managing digital product sales, handling everything from creating discount codes to enforcing usage rights—all through natural conversation with your agent. Forget jumping between a dashboard and a spreadsheet; your AI does the heavy lifting.

**Managing Licenses: The Core of Control**

When you need absolute control over who's using what, this server handles it. You can check if a software license key is valid and active by invoking `verify_license`, which reports its current status and remaining uses right back to your chat window. If someone needs access removed—say, after a refund—your agent runs `disable_license` to instantly revoke that specific key's access. When they pay up or the situation changes, running `enable_license` immediately restores it. For tracking consumption, you use `update_license_usage`; your agent increments or decrements the usage count for any license key so you can enforce product terms automatically and track exactly how many times it’s been used.

**Coupon Code Management: Running Promotions On Demand**

Need to run a sale? This server handles every coupon code detail. You'll never have to manually list through codes again; your agent pulls a complete manifest of every active and expired coupon using `list_coupons`. If you know the ID or name, running `get_coupon` gives you all the details on that single discount. And if you need to roll out a new promotion, simply telling your client to run `create_coupon` lets it generate a brand-new code using the exact discount type and amount you specify.

**Gathering Store Data: What’s Happening in Your Shop**

Sometimes, you just need to know what's going on. You can get full details for any product sold through your store by calling `get_product_details`. If you wanna see who bought what, your agent pulls a raw list of all customers using `list_customers`. Need to review specific purchasing habits? Running `get_customer_details` lets you pull focused information on one customer, like their purchase history or current license status. And if you need an inventory check, `list_products` generates a full rundown of every digital product currently listed on Payhip.

**Putting It Together: Full Operational Flow**

Your agent can combine these tools into complex workflows. For example, you don't just run `verify_license`; your client checks the key status and then immediately uses that data to decide if it needs to trigger a usage count update using `update_license_usage`. You can pull a list of products with `list_products`, cross-reference that against the details of specific customers pulled via `get_customer_details`, all while making sure the associated discount codes are valid by checking them with `get_coupon` or listing them out with `list_coupons`. It's full cycle management. You’ll never have to open another tab just to check a license status or run a coupon report again; your AI client handles it right here.

## Tools

### create_coupon
Creates a new coupon code using the specified discount type and amount.

### disable_license
Removes access to a specific license key, often necessary after a refund.

### enable_license
Activates a previously disabled software license key.

### get_coupon
Retrieves all details for one specific coupon code by its ID or name.

### get_customer_details
Pulls specific information about a customer, like their purchase history or license status.

### get_product_details
Gets the full details for any product sold through your store.

### list_coupons
Pulls a complete list of every active and expired coupon code in your Payhip account.

### list_customers
Outputs a raw list of all customers who have purchased something from your store.

### list_products
Generates an inventory list of every digital product you currently sell on Payhip.

### update_license_usage
Increments or decrements the usage count for a license key to track consumption.

### verify_license
Checks if a given software license key is valid and active, reporting its current status.

## Prompt Examples

**Prompt:** 
```
Verify license key 'ABCD-1234' for product link 'https://payhip.com/b/xyz'.
```

**Response:** 
```
I've verified the license. It is currently 'Active' for customer 'John Doe' (ID: 991). Would you like me to increase the usage count for this key?
```

**Prompt:** 
```
Show me all active coupons and their usage statistics for my Payhip store.
```

**Response:** 
```
You have 6 active coupons. "SUMMER30" (30% off) has been used 47 times generating $2,340 in discounted sales. "LAUNCH50" (50% off) was used 23 times. "WELCOME15" is your most popular at 89 redemptions. 2 coupons expire within 7 days. Total discount value given this month: $1,847.
```

**Prompt:** 
```
Verify the license key LK-8847-ABCD for my premium plugin product and check its usage count.
```

**Response:** 
```
License LK-8847-ABCD is valid and active. Product: Premium Plugin Suite. Purchased by: tech@meridian.io on March 15, 2025. Current usage: 3 of 5 allowed activations. Last activation: May 2nd from IP 192.168.1.45. The license is set to renew annually on March 15, 2026.
```

## Capabilities

### Verify and Track Licenses
Checks a software license key's validity against Payhip records and reports its current status, including remaining uses.

### Manage Coupon Codes
Allows the creation of new discount coupons or retrieves full details for any existing coupon code.

### List Store Data
Pulls lists of all customers, products, or active coupons from your Payhip store into the chat window for review.

### Update Usage Counts
Adjusts a license key's usage count (incrementing or decrementing) to enforce product terms automatically.

### Control License Status
Manually enables or disables specific license keys through natural language commands to manage entitlements.

## Use Cases

### The Support Ticket Nightmare
A customer emails asking if their license key, 'XYZ-9876', works. Instead of copying the key to a separate validation page, your agent calls `verify_license`. The AI responds instantly: 'Yes, it's active for John Doe and has 2 uses left.' Problem solved in seconds.

### The Flash Sale Launch
You need a limited-time discount. Instead of manually updating the pricing page, you run `create_coupon` with the parameters (e.g., 'SAVE20', 20% off). You immediately confirm it worked by calling `get_coupon`.

### Tracking Membership Expiration
Your team needs to know who signed up last month but haven't paid. You run `list_customers` and filter the results in your agent chat, identifying inactive users for a targeted follow-up email.

### The Refund Process
A customer requests a refund and needs their access revoked immediately. Your workflow calls `disable_license`, ensuring they can't use the key again until you manually run `enable_license` later for a new purchase.

## Benefits

- Eliminate manual license checks. Use `verify_license` to instantly confirm if a customer's key is active or expired without leaving your chat window.
- Control promotions on the fly. With `list_coupons`, you get an immediate overview of all discount codes, and `create_coupon` lets you launch new campaigns programmatically.
- Maintain usage compliance. Running `update_license_usage` ensures that if a product has 5 allowed uses, your system tracks it accurately every time the key activates.
- Get customer context fast. Instead of searching multiple tabs, calling `get_customer_details` pulls everything you need about an account in one shot.
- See your inventory at a glance. Use `list_products` to pull up all digital items and their details (`get_product_details`) for quick reference or updates.

## How It Works

The bottom line is that it turns manual dashboard checks into simple conversational requests.

1. Subscribe to the Payhip server and provide your API Key from your developer settings.
2. Your AI client sends a request (e.g., 'Verify license key X').
3. The server executes the relevant tool, retrieves the data, and gives the result back to your agent for response.

## Frequently Asked Questions

**How do I use Payhip MCP Server to verify a license key?**
Just ask your agent directly: 'Verify the license key ABC-1234.' The server uses `verify_license` to check its status, and tells you if it's active or expired. You get all validation metadata back.

**Can I create coupons using the Payhip MCP Server?**
Yes. Use the `create_coupon` tool by providing the required code, discount type, and amount. This lets you launch promotions without touching the admin panel.

**What is the difference between `list_customers` and `get_customer_details`?**
`list_customers` gives a raw list of every customer ID in your store. `get_customer_details`, however, pulls specific data points about one person—like their purchase history or license status.

**How does `update_license_usage` work?**
`update_license_usage` lets you adjust the usage count for a key. If 5 uses are allowed, calling this tool simulates an activation and tells you the new total.

**What information do I need to set up and authenticate the Payhip MCP Server?**
You must provide a valid API Key generated from your Payhip developer settings. This key authorizes your AI client's connection, allowing it to run all commands like `list_products` or `get_customer_details` on your behalf.

**If I run `disable_license`, how does the server handle keys that are already inactive?**
The server confirms the current status and reports back that no change was made. This ensures that calling `disable_license` multiple times is safe (idempotent) and won't cause errors.

**What’s the practical difference between using `list_coupons` and running `get_coupon`?**
`list_coupons` pulls a summary of all your active coupon codes. Use `get_coupon` when you know the specific code and need detailed data, like its exact expiration date or redemption count.

**Should I use `get_product_details` before running `verify_license`?**
It's best practice to run `get_product_details` first. This pulls the product metadata, confirming that the license key you are validating belongs to an active and correctly identified digital item.

**Can my AI automatically find the details for a specific coupon by its ID?**
Yes! Use the `get_coupon` tool with the Coupon ID. Your agent will respond with complete metadata, including discount type, value, and usage limits in seconds.

**How do I find my Payhip API Key?**
Log in to your Payhip account, navigate to **Account** > **Settings** > **Developer**, and you will find your unique secret API key there.

**Does this work for physical products?**
The current MCP implementation focuses on coupon management and digital license verification. Physical product orchestration may be added as Payhip expands its API capabilities.