The Zebec Partner Service provides a sandbox environment in development and test deployments that allows partners to test their integrations without connecting to the real card processing backend. This sandbox mode simulates all the expected behaviors of the production API while providing predictable responses based on test data patterns.
NODE_ENV=development) and Test (NODE_ENV=test)The sandbox mode is automatically activated when the service runs in development or test environment. No special configuration or API changes are required - simply use the same endpoints and authentication as production.
The sandbox determines the order outcome based on the recipient's email address:
Pattern: Any email that doesn't match the special patterns below
Status: SUCCESS
Examples:
john.doe@example.comtest.user@company.co.ukpartner.integration@domain.orgResponse Includes:
Pattern: Email addresses ending with .pending
Status: PENDING
Examples:
test.user@example.pendingcompliance.check@domain.pendingVERIFICATION@TEST.PENDING (case-insensitive)Response Includes:
Pattern: Email addresses ending with .failed
Status: FAILED
Examples:
invalid.address@example.failedcompliance.reject@domain.failedTEST@EXAMPLE.FAILED (case-insensitive)Response Includes:
{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"recipient": {
"participantId": "TEST001",
"firstName": "John",
"lastName": "Doe",
"emailAddress": "john.doe@example.com",
// ... other recipient fields
},
"amount": {
"amount": 100.00,
"currencyCode": "USD"
}
}
Response:
{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"status": "SUCCESS",
"cardDetails": {
"cardNumber": "**** **** **** 1234",
"expiryDate": "12/26",
"securityCode": "***"
},
"activationInstructions": "Card will be activated within 24 hours",
"deliveryMethod": "email",
"estimatedDelivery": "2024-01-02T12:00:00.000Z"
}
{
"recipient": {
"emailAddress": "compliance.review@example.pending",
// ... other fields
}
}
Response:
{
"status": "PENDING",
"reason": "Additional verification required",
"estimatedCompletion": "2024-01-03T12:00:00.000Z",
"nextSteps": "Awaiting manual review by compliance team"
}
{
"recipient": {
"emailAddress": "bad.address@example.failed",
// ... other fields
}
}
Response:
{
"status": "FAILED",
"reason": "Recipient address validation failed",
"errorCode": "ADDR_VALIDATION_ERROR",
"canRetry": true,
"suggestions": [
"Verify the recipient address is complete and accurate",
"Ensure the postal code matches the city and state"
]
}
The v2 Premium endpoints (GET /v2/cards/{orderId}, GET /v2/cards/{orderId}/balance, POST /v2/cards/{orderId}/transactions) also respect the same email pattern conventions. The sandbox behavior is determined by the recipient email used during order creation.
Order Created With: john.doe@example.com (or any normal email)
v2 Card Details Response:
{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"cardId": "abc-123-def-456",
"status": "ACTIVE",
"cardNumber": "**** **** **** 1234",
"balance": {
"available": 100.00,
"pending": 0,
"currency": "USD"
},
"cardholder": {
"name": "John Doe",
"email": "john.doe@example.com"
}
}
v2 Transactions Response: Returns 10 mock transactions (purchases and refunds at various merchants)
Order Created With: compliance@example.pending
v2 Card Details Response:
{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"cardId": "abc-123-def-456",
"status": "PENDING",
"cardNumber": "**** **** **** 1234",
"balance": {
"available": 0,
"pending": 100.00,
"currency": "USD"
},
"cardholder": {
"name": "John Doe",
"email": "compliance@example.pending"
}
}
v2 Transactions Response:
{
"transactions": [],
"page": 1,
"totalPages": 0,
"totalCount": 0,
"message": "Card is pending activation - no transactions yet"
}
Order Created With: rejected@example.failed
v2 Card Details Response:
{
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"cardId": "abc-123-def-456",
"status": "SUSPENDED",
"cardNumber": "**** **** **** 1234",
"balance": {
"available": 0,
"pending": 0,
"currency": "USD"
},
"cardholder": {
"name": "John Doe",
"email": "rejected@example.failed"
}
}
v2 Transactions Response:
{
"transactions": [],
"page": 1,
"totalPages": 0,
"totalCount": 0,
"message": "Card is suspended - no transactions available"
}
Complete Test Flow:
test@example.pending)Example Test Sequence:
# 1. Create order with .pending email
POST /orders/create
{
"recipient": { "emailAddress": "kyc@example.pending", ... }
}
# 2. Get card details - should show PENDING status
GET /v2/cards/{orderId}
โ Returns status: "PENDING", balance.available: 0, balance.pending: 100
# 3. Get balance - should show pending balance
GET /v2/cards/{orderId}/balance
โ Returns balance: 0, pending: 100
# 4. Get transactions - should be empty
POST /v2/cards/{orderId}/transactions
โ Returns empty array with message about pending activation
Happy Path Testing
Email: success.test@company.com
Expected: SUCCESS status with card details
Compliance Workflow Testing
Email: kyc.review@company.pending
Expected: PENDING status with review information
Error Handling Testing
Email: invalid.data@company.failed
Expected: FAILED status with error details
Balance Validation Testing
Order amount > Available balance
Expected: 400 Bad Request with insufficient balance error
Authentication Testing
Invalid/missing HMAC headers
Expected: 401 Unauthorized
Use different email patterns to test all workflows:
const testCases = [
{ email: "success@example.com", expectedStatus: "SUCCESS" },
{ email: "pending@example.pending", expectedStatus: "PENDING" },
{ email: "failed@example.failed", expectedStatus: "FAILED" },
{ email: "MIXED@CASE.PENDING", expectedStatus: "PENDING" } // Case insensitive
];
When your integration moves to production:
All sandbox responses include a sandbox: true flag in the card server response data for easy identification during debugging.
The sandbox service logs all operations with the [SANDBOX] prefix for easy filtering:
[SANDBOX] Processing card order abc-123 for client TestClient
[SANDBOX] Email test@example.pending โ Status: PENDING
[SANDBOX] Order abc-123 completed with status PENDING
For additional support, contact the development team or check the main API documentation.
The sandbox implementation:
This ensures that integrations tested in sandbox will work seamlessly in production with minimal changes required.