Staging Environment
Test your integration safely with our staging environment
Staging Environment
The Loyalty.lt API provides a dedicated staging environment for testing your integrations before going live with production data.
Staging vs Production
| Feature | Staging | Production |
|---|---|---|
| Base URL | https://staging-api.loyalty.lt | https://api.loyalty.lt |
| Data | Demo/test data | Real customer data |
| API Credentials | Staging credentials only | Production credentials only |
| Weekly reset | Yes (Sundays) | No |
Getting Staging API Credentials
- Log in to the Partners Portal
- Navigate to API Credentials in the sidebar menu
- Click Create New Credential
- Select Environment: Staging
- Save your API Key and Secret (shown only once!)
Staging credentials only work with the staging API (staging-api.loyalty.lt).
Production credentials only work with the production API (api.loyalty.lt).
Demo Test Data
The staging environment includes pre-configured demo data for testing:
Demo Loyalty Cards
Card numbers use the format XXX-XXX-XXX. Demo cards start with 900-:
| Card Number | Phone | Points | |
|---|---|---|---|
900-001-001 | +37060000001 | demo1@loyalty.lt | 1000 |
900-002-001 | +37060000002 | demo2@loyalty.lt | 2500 |
900-003-001 | +37060000003 | demo3@loyalty.lt | 500 |
900-004-001 | +37060000004 | demo4@loyalty.lt | 10000 |
900-005-001 | +37060000005 | demo5@loyalty.lt | 150 |
Card number format: 900-{user_id}-{partner_id} where IDs are zero-padded to 3 digits.
Demo Staff Accounts
Staff members log in to the Staff App using their Barcode (numbers only):
| Barcode | Name | Role |
|---|---|---|
100000001 | Demo Manager | Manager |
100000002 | Demo Cashier | Cashier |
Barcode format: {partner_id}{user_id} where user_id is zero-padded to 8 digits.
Example: For partner ID 5 and user ID 123, barcode would be 500000123.
Staff accounts are created for each partner synced from production.
SDK Configuration
JavaScript SDK
const sdk = new LoyaltySDK({
apiKey: 'your_staging_api_key',
apiSecret: 'your_staging_api_secret',
environment: 'staging', // Uses staging-api.loyalty.lt
locale: 'lt'
});PHP SDK
use LoyaltyLt\SDK\LoyaltySDK;
$sdk = new LoyaltySDK([
'apiKey' => 'your_staging_api_key',
'apiSecret' => 'your_staging_api_secret',
'environment' => 'staging',
]);Python SDK
from loyalty_sdk import LoyaltySDK
sdk = LoyaltySDK(
api_key='your_staging_api_key',
api_secret='your_staging_api_secret',
environment='staging'
)Weekly Data Reset
Note
The staging environment is reset every Sunday at 05:00 EET. All test transactions and temporary data are cleared. Demo cards and partner catalog data are preserved.
What Gets Reset
- Customer transactions
- Point awards/redemptions
- Game progress and sessions
- Coupon redemptions
- Activity logs
What Gets Preserved
- Partner settings and catalog (products, games, offers)
- Demo loyalty cards
- Demo staff accounts
- API credentials
Testing Recommendations
1. Test the Full Flow
// 1. Validate credentials
await sdk.validateCredentials();
// 2. Look up a card by number
const { data: card } = await sdk.getLoyaltyCardInfo({ card_number: '900-001-001' });
// 3. Create transaction (awards points automatically)
await sdk.createTransaction({
card_id: card.id,
amount: 25.50,
type: 'earn',
description: 'Test purchase'
});
// 4. Check balance
const balance = await sdk.getPointsBalance(card.id);2. Test Error Handling
Use invalid card numbers to test error handling:
try {
await sdk.getLoyaltyCardInfo({ card_number: 'invalid-card' });
} catch (error) {
console.log('Code:', error.code);
console.log('Message:', error.message);
}3. Test Games & Coupons
// List available games
const games = await sdk.listShopGames();
// Get customer's games
const cardGames = await sdk.getCardGames('900-001-001');
// Get customer's coupons
const coupons = await sdk.getCardCoupons('900-001-001');Troubleshooting
Common Issues
Support
If you encounter issues with the staging environment:
- Email: developers@loyalty.lt
- Include your partner ID and error details