payments-ai · Schema

PublicApiCreateDiscountCodeRequest

CompanyPaymentsArtificial IntelligenceFintechMerchant of RecordPayment Orchestration

Properties

Name Type Description
internalName string Name shown to the merchant only.
code string Code the buyer types at checkout. Stored upper case and unique per merchant. Cannot be changed after create.
promoType object
amountOff object For percentage: greater than 0 and at most 100. For flat_amount: money in `currency`, a whole number of that currency's minor unit (whole yen for jpy, so 500 and not 500.5).
currency object Required when promoType is flat_amount. Lowercase ISO 4217.
billingPeriod object
billingPeriodLength integer Required when billingPeriod is repeating.
billingPeriodUnit object Required when billingPeriod is repeating.
productId stringnull Product the code is limited to. Omit or send null for a store-wide code.
expiresAt string The code stops applying after this time. Omit for no expiry.
View JSON Schema on GitHub

JSON Schema

payments-ai-public-api-create-discount-code-request-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/payments-ai/json-schema/payments-ai-public-api-create-discount-code-request-schema.json",
  "title": "PublicApiCreateDiscountCodeRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/payments-ai-public-api-api-openapi.yml#/components/schemas/PublicApiCreateDiscountCodeRequest",
  "type": "object",
  "required": [
    "internalName",
    "code",
    "promoType",
    "amountOff",
    "billingPeriod"
  ],
  "properties": {
    "internalName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Name shown to the merchant only."
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Code the buyer types at checkout. Stored upper case and unique per merchant. Cannot be changed after create."
    },
    "promoType": {
      "$ref": "#/$defs/PublicApiDiscountPromoType"
    },
    "amountOff": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicApiDiscountAmountOff"
        },
        {
          "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
        }
      ],
      "description": "For percentage: greater than 0 and at most 100. For flat_amount: money in `currency`, a whole number of that currency's minor unit (whole yen for jpy, so 500 and not 500.5)."
    },
    "currency": {
      "allOf": [
        {
          "$ref": "#/$defs/SharedTypes.CurrencyCode"
        }
      ],
      "description": "Required when promoType is flat_amount. Lowercase ISO 4217."
    },
    "billingPeriod": {
      "$ref": "#/$defs/PublicApiDiscountBillingPeriod"
    },
    "billingPeriodLength": {
      "type": "integer",
      "format": "int32",
      "minimum": 1,
      "description": "Required when billingPeriod is repeating."
    },
    "billingPeriodUnit": {
      "allOf": [
        {
          "$ref": "#/$defs/PublicApiDiscountBillingPeriodUnit"
        }
      ],
      "description": "Required when billingPeriod is repeating."
    },
    "productId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Product the code is limited to. Omit or send null for a store-wide code."
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "The code stops applying after this time. Omit for no expiry."
    }
  },
  "$defs": {
    "PublicApiDiscountAmountOff": {
      "type": "string",
      "description": "Decimal string, for example \"20\" or \"10.50\". A JSON number is also accepted."
    },
    "PublicApiDiscountBillingPeriod": {
      "type": "string",
      "enum": [
        "once",
        "repeating",
        "forever"
      ],
      "description": "How long the discount applies to a subscription: the first payment only (once), a number of billing periods (repeating), or every payment (forever)."
    },
    "PublicApiDiscountBillingPeriodUnit": {
      "type": "string",
      "enum": [
        "day",
        "week",
        "month",
        "year"
      ]
    },
    "PublicApiDiscountPromoType": {
      "type": "string",
      "enum": [
        "percentage",
        "flat_amount"
      ]
    },
    "SharedTypes.CurrencyCode": {
      "type": "string",
      "pattern": "^[a-z]{3}$",
      "description": "ISO 4217 currency code. Always lowercase (e.g. 'usd', 'eur')."
    },
    "SharedTypes.MoneyAmountValue": {
      "type": "number",
      "format": "decimal",
      "description": "Decimal money amount for financial values."
    }
  }
}

Work with this as data

Every JSON Schema 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 schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • 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 JSON Schema
curl "https://apis.io/api/v1/json-schemas/payments-ai-public-api-create-discount-code-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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