Payhip Coupons API

Create, list, and retrieve discount coupons.

Operations 3

POST /coupons Create a coupon #
GET /coupons List coupons #
GET /coupons/{id} Retrieve a coupon #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/payhip-coupons-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

payhip-coupons-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Payhip Coupons API
  description: The Payhip API provides programmatic access to a Payhip creator e-commerce account. It follows RESTful conventions, uses resource-based URLs, accepts form-encoded or JSON request bodies, and returns JSON responses wrapped in a "data" object. The public API currently exposes two resource families - Coupons and software License Keys. Coupon operations authenticate with the account API key (payhip-api-key header); license operations authenticate with a per-product secret key (product-secret-key header). Both keys are managed from the Developer Settings page. Order, customer, and transaction data is not exposed as a REST resource; it is delivered through the webhooks documented in the "webhooks" section (paid, refunded, subscription.created, subscription.deleted), whose payloads carry a signature equal to hash('sha256', apiKey). Not all Payhip features are available in the API; Payhip states more resources are planned.
  version: '2.0'
  contact:
    name: Payhip
    url: https://payhip.com
  x-modeled: Paths, methods, webhook event names, and field names are taken from Payhip's published API reference (payhip.com/api-reference) and webhooks help article. Request/response schemas expand documented fields into typed properties and should be reconciled against a live account response.
servers:
- url: https://payhip.com/api/v2
  description: Payhip public API
tags:
- name: Coupons
  description: Create, list, and retrieve discount coupons.
paths:
  /coupons:
    post:
      operationId: createCoupon
      tags:
      - Coupons
      summary: Create a coupon
      description: Creates a discount coupon for a product or collection. Provide either percent_off or amount_off.
      security:
      - apiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CouponInput'
      responses:
        '200':
          description: The created coupon.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
    get:
      operationId: listCoupons
      tags:
      - Coupons
      summary: List coupons
      description: Lists all coupons on the account, paginated.
      security:
      - apiKeyAuth: []
      parameters:
      - name: page
        in: query
        required: false
        description: Page number for paginated results.
        schema:
          type: integer
          minimum: 1
      responses:
        '200':
          description: A paginated list of coupons.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Coupon'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /coupons/{id}:
    get:
      operationId: getCoupon
      tags:
      - Coupons
      summary: Retrieve a coupon
      description: Retrieves a single coupon by its identifier.
      security:
      - apiKeyAuth: []
      parameters:
      - name: id
        in: path
        required: true
        description: The identifier of the coupon.
        schema:
          type: string
      responses:
        '200':
          description: The requested coupon.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CouponEnvelope:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Coupon'
    Coupon:
      allOf:
      - $ref: '#/components/schemas/CouponInput'
      - type: object
        properties:
          id:
            type: string
            description: Unique identifier for the coupon.
          usage_count:
            type: integer
            description: Number of times the coupon has been redeemed.
    CouponInput:
      type: object
      required:
      - code
      properties:
        code:
          type: string
          description: The coupon code customers enter at checkout.
        coupon_type:
          type: string
          description: Scope of the coupon.
          enum:
          - single
          - multi
          - collection
        percent_off:
          type: number
          description: Percentage discount. Provide this or amount_off.
        amount_off:
          type: integer
          description: Fixed discount in cents. Provide this or percent_off.
        product_key:
          type: string
          description: The product the coupon applies to (for single/multi coupons).
        collection_id:
          type: string
          description: The collection the coupon applies to (for collection coupons).
        minimum_purchase_amount:
          type: integer
          description: Minimum cart total in cents required for the coupon to apply.
        usage_limit:
          type: integer
          description: Maximum number of times the coupon can be redeemed.
        start_date:
          type: string
          format: date
          description: Date the coupon becomes active.
        end_date:
          type: string
          format: date
          description: Date the coupon expires.
        notes:
          type: string
          description: Internal notes about the coupon.
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key / product secret key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: payhip-api-key
      description: Account API key from the Developer Settings page. Used for coupon operations.
    productSecretAuth:
      type: apiKey
      in: header
      name: product-secret-key
      description: Per-product secret key from the Developer Settings page. Used for license key operations.