Discounts
View as Markdown

Would this code work? (redeems nothing)

Needs the catalog:read scope, or a full-access key. About scopes

POST
/api/v1/promotion-codes/validate

Authorization

Authorization
Required
Bearer <token>

An API key: gpy_test_… or gpy_live_… (or an agent key, agk_…).

In: header

Request Body

application/jsonOptional

code
Required
string

Minimum length: 1Maximum length: 64

customer_idstring

Format: "uuid"

plan_idstring

Format: "uuid"
curl -X POST "https://globalymint.com/api/v1/promotion-codes/validate" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "string",
    "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'

Always 200: an invalid code is valid:false with a machine-readable reason.

{
  "data": {
    "valid": true,
    "code": "string",
    "promotion_code_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "coupon": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "percent_off": "20",
      "amount_off_cents": "1999",
      "currency": "USD",
      "duration": "once",
      "duration_in_periods": 0,
      "applies_to_plan_ids": [
        "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      ]
    },
    "reason": "string"
  },
  "_agent": {
    "summary": "string",
    "status": "ok",
    "next_actions": [
      "string"
    ],
    "warnings": [
      "string"
    ]
  },
  "api_version": "2026-07-01"
}