get_voucher
Fetch complete voucher details by code or ID, including discount, usage, validation rules, and QR/barcode assets for management.
Instructions
Retrieve detailed information about a specific voucher by its code or ID.
Returns complete voucher configuration including discount details, usage limits, validation rules, and current status for voucher analysis and management.
Enhanced Features:
Automatically fetches and processes validation rules for detailed rule analysis
Provides both raw validation_rules_assignments and processed validation_rules
Includes QR/barcode assets for voucher display and distribution
Parameters:
identifier: Voucher code or ID for lookup
Identifier Types:
Voucher Code: Human-readable code with alphanumeric and special characters (e.g., "WELCOME10", "SAVE20", "TEST-ABC")
Voucher ID: System identifier with 'v_' prefix (e.g., "v_abc123def456")
Validation Rules:
Identifier must correspond to existing voucher
Both codes and IDs are case-sensitive
Examples:
get_voucher(identifier="WELCOME10")
get_voucher(identifier="v_abc123def456")
Returns: JSON object containing complete voucher details including:
Core Voucher Information:
id: Voucher system identifier (e.g., "v_4dyaDRCMD0bUDNv47pDqnGlCJhSVWtnT")
code: Human-readable voucher code (e.g., "DELUXE-SG63RY")
type: Voucher type ("DISCOUNT_VOUCHER", "GIFT_VOUCHER", "LOYALTY_CARD")
active: Boolean voucher status
object: Always "voucher"
Discount Configuration:
discount: Discount details with type and value (e.g., {"type": "PERCENT", "percent_off": 25})
gift: Gift voucher amount (null for discount vouchers)
loyalty_card: Loyalty card details (null for regular vouchers)
Validity and Constraints:
start_date, expiration_date: Validity period (ISO 8601 or null)
validity_timeframe, validity_hours: Time-based restrictions
validity_day_of_week: Array of valid weekdays (1=Monday, 7=Sunday)
Usage Tracking:
redemption: Usage statistics with quantity limits and current usage
publish: Publication information and count
holder_id: Customer ID if voucher is assigned
Campaign and Categorization:
campaign, campaign_id: Parent campaign information (null for standalone vouchers)
category, category_id, categories: Voucher categorization
Validation Rules (Enhanced):
assigned_validation_rules: Processed validation rules with detailed conditions (added by this tool) See "Validation Rules Structure" section in server instructions for complete field documentation
Additional Data:
metadata: Custom voucher attributes
additional_info: Extra voucher information
assets: QR code and barcode URLs for voucher display
is_referral_code: Boolean indicating referral voucher
created_at, updated_at: ISO 8601 timestamps
Use Cases:
Verify voucher validity and details
Check voucher usage and limits
Analyze voucher configuration and discount mechanics
Understand validation rules and product requirements
Check voucher ownership and assignment
Get QR/barcode assets for voucher display
Raises:
ToolError: If voucher not found or invalid identifier format
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |