Update Coupon
Immutable Catalog Entry
This descriptor comes from the active versioned Portal catalog.
- Contract tier:
agent_ready - Risk:
write - Catalog version:
2026-07-12.2 - Descriptor hash:
2efedd02034462c0b7993d9e2d1bec10665ad4612b9099b24b62f39eaef37edf
Update an existing coupon for the authenticated GHL location. This changes coupon behavior; use with disposable coupons unless the user explicitly confirms. GHL category: Payments. This writes to GoHighLevel and may change account data.
Request Body
{
"jsonrpc": "2.0",
"id": "ghl-update-coupon-example",
"method": "tools/call",
"params": {
"name": "ghl.update_coupon",
"arguments": {
"id": "id_123",
"name": "name_example",
"code": "code_example",
"discountType": "percentage",
"discountValue": 1,
"startDate": "startDate_example",
"altId": "altId_123",
"altType": "location",
"endDate": "endDate_example",
"tenantId": "tenantId_123"
}
}
}
Arguments Schema
{
"type": "object",
"required": [
"id",
"name",
"code",
"discountType",
"discountValue",
"startDate"
],
"properties": {
"id": {
"type": "string",
"description": "Coupon ID"
},
"code": {
"type": "string",
"description": "Coupon code. GHL only accepts letters and numbers; do not use spaces, hyphens, or underscores."
},
"name": {
"type": "string",
"description": "Coupon name"
},
"altId": {
"type": "string",
"description": "Optional location ID. If provided, it must match the authenticated runtime location."
},
"altType": {
"enum": [
"location"
],
"type": "string",
"description": "Alt Type. Defaults to location."
},
"endDate": {
"type": "string",
"description": "End date in YYYY-MM-DDTHH:mm:ssZ format"
},
"tenantId": {
"type": "string",
"description": "Tenant ID from list_tenants."
},
"startDate": {
"type": "string",
"description": "Start date in YYYY-MM-DDTHH:mm:ssZ format"
},
"productIds": {
"type": "array",
"items": {
"type": "string"
},
"description": "Product IDs that the coupon applies to"
},
"usageLimit": {
"type": "number",
"description": "Maximum number of times coupon can be used"
},
"discountType": {
"enum": [
"percentage",
"amount"
],
"type": "string",
"description": "Type of discount"
},
"discountValue": {
"type": "number",
"description": "Discount value"
},
"limitPerCustomer": {
"type": "boolean",
"description": "Whether to limit coupon to once per customer"
},
"applyToFuturePayments": {
"type": "boolean",
"description": "Whether coupon applies to future subscription payments"
},
"applyToFuturePaymentsConfig": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"forever",
"fixed"
],
"type": "string",
"description": "Type of future payments config"
},
"duration": {
"type": "number",
"description": "Duration for fixed type"
},
"durationType": {
"enum": [
"months"
],
"type": "string",
"description": "Duration type"
}
},
"description": "Configuration for future payments application"
}
}
}
Output Schema
{
"type": "object",
"required": [
"ok",
"data",
"error",
"meta"
],
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the GHL MCP operation completed successfully."
},
"data": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "array",
"items": {}
},
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Tool-specific GHL or local navigation result when ok is true."
},
"meta": {
"type": "object",
"description": "Safe execution, routing, and timing metadata.",
"additionalProperties": true
},
"error": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"description": "Safe error details when ok is false; credential values are never returned."
}
},
"description": "Normalized GHL MCP response envelope.",
"additionalProperties": false
}
Code Examples
- cURL
- Node.js
- Python
curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "ghl-update-coupon-example",
"method": "tools/call",
"params": {
"name": "ghl.update_coupon",
"arguments": {
"id": "id_123",
"name": "name_example",
"code": "code_example",
"discountType": "percentage",
"discountValue": 1,
"startDate": "startDate_example",
"altId": "altId_123",
"altType": "location",
"endDate": "endDate_example",
"tenantId": "tenantId_123"
}
}
}'
const response = await fetch('https://portal.madpanda3d.com/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "ghl-update-coupon-example",
"method": "tools/call",
"params": {
"name": "ghl.update_coupon",
"arguments": {
"id": "id_123",
"name": "name_example",
"code": "code_example",
"discountType": "percentage",
"discountValue": 1,
"startDate": "startDate_example",
"altId": "altId_123",
"altType": "location",
"endDate": "endDate_example",
"tenantId": "tenantId_123"
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://portal.madpanda3d.com/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "ghl-update-coupon-example",
"method": "tools/call",
"params": {
"name": "ghl.update_coupon",
"arguments": {
"id": "id_123",
"name": "name_example",
"code": "code_example",
"discountType": "percentage",
"discountValue": 1,
"startDate": "startDate_example",
"altId": "altId_123",
"altType": "location",
"endDate": "endDate_example",
"tenantId": "tenantId_123"
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 502 Upstream Error
{
"ok": true,
"message": "Tool ghl.update_coupon executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}
{
"ok": false,
"classification": "upstream_http_error",
"message": "Upstream MCP returned a non-success status."
}