Edit, deactivate or reactivate a coupon (billing-ops staff)
Changed onSend only the fields to change; the code is matched case-insensitively. {"active": false} stops the coupon redeeming at once; {"active": true} restores it with its limits and redemptions unchanged (audited as coupon.deactivate / coupon.reactivate). expiresAt, maxRedemptions, maxRedemptionsPerAccount, eligibleAccountId and campaignLabel take the create checks, with the same VALIDATION_ERROR details.field; null clears expiresAt (never expires), maxRedemptions (no total cap) and eligibleAccountId (any account). A cap cannot go below the redemptions already made: maxRedemptions below the total, maxRedemptionsPerAccount below the most any one account has redeemed. code and creditGrant cannot be changed (details.field names them). The changed fields are audited as one coupon.update row with their old and new values; a request that changes nothing writes no audit row. An empty body is VALIDATION_ERROR.
Request
- Base URL: https://api.greentally.ai/v1
- URL: https://api.greentally.ai/v1/internal/billing-ops/coupons/{code}
- Auth: HTTP bearer
Path parameters
Request body
Response
The coupon after the change
Changes
- ○
endpoint added
- ○