Enabling Test Mode
There are two ways to enable test mode:Option 1: Test API Key
Use an API key with thezn_test_ prefix:
Option 2: X-Test-Mode Header
Add theX-Test-Mode: true header to any request:
Test mode uses a separate sandbox database. Orders created in test mode are completely isolated from production data.
Test Products
Use these special product URLs to simulate different order scenarios:| Product URL | Scenario | Description |
|---|---|---|
https://zinc.com/shop/products/test-success | Success | Order completes successfully |
https://zinc.com/shop/products/test-out-of-stock | Out of Stock | Product is unavailable |
https://zinc.com/shop/products/test-price-exceeded | Price Exceeded | Total exceeds max_price |
https://zinc.com/shop/products/test-invalid-address | Invalid Address | Shipping address validation fails |
https://zinc.com/shop/products/test-url-unreachable | URL Unreachable | Product URL is inaccessible |
https://zinc.com/shop/products/test-invalid-variant | Invalid Variant | Variant selection required |
https://zinc.com/shop/products/test-shipping-unavailable | Shipping Unavailable | Cannot ship to address |
https://zinc.com/shop/products/test-insufficient-funds | Insufficient Funds | Wallet balance too low |
Get Test Products Programmatically
Response
Error Timing
Test scenarios produce errors at different stages:Synchronous Errors
These errors occur immediately when creating the order:test-invalid-address- Returnsinvalid_shipping_addresserrortest-url-unreachable- Returnsurl_unreachableerrortest-insufficient-funds- Returnsinsufficient_fundserror
Example
Asynchronous Errors
These errors occur during order processing and are delivered via webhooks:test-out-of-stock- Order fails withproduct_out_of_stocktest-price-exceeded- Order fails withmax_price_exceededtest-invalid-variant- Order fails withinvalid_varianttest-shipping-unavailable- Order fails withshipping_unavailable
failed status during processing.
Test Success Scenario
Thetest-success product simulates a complete successful order:
Successful Test Order Response
When retrieved after processing:Skipped Validations
In test mode, the following validations are bypassed to simplify testing:- Wallet balance checks
- US retailer URL validation
- URL reachability validation
- Shipping address country validation
- Address verification via external APIs
Data Isolation
Test mode data is completely isolated:- Orders created in test mode are stored in a sandbox database
- Test orders do not appear in production order lists
- Production orders do not appear in test mode
- Wallet balances are separate between test and production
Best Practices
- Start with test mode - Build and test your entire integration using test products before switching to production
- Test all scenarios - Use each test product to verify your error handling works correctly
- Test webhooks - Configure webhooks and verify you receive events for both successful and failed test orders
- Verify error handling - Ensure your application gracefully handles both synchronous and asynchronous errors
- Use consistent mode - Don’t mix test and production API keys in the same environment

