Overview
Zupy uses API key authentication for secure access to all loyalty program APIs. This guide covers the complete authentication process, from initial setup through API key generation and usage.Quick Start
Get authenticated and make your first API call in 5 minutes
Authentication Flow
The Zupy authentication process ensures secure partner access through a two-step verification:1
OTP Verification
Verify your partner account using One-Time Password sent to your registered contact
2
API Key Generation
Generate secure API keys with specific permissions for your integration
3
API Usage
Include API key in request headers to access loyalty program endpoints
Quick Start
Step 1: Access Developer Dashboard
Navigate to your Zupy developer dashboard to begin the authentication process:Partner Account Required: You need an active Zupy partner account. Contact [email protected] if you don’t have access.
Step 2: OTP Verification Process
Before generating API keys, you’ll need to verify your identity using our OTP system:WhatsApp OTP Verification
WhatsApp OTP Verification
- Request OTP: Click “Verify Account” in your dashboard
- Receive Code: Check your registered WhatsApp for a 6-digit verification code
- Enter Code: Input the code within 5 minutes
- Confirmation: Successful verification unlocks API key generation
123456 (6 digits, expires in 5 minutes)Email OTP Alternative
Email OTP Alternative
If WhatsApp is unavailable, request email verification:
- Click “Send via Email” in the verification dialog
- Check your registered email for the verification code
- Enter the 6-digit code to complete verification
- Email codes are valid for 10 minutes
Step 3: Generate API Keys
After successful OTP verification, generate your API keys:API Key Management
Key Generation Options
When creating API keys, you can configure several important settings:Descriptive name for the API key (e.g., “Production PDV Integration”)
Array of permission scopes for the API key
Requests per minute limit (default: 100, max: 2000)
Environment type for the key
Optional array of allowed IP addresses/CIDR blocks
Optional expiration date (ISO 8601 format). Default: 1 year from creation
Key Format and Structure
Zupy API keys follow a structured format for easy identification:zup: Zupy platform identifierlive/test: Environment indicator (production/staging)sk: Secret key typeidentifier: 20-character random string
Permission Scopes Explained
Customer Permissions
Customer Permissions
customer:read
- Search customers by phone, email, CPF
- Retrieve customer profiles and RFM data
- Access customer balance and transaction history
- Create new customer profiles
- Update existing customer information
- Manage customer preferences and verification status
Loyalty Permissions
Loyalty Permissions
loyalty:read
- Access reward catalog and availability
- Retrieve loyalty program configuration
- View points balance and transaction history
- Award points for transactions
- Redeem rewards and generate coupons
- Modify points balance (admin operations)
Coupon Permissions
Coupon Permissions
coupons:validate
- Validate coupon codes for redemption
- Check coupon status and usage limits
- Calculate discount amounts and eligibility
- Mark coupons as used/redeemed
- Track coupon usage and order association
- Handle coupon reversal operations
Administrative Permissions
Administrative Permissions
webhooks:manage
- Register webhook endpoints for events
- Configure webhook authentication and filters
- View webhook delivery status and retry logs
- Access administrative reports and analytics
- View system health and performance metrics
- Export customer data and audit logs
Using API Keys
Request Header Format
Include your API key in every request using theAuthorization header:
Environment URLs
Use the appropriate base URL for your environment:production
Production Environment:
https://api.zupy.com/v1/Use this for live integrations with actual customer datastaging
Staging Environment:
https://api-staging.zupy.com/v1/Use this for development and testing with sample dataSecurity Best Practices
API Key Storage
Environment Variables (Recommended)
Environment Variables (Recommended)
Store API keys as environment variables, never in code:
Key Rotation Strategy
Key Rotation Strategy
Implement regular key rotation for enhanced security:
- Generate New Key: Create new API key with same permissions
- Update Applications: Deploy updated key to all integration points
- Monitor Usage: Verify new key is working correctly
- Revoke Old Key: Delete previous key after successful migration
IP Restrictions
IP Restrictions
Add IP restrictions to limit access from specific networks:Benefits: Prevents unauthorized usage even if key is compromised
Error Handling
Handle authentication errors gracefully in your integration:Implementation Example
Here’s a complete authentication implementation with error handling:Rate Limits and Quotas
Default Rate Limits
Rate limits are applied per API key and are designed to ensure fair usage:Standard Keys
100 requests per minuteSuitable for most integrations and development purposes
1,000 requests per minuteFor high-volume integrations and production systems
Enterprise Keys
2,000+ requests per minuteCustom limits available for enterprise partnerships
Rate Limit Headers
Every API response includes rate limit information:X-RateLimit-Limit: Total requests allowed in the windowX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Timestamp when the limit resets (Unix time)X-RateLimit-Window: Rate limit window in seconds
Handling Rate Limits
Implement exponential backoff when rate limits are exceeded:Troubleshooting
Common Authentication Issues
Invalid API Key Format
Invalid API Key Format
Error:
authentication_failed - Invalid API key formatCauses:- Missing
Bearerprefix in Authorization header - Malformed API key (not following zup_* format)
- Extra spaces or characters in the key
Expired API Key
Expired API Key
Error:
authentication_failed - API key has expiredCauses:- API key has reached its expiration date
- Key was manually revoked in the dashboard
- Generate a new API key in your dashboard
- Update your application configuration
- Test the new key with a simple API call
Permission Denied
Permission Denied
Error:
permission_denied - Insufficient permissions for this operationCauses:- API key doesn’t have required permission scope
- Operation requires higher-level permissions (e.g., admin)
- Check the endpoint documentation for required permissions
- Update your API key permissions in the dashboard
- Or create a new key with appropriate permissions
OTP Verification Issues
OTP Code Not Received
OTP Code Not Received
WhatsApp Issues:
- Verify your registered WhatsApp number is correct
- Check if WhatsApp Business API messages are blocked
- Try requesting email OTP as alternative
- Check spam/junk folders for the verification email
- Verify your registered email address is correct
- Ensure zupy.com domain is not blocked
- Wait 60 seconds before requesting a new code
- Contact [email protected] if issues persist
OTP Code Expired
OTP Code Expired
Error:
verification_failed - OTP code has expiredCauses:- WhatsApp codes expire after 5 minutes
- Email codes expire after 10 minutes
- Code was already used successfully
- Request a new OTP code
- Complete verification within the time limit
- Use the most recently received code
Testing Authentication
Use these test endpoints to verify your authentication setup:Support and Resources
Getting Help
Developer Support
Email our developer support team for authentication issues and API questions
API Status Page
Check real-time API availability and authentication service status
Community Forum
Connect with other developers and share integration experiences
Additional Resources
- API Reference: Complete endpoint documentation with examples
- SDKs: Official client libraries for popular programming languages
- Postman Collection: Ready-to-use API collection for testing
- Integration Guides: Platform-specific integration tutorials
Security Notice: Never share your API keys publicly or commit them to version control. Contact support immediately if you suspect a key has been compromised.