Skip to main content
PUT
Update coupon

📌 Endpoint

PUT /stores/{storeId}/coupons/{couponId} Partially updates an existing coupon.

🔐 Authentication

  • Private route.
  • Requires header Authorization with your API key and active plan.

🧾 Route parameters


🧍 Body (JSON)

Send at least one field:
  • code (3-32)
  • discount (1-100)
  • position (integer greater than or equal to 1)
  • useLimit (integer -1 to 9999; sending null resets to -1)
  • rules (array of usage rules, e.g. [{"type": "SINGLE_USE_PER_CUSTOMER"}]; sending null or [] clears rules)
  • expiredAt (future date in RFC3339 / date-time format, or null)
  • productIds (array of IDs; sending null clears associations)
  • categoryIds (array of IDs; sending null clears associations)

✅ Example request


Standard snippet (cURL)

Use the cURL example from the Request example section above as the official snippet.

📦 Success response (200)


⚠️ Possible errors

  • 400 INVALID_DATA → invalid body
  • 400 INVALID_DATA_CODE → code outside 3 to 32 characters
  • 400 INVALID_DATA_DISCOUNT → discount outside 1 to 100
  • 400 INVALID_DATA_POSITION → position less than 1
  • 400 INVALID_DATA_USE_LIMIT → useLimit outside -1 to 9999
  • 400 INVALID_DATA_RULES → invalid or malformed rules
  • 400 INVALID_DATA_EXPIRED_AT → invalid expiredAt or not in the future
  • 400 RELATION_NOT_FOUND → invalid product/category
  • 401 API_KEY_NOT_PROVIDED → Authorization header not provided
  • 401 INVALID_API_KEY → invalid API key
  • 401 UNAUTHENTICATED → unauthenticated user
  • 403 USER_DISABLED → user disabled
  • 403 NO_ACTIVE_SUBSCRIPTION → no active plan
  • 404 STORE_NOT_FOUND → store not found
  • 404 COUPON_NOT_FOUND → coupon not found
  • 409 COUPON_ALREADY_EXISTS → duplicated code
  • 429 RATE_LIMIT_EXCEEDED → per-minute rate limit exceeded
  • 500 INTERNAL_SERVER_ERROR → internal error
  • 503 SERVICE_UNAVAILABLE → service unavailable

Authorizations

Authorization
string
header
default:YOUR_API_KEY_HERE
required

Path Parameters

storeId
string
required
Required string length: 1 - 50
couponId
string
required
Required string length: 1 - 50

Body

application/json

Coupon fields to update.

code
string
Required string length: 3 - 32
discount
integer
Required range: 1 <= x <= 100
position
integer
Required range: x >= 1
useLimit
integer | null
Required range: -1 <= x <= 9999
rules
object[] | null
Maximum array length: 32
expiredAt
string<date-time> | null
productIds
string[] | null
Required string length: 1 - 50
categoryIds
string[] | null
Required string length: 1 - 50

Response

Update coupon.

code
string
required
Example:

"COUPON_UPDATED"

coupon
object
required

Store discount coupon.