Activategiftcard
Activate Gift Card
Activates a pending gift card and loads the initial balance. Creates an ACTIVATION transaction for audit trail.
Business Rules:
- Only PENDING cards can be activated
- Card must not be expired
- Balance is set to initialValue upon activation
- Status changes from PENDING to ACTIVE
- Customer information can be updated during activation
- Activation creates a transaction record
- Authenticated customer session is required
Path Parameters:
programId: MongoDB ObjectId of the loyalty programcardId: MongoDB ObjectId of the gift card
Request Body:
customerEmail: Customer email (optional, updates card if provided)customerName: Customer name (optional, updates card if provided)
Returns:
- Activated gift card details with updated balance and ACTIVE status
- Includes activatedAt timestamp
Status Codes:
- 200: Gift card activated successfully
- 400: Card cannot be activated (already active, expired, or invalid status)
- 404: Gift card not found or doesn’t belong to program
- 409: Activation conflicted with concurrent update
- 401: Unauthorized
Idempotency Scope:
- Idempotency keys are scoped to
programId + activate + cardId - The same key may be reused for different cards or different gift card actions
Authorizations
JWT access token obtained from POST /v2/token.
Headers
Path Parameters
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
Body
Response
Successful Response
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
Gift card status enumeration.
pending, active, suspended, expired, voided, depleted 24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
The customer card object
Attributes: serialNumber (str): The serial number of the customer pass passTypeIdentifier (str): The pass type identifier of the customer pass url (str): The shareable URL of the customer pass
