v1

latestOpenAPI 3.0.12026-07-21161785.3 KB
Redemptions & Discount Codes

Update discount code status

put/api/external/update-discount

Request body

customerIdinteger 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

discountCodestring 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.

Example request

{
  "customerId": 67890,
  "discountCode": "LOYALTY15OFF",
  "status": "USED"
}

Response

Discount code status successfully updated

amountnumber double
createAtstring date-time required
customerIdinteger required
descriptionstring
discountCodestring required
discountCodeIdstring
expireDatestring date-time
idinteger
lastExpiryReminderSentDatestring date-time
orderIdinteger
orderNamestring
pointRedeemRuleIdinteger
pointTransactionIdinteger
productDatastring
rewardType'STORE_CREDIT' | 'DISCOUNT_CODE' | 'POINTS'
shopstring required
status'USED' | 'UNUSED' | 'REFUNDED' | 'EXPIRED' | 'SUBSCRIPTION_ACTIVE' | 'CANCELED' required
usageCountinteger
usedAtstring date-time
variantIdinteger