Skip to main content

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

ParamTypeDescription
correlationIdstringSession correlation ID

Request Body

FieldTypeRequiredValidation
redemptionType"VOUCHER" | "CASH" | "DONATION"YesMVP: VOUCHER only — CASH/DONATION reserved for future → 400 UNSUPPORTED_REDEMPTION_TYPE
thresholdPointsnumberYesMust be a value in voucherConfig.redemptionPreference.tiers (e.g. 500, 1000, 5000) → else 400 INVALID_THRESHOLD
status"ACTIVE" | "PAUSED"NoDefaults to ACTIVE on create. ACTIVE — DIG evaluates notifications when balance ≥ threshold. PAUSED — DIG suppresses notifications.

Preconditions (in order)

  1. voucherConfig.redemptionPreference.enabled === true → else 404 FEATURE_NOT_ENABLED
  2. Account exists → else 404 ACCOUNT_NOT_FOUND
  3. Not ghost (AccountStatus !== 'unregistered') → else 403 GHOST_MEMBER_NOT_ALLOWED
  4. Active account (AccountStatus === 'active') → else 403 ACCOUNT_NOT_ACTIVE
  5. redemptionType === 'VOUCHER' (MVP) → else 400 UNSUPPORTED_REDEMPTION_TYPE
  6. thresholdPoints is a value in voucherConfig.redemptionPreference.tiers → else 400 INVALID_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

CodeErrorDescription
400UNSUPPORTED_REDEMPTION_TYPEredemptionType is not VOUCHER (MVP restriction)
400INVALID_THRESHOLDthresholdPoints is not a valid value in the client's tier config
403GHOST_MEMBER_NOT_ALLOWEDAccount has AccountStatus: unregistered
403ACCOUNT_NOT_ACTIVEAccount is not in active status
404ACCOUNT_NOT_FOUNDNo account found for this session
404FEATURE_NOT_ENABLEDvoucherConfig.redemptionPreference.enabled is false for this client

Request

Responses

200 - Preference Upserted