RevKeen Docs
Api reference

Update a discount

Update an existing discount. Note: discount code and type cannot be changed.


Related endpoints

  • GET /discounts — List discounts
  • POST /discounts — Create a discount
  • GET /discounts/{id} — Get discount by ID
  • DELETE /discounts/{id} — Delete a discount

Common errors

  • 400 invalid_request — malformed payload or failed validation.
  • 401 unauthenticated — missing, malformed, or revoked API key.
  • 404 resource_missing — the referenced resource does not exist or is not visible to your key.

Idempotency

Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.

PATCH
/discounts/{id}
x-api-key<token>

Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.

In: header

Path Parameters

id*string

Discount ID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://api.revkeen.com/v2/discounts/00000000-0000-0000-0000-000000000000" \  -H "x-api-key: $REVKEEN_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "description": null,    "discount_value": 0,    "applies_to": "all",    "scope": "entire_order",    "product_ids": null,    "max_redemptions": null,    "max_redemptions_per_user": 0,    "valid_from": null,    "valid_until": null,    "is_active": false,    "is_archived": false,    "recurring_type": "once",    "recurring_cycles": null,    "first_time_customer": false  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "code": "SUMMER20",
    "name": "Summer Sale 20% Off",
    "description": "20% off for summer promotion",
    "discount_type": "percentage",
    "discount_value": 20,
    "applies_to": "all",
    "product_ids": null,
    "max_redemptions": 100,
    "current_redemptions": 25,
    "valid_from": "2024-06-01T00:00:00Z",
    "valid_until": "2024-08-31T23:59:59Z",
    "recurring_type": "once",
    "recurring_cycles": null,
    "first_time_customer": false,
    "is_active": true,
    "created_at": "2024-01-14T08:00:00Z",
    "updated_at": "2024-01-14T08:00:00Z"
  }
}
Empty
Empty
Empty