Using the Swagger UI
๐ Interactive Documentation: The Swagger UI provides live, interactive API documentation where you can test endpoints directly from your browser.
Accessing Swagger UI
Development/Sandbox Environment
- URL:
https://partner-api.dev.zebec.io/api-docs
- Or locally:
http://localhost:8001/api-docs
- Authentication: Required (use HMAC generator tool)
Getting Started
Step 1: Generate Authentication Headers
Before testing any endpoints, you need to generate valid HMAC authentication headers:
- Go to the HMAC Generator tool
- Enter your API credentials (API Key and Secret)
- Select the HTTP method (GET/POST) and endpoint path
- Add request body if needed (for POST requests)
- Click "Generate Headers"
- Copy the generated header values
Step 2: Authorize in Swagger UI
- Open the Swagger UI
- Click the "Authorize" button at the top of the page
- You'll see 4 fields to fill:
x-api-key
x-timestamp
x-nonce
x-signature
- Paste the values from the HMAC generator into each field
- Click "Authorize"
- Close the modal
โ ๏ธ Signature Validity: HMAC signatures include a timestamp and are only valid for a short period (typically 5 minutes). If you get authentication errors, regenerate fresh headers using the HMAC generator tool.
Step 3: Test Endpoints
- Browse the available endpoints organized by tags:
- Cards v1 (Standard) - Basic card operations (all API keys)
- Cards v2 (Premium) - Advanced features (v2 keys only)
- Admin - Client management (mTLS only)
- Click on an endpoint to expand it
- Click "Try it out"
- Fill in any required parameters or request body
- Click "Execute"
- View the response below
Understanding the API Organization
๐ Cards v1 (Standard)
Core card operations available to all partners:
GET /orders/programs - Get available card programs by country
POST /orders/validate-address - Validate recipient address
POST /orders/create - Create a new card order
GET /orders/lookup - Lookup orders by email, orderId, or txHash
๐ Cards v2 (Premium)
Advanced features requiring v2 API key:
GET /v2/cards/{orderId} - Get card details with balance
GET /v2/cards/{orderId}/balance - Get current balance (requires balanceAccess)
POST /v2/cards/{orderId}/transactions - Get transaction history (requires transactionAccess)
GET /v2/cards - List all cards for this client
๐ก Tip: Swagger UI shows which features are required for each v2 endpoint. Check the endpoint description for feature requirements like balanceAccess or transactionAccess.
Testing Tips
1. Start with Health Check
Test the unauthenticated ping endpoint first:
GET /ping
This confirms the API is accessible.
2. Test Authentication
Try a simple authenticated endpoint to verify your HMAC signature:
GET /orders/programs?country=USA
3. Use Sandbox Email Patterns
When testing order creation in development/sandbox, use special email patterns:
test@example.com โ SUCCESS status
test@example.com.pending โ PENDING status
test@example.com.failed โ FAILED status
See the Sandbox Environment Guide for details.
4. Check Response Schemas
Swagger UI shows the expected response schema for each endpoint. Use this to understand the data structure.
5. Save Successful Requests
Swagger UI allows you to download request/response examples. Use this to build your integration code.
Common Issues
401 Unauthorized
- โ
Regenerate headers with current timestamp
- โ
Verify API key is correct
- โ
Check all 4 headers are filled in Authorize modal
- โ
Ensure nonce header is present
403 Forbidden
- โ
Check if you're using v1 key for v2 endpoints
- โ
Verify required feature flags are enabled (e.g., balanceAccess)
- โ
Confirm API key is active
400 Bad Request
- โ
Review request body matches the schema
- โ
Check all required fields are present
- โ
Validate field formats (emails, UUIDs, country codes)
โจ Pro Tip: Open your browser's Developer Tools (F12) โ Network tab while using Swagger UI. This shows the actual HTTP requests being made, including all headers and the request body. This is invaluable for debugging your own integration code!
Additional Resources