---
title: "Update discount code status"
method: PUT
path: "/api/external/update-discount"
tags: ["Redemptions & Discount Codes"]
---

# Update discount code status

`PUT /api/external/update-discount`

## Request body

- UpdateDiscountRequest — Request containing customer ID, discount code, and new status
  - `customerId` integer, required — Shopify customer ID (numeric). Identifies which customer owns the discount code. Used to verify the discount code belongs to this customer before updating. Example: 67890
  - `discountCode` string, required — The discount code to update. Case-insensitive. Must be a valid loyalty discount code that belongs to the specified customer. Examples: "LOYALTY15OFF", "VIP20", "WELCOME10"
  - `status` 'USED' | 'UNUSED' | 'REFUNDED' | 'EXPIRED' | 'SUBSCRIPTION_ACTIVE' | 'CANCELED' | 'USED' | 'UNUSED' | 'SUBSCRIPTION_ACTIVE' | 'EXPIRED', required — New status for the discount code. Valid values: - USED: Mark code as used after checkout (most common) - SUBSCRIPTION_ACTIVE: Mark code as active for subscription renewals - UNUSED: Reset code to unused state (use carefully) - EXPIRED: Manually expire a code Status transitions: - UNUSED → USED: Normal checkout flow - UNUSED → SUBSCRIPTION_ACTIVE: Subscription created - SUBSCRIPTION_ACTIVE → USED: Subscription ended - Any → EXPIRED: Manual expiration Note: Cannot mark already USED codes as USED again.

## Response `200`

Discount code status successfully updated

- CustomerReward
  - `amount` number, double
  - `createAt` string, date-time, required
  - `customerId` integer, required
  - `description` string
  - `discountCode` string, required
  - `discountCodeId` string
  - `expireDate` string, date-time
  - `id` integer
  - `lastExpiryReminderSentDate` string, date-time
  - `orderId` integer
  - `orderName` string
  - `pointRedeemRuleId` integer
  - `pointTransactionId` integer
  - `productData` string
  - `rewardType` 'STORE_CREDIT' | 'DISCOUNT_CODE' | 'POINTS'
  - `shop` string, required
  - `status` 'USED' | 'UNUSED' | 'REFUNDED' | 'EXPIRED' | 'SUBSCRIPTION_ACTIVE' | 'CANCELED', required
  - `usageCount` integer
  - `usedAt` string, date-time
  - `variantId` integer

## Other responses

- `400` — Invalid request
- `401` — Unauthorized - Invalid or missing X-API-Key

---

[API](https://skmtc.dev/appstle/apis/admin-apis.md) · [All operations](https://skmtc.dev/appstle/apis/admin-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/appstle/admin-apis/revisions/27286503779d/schema)
