Upsert Redemption Preference
PUT/client/users/:correlation_id/redemption-preference
Creates or replaces the member's redemption preference for the given type. One record per member per redemption type — this is a full upsert, not additive.
Path Parameters
| Param | Type | Description |
|---|---|---|
correlationId | string | Session correlation ID |
Request Body
| Field | Type | Required | Validation |
|---|---|---|---|
redemptionType | "VOUCHER" | "CASH" | "DONATION" | Yes | MVP: VOUCHER only — CASH/DONATION reserved for future → 400 UNSUPPORTED_REDEMPTION_TYPE |
thresholdPoints | number | Yes | Must be a value in voucherConfig.redemptionPreference.tiers (e.g. 500, 1000, 5000) → else 400 INVALID_THRESHOLD |
status | "ACTIVE" | "PAUSED" | No | Defaults to ACTIVE on create. ACTIVE — DIG evaluates notifications when balance ≥ threshold. PAUSED — DIG suppresses notifications. |
Preconditions (in order)
voucherConfig.redemptionPreference.enabled === true→ else 404FEATURE_NOT_ENABLED- Account exists → else 404
ACCOUNT_NOT_FOUND - Not ghost (
AccountStatus !== 'unregistered') → else 403GHOST_MEMBER_NOT_ALLOWED - Active account (
AccountStatus === 'active') → else 403ACCOUNT_NOT_ACTIVE redemptionType === 'VOUCHER'(MVP) → else 400UNSUPPORTED_REDEMPTION_TYPEthresholdPointsis a value invoucherConfig.redemptionPreference.tiers→ else 400INVALID_THRESHOLD
Response 200
tierLabel is resolved server-side via reverse lookup in the voucherConfig.redemptionPreference.tiers map. No businessUnit — preference is member-level, not BU-scoped.
Side Effects
Triggers a REDEMPTION_PREFERENCE UPSERT sync to DIG via RedemptionPreferenceSyncProcessor. DIG stores the preference and evaluates balance >= thresholdPoints on every subsequent balance update.
Errors
| Code | Error | Description |
|---|---|---|
| 400 | UNSUPPORTED_REDEMPTION_TYPE | redemptionType is not VOUCHER (MVP restriction) |
| 400 | INVALID_THRESHOLD | thresholdPoints is not a valid value in the client's tier config |
| 403 | GHOST_MEMBER_NOT_ALLOWED | Account has AccountStatus: unregistered |
| 403 | ACCOUNT_NOT_ACTIVE | Account is not in active status |
| 404 | ACCOUNT_NOT_FOUND | No account found for this session |
| 404 | FEATURE_NOT_ENABLED | voucherConfig.redemptionPreference.enabled is false for this client |
Request
Responses
- 200
- 400
- 403
- 404
200 - Preference Upserted
400 - Invalid Threshold
403 - Ghost Member Not Allowed
404 - Feature Not Enabled