Discounts
View as Markdown

Update a promotion code

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

PATCH
/api/v1/promotion-codes/{id}

Authorization

Authorization
Required
Bearer <token>

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

In: header

Request Body

application/jsonOptional

max_redemptionsinteger | null

expires_atstring | null

Format: "date-time"

activeboolean

Path Parameters

id
Required
string

Format: "uuid"
curl -X PATCH "https://globalymint.com/api/v1/promotion-codes/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "max_redemptions": 1,
    "expires_at": "2019-08-24T14:15:22Z",
    "active": true
  }'

The code.

{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "coupon_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "code": "string",
    "first_time_only": true,
    "max_redemptions": 0,
    "times_redeemed": 0,
    "expires_at": "2019-08-24T14:15:22Z",
    "active": true,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "_agent": {
    "summary": "string",
    "status": "ok",
    "next_actions": [
      "string"
    ],
    "warnings": [
      "string"
    ]
  },
  "api_version": "2026-07-01"
}