Apply a coupon to an organization (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
POST /admin/orgs/{orgId}/coupon

Puts the coupon on top of the organization's coupon stack, making it the active discount on the organization's Stripe customer while earlier coupons stay beneath it, and returns the stack. Returns 404 when the organization has no Stripe customer or the coupon is unknown, and 400 when the coupon is expired, deleted or already on the stack. Super admin only.

Path parameters

  • orgId string Required

    Id of the organization

application/json

Body Required

  • couponId string Required

    Stripe coupon id (the redeemable code)

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • stack array[object] Required

        Top of the stack first

        Hide stack attributes Show stack attributes object
        • couponId string Required
        • pushedAt string(date-time) Required
        • name string | null Required
        • percentOff number | null Required
        • amountOffCents number | null Required
        • duration string | null Required
        • status string Required

          active/expired/deleted, or "unknown" when the coupon is missing from the local mirror

        • eligible boolean Required

          Whether this entry could be the active discount

        • active boolean Required

          The ONE entry currently mirrored onto the Stripe customer — the top eligible coupon

      • activeCouponId string | null Required

        The coupon currently discounting this org, if any

    • statusCode number Required
    • timestamp string(date-time) Required
POST /admin/orgs/{orgId}/coupon
curl \
 --request POST 'http://api.example.com/admin/orgs/{orgId}/coupon' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "couponId": "string"
}'
Request examples
{
  "couponId": "string"
}
Response examples (200)
{
  "data": {
    "stack": [
      {
        "couponId": "SPRING20",
        "pushedAt": "2026-01-15T10:15:00.000Z",
        "name": "Spring 20% off",
        "percentOff": 20,
        "amountOffCents": 42.0,
        "duration": "repeating",
        "status": "active",
        "eligible": true,
        "active": true
      }
    ],
    "activeCouponId": "SPRING20"
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}