Skip to main content

Delete Claimed Coupon Endpoint

Releases a coupon the user claimed but never used. The code returns to the available pool and can be claimed again by anyone.

  • Endpoint: /api/v1/campaigns/coupons/{couponId}
  • Method: DELETE
  • Authentication: Partner token and a signed-in user (Sanctum bearer token).

Headers

HeaderValueRequiredDescription
Partner-Access-TokenBase64 StringYesYour encrypted AES-256 time-sensitive token.
AuthorizationBearer <token>YesSanctum token of the signed-in user.
Acceptapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
couponIdIntegerYesCoupon code row ID — the id from the claim response, or coupon_id from a coupon card.

Sample Request

DELETE /api/v1/campaigns/coupons/9821
Partner-Access-Token: <your-generated-finalToken>
Authorization: Bearer <user-sanctum-token>
Accept: application/json

Sample Response

{
"result": 1,
"message": "Coupon deleted successfully.",
"data": []
}

Failure Responses

ConditionMessage
The ID does not exist, or the coupon belongs to another userCoupon not found or does not belong to you.
The coupon was already redeemed, expired, or voidedOnly claimed coupons that have not been used can be deleted.
{
"result": 0,
"message": "Only claimed coupons that have not been used can be deleted."
}

Notes

  • Nothing is deleted from the database. The row is reset to not_issued, its owner and issued_at are cleared, and its expiry falls back to the campaign-level value.
  • Resetting the expiry matters for campaigns that count valid days from the claim date: keeping the previous holder's personal deadline would strand a code nobody ever used.
  • Failures return HTTP 200 with result: 0.