S Spwig Marketplace
XE Currency Data API
Exchange Rate Provider

XE Currency Data API

by Spwig ✓ Verified · v1.1.0
0 installs
Free

Install directly from your Spwig admin → Don't have Spwig yet?

Screenshots

About this component

Premium exchange rate data from XE.com - trusted globally for 30+ years. Access 220+ currencies from 100+ authoritative sources with unparalleled data quality and brand recognition.

Versions

v1.1.0
2026-08-01

- SECURITY: refuse to serve XE trial-mode MOCK rates as real pricing data — get_rates()/get_rate() now fail closed unless config 'allow_mock_rates' is set (previously fabricated trial rates could reach storefront pricing with only a log warning).
- SECURITY/correctness: exchange-rate values are parsed with parse_float=Decimal so the provider's exact decimal value is preserved instead of going through a lossy float.
- Fixed: currency codes are validated and normalised (ISO-4217, upper-case) before lookup/use — a lower-case code previously failed a rate lookup even when the rate existed.

v1.0.1
2025-10-25

# Changelog

All notable changes to the XE Currency Data API provider will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2025-10-25

### Fixed

- **Provider inheritance**: XEProvider now properly inherits from `ExchangeRateProviderBase`
- **Abstract methods**: Implemented `credential_schema` as `@property` (required abstract method)
- **Abstract methods**: Changed `capabilities` from method to `@property` (required abstract method)
- **Method signatures**: Updated `validate_credentials` to raise `ValueError` instead of returning dict
- **Method decorators**: Removed `@staticmethod` from `validate_credentials` and `redact_credentials`

### Changed

- **UI/UX**: All alert boxes now use theme-aware CSS classes (`messagelist .warning/.info`)
- **CSS**: Removed inline CSS styles for better dark/light theme support
- **Security**: Placeholder credentials changed to generic examples (no real test credentials in docs)

### Technical

- Provider now loads correctly in `ProviderRegistry`
- Fully compatible with `ExchangeRateProviderBase` abstract interface
- All abstract methods properly implemented

## [1.0.0] - 2025-10-25

### Added

- Initial release of XE Currency Data API provider integration
- **Dual credential authentication system** (Account ID + API Key)
- Account ID as username (not secret - shown in logs)
- API Key as password (secret - encrypted and redacted)
- HTTP Basic Authentication implementation
- **Automatic account package detection** via `/account_info` endpoint
- Detects trial, basic, premium, enterprise packages
- Free endpoint - doesn't count against quota
- In-memory caching for performance
- **Trial mode detection and warning system**
- Automatic detection when package contains "trial"
- Prominent warnings in admin UI with yellow alert styling
- Console warnings when fetching rates
- Mock rate flag in responses
- Clear activation/upgrade messaging
- Support for **220+ currencies** from 100+ authoritative sources
- **Dynamic capability detection** based on subscription package
- **Batch rate fetching** with comma-separated targets
- **Historical rate support** (package dependent)
- Encrypted credential storage using Fernet encryption
- **Comprehensive error handling**
- **Rate sanity checking and validation**
- Test connection functionality via `/account_info`
- **Credential redaction for secure logging**
- Rate limit information (package-specific)
- Complete setup wizard with trial warning banner
- Comprehensive README documentation

---

[1.0.1]: https://github.com/yourorg/shop/compare/xe-v1.0.0...xe-v1.0.1
[1.0.0]: https://github.com/yourorg/shop/releases/tag/xe-v1.0.0

v1.0.0
2025-10-25

# Changelog

All notable changes to the XE Currency Data API provider will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2025-10-25

### Added

- Initial release of XE Currency Data API provider integration
- **Dual credential authentication system** (Account ID + API Key)
- Account ID as username (not secret - shown in logs)
- API Key as password (secret - encrypted and redacted)
- HTTP Basic Authentication implementation
- **Automatic account package detection** via `/account_info` endpoint
- Detects trial, basic, premium, enterprise packages
- Free endpoint - doesn't count against quota
- In-memory caching for performance
- **Trial mode detection and warning system**
- Automatic detection when package contains "trial"
- Prominent warnings in admin UI with yellow alert styling
- Console warnings when fetching rates
- Mock rate flag in responses
- Clear activation/upgrade messaging
- Support for **220+ currencies** from 100+ authoritative sources
- Dynamic currency list fetching from `/currencies` endpoint
- ISO 4217 standard currency codes
- Automatic updates when XE adds currencies
- **Dynamic capability detection** based on subscription package
- Live rates: All packages
- Historical rates: Trial, premium, enterprise (detected automatically)
- Base currency selection: All packages
- Batch requests: All packages
- Mock rate flag: Trial packages only
- **Batch rate fetching** with comma-separated targets
- Fetch all 220+ currencies in one API call
- Efficient use of quota
- Reduced latency vs individual requests
- **Historical rate support** (package dependent)
- `/historic_rate` endpoint for past dates
- Automatic package validation before request
- Clear error if package doesn't support historical data
- Encrypted credential storage using Fernet encryption
- **Comprehensive error handling**:
- `401 Unauthorized` - Invalid credentials
- `403 Forbidden` - Quota exceeded or suspended account
- `404 Not Found` - Invalid currency code
- `429 Too Many Requests` - Rate limited
- Network timeouts (15-second timeout)
- Connection errors with helpful messages
- **Rate sanity checking and validation**
- Filters out non-positive rates (≤0)
- Filters out suspiciously high rates (>1,000,000)
- Logging for invalid rates
- Test connection functionality via `/account_info`
- Returns success with account details
- Includes mock rate warning for trial accounts
- Validates both credentials in one call
- **Credential redaction for secure logging**
- Account ID: Shown in full (not secret)
- API Key: First 3 + last 3 characters only
- Rate limit information (package-specific)
- Trial: 100 requests total (7 days)
- Paid: Package-specific (contact XE)
- Note about lack of remaining quota in API
- Complete setup wizard with:
- Prominent trial warning banner
- Step-by-step credential instructions
- Brand value messaging
- Upgrade information
- Technical details
- Helpful resource links
- Comprehensive README documentation with:
- Brand value and trust messaging
- Clear trial limitations
- Dual credential setup instructions
- API endpoint details
- Use cases and best practices
- Comparison with other providers
- Troubleshooting guide
- Full unit test coverage (planned)
- Full integration test coverage (planned)

### Technical Details

- **Provider key**: `xe`
- **Provider class**: `XEProvider`
- **Base URL**: `https://xecdapi.xe.com/v1`
- **Authentication**: HTTP Basic Auth (Account ID + API Key)
- **Timeout**: 15 seconds (higher due to multi-source aggregation)
- **Cache strategy**: Respects platform's 24-hour cache + in-memory account info cache
- **Response format**: JSON with `to` array containing `quotecurrency` and `mid` fields

### Capabilities

- Live rates: ✅ Yes (all packages)
- Historical rates: ✅ Yes (package dependent - detected automatically)
- Cryptocurrency: ❌ No
- Commodities: ❌ No
- Base currency selection: ✅ Yes (any of 220+ currencies)
- Batch requests: ✅ Yes (comma-separated targets)
- Mock rate detection: ✅ Yes (trial packages)

### Rate Limits

- **Trial**: 100 requests total (7-day period), MOCK RATES only
- **Paid packages**: Package-specific (contact XE for details)
- **Account info endpoint**: FREE - doesn't count against quota
- **No remaining quota API**: XE doesn't expose usage in responses

### Dependencies

- Python >= 3.10
- Django >= 4.2
- requests >= 2.28.0

### Files

- `manifest.json` - Provider metadata with dual credential schema
- `provider.py` - Main implementation with HTTP Basic Auth (465 lines)
- `setup_instructions.html` - Wizard with trial warning banner
- `README.md` - Comprehensive documentation emphasizing brand value
- `CHANGELOG.md` - This file
- `logo.png` - XE logo (200x200px)
- `tests/test_provider.py` - Unit tests (planned)
- `tests/test_rates.py` - Integration tests (planned)
- `tests/test_validation.py` - Validation tests (planned)

### Key Features

**Dual Credentials**:
Unlike most providers that use a single API key, XE requires both an Account ID and API Key for HTTP Basic Authentication. This integration handles both seamlessly with proper encryption and redaction.

**Trial Mode Warnings**:
XE trial accounts (7-day free trial) return MOCK RATES, not real market data. This integration prominently warns users throughout the UI to prevent accidental production use of test data.

**Package Detection**:
The provider automatically detects your XE subscription package and adjusts capabilities accordingly. Historical data, for example, is only enabled if your package supports it.

**Free Account Info**:
The `/account_info` endpoint doesn't count against your quota, so we use it liberally for package detection and credential validation without worrying about burning through your limit.

**Brand Trust**:
XE is globally recognized and trusted for 30+ years. This integration emphasizes the brand value in documentation and setup wizard to help merchants understand why they might choose XE over cheaper alternatives.

### Notes

- This is the initial public release
- Tested with XE Currency Data API v1 endpoints
- Compatible with shop platform v1.0.0+
- Logo provided in PNG format (200x200px)
- Trial credentials expire after 7 days
- Mock rates warning system prevents production misuse

### Comparison with Other Providers

**Advantages**:
- ✅ Global brand recognition and trust (30+ years)
- ✅ Highest data quality (100+ sources)
- ✅ Most currencies supported (220+)
- ✅ Historical data available (package dependent)
- ✅ Monthly average rates (unique feature)
- ✅ Mid-market rates with no hidden markup

**Disadvantages**:
- ❌ No generous free tier (trial only with mock rates)
- ❌ Must pay for real data
- ❌ Pricing not public (contact required)
- ❌ More complex auth (two credentials vs one API key)
- ❌ No quota info in API responses

### Migration Notes

If migrating from another provider:
1. Rates are fetched in the same format (Decimal)
2. Currency codes use ISO 4217 standard
3. Base currency can be any supported currency
4. **Important**: Get BOTH Account ID and API Key from XE
5. Test with trial first (expect mock rate warnings)
6. Upgrade to paid package before production use
7. No special migration steps required for data

### Security

- Dual credentials encrypted using Fernet (symmetric encryption)
- Account ID shown in logs (not secret - it's the username for Basic Auth)
- API Key redacted in logs (secret - it's the password for Basic Auth)
- All API requests use HTTPS
- Credentials validated before storage
- Invalid credentials rejected with clear error messages

### Performance

- Average response time: 300-500ms (slower due to multi-source aggregation)
- Timeout: 15 seconds (higher than other providers)
- Supports batch fetching (all 220+ rates in one request)
- Platform caches rates for 24 hours
- Account info cached in memory (doesn't count against quota)
- Efficient use of API quota

### Known Limitations

- **Trial accounts return MOCK RATES** - Not suitable for production
- **No quota remaining API** - Can't programmatically check usage
- **Pricing not public** - Must contact sales for quotes
- **7-day trial expiry** - Must upgrade or create new trial
- **No cryptocurrency support** - Fiat currencies only
- **Slower response times** - Due to multi-source aggregation

### Upgrade Path

For users on trial accounts wanting to upgrade:

1. Visit [xe.com/xecurrencydata](https://www.xe.com/xecurrencydata/)
2. Contact sales for package pricing
3. Upgrade account from trial to paid
4. Verify real rates are being received (no mock rate warnings)
5. Monitor package capabilities in provider dashboard

---

## Future Versions

### Planned for 1.1.0

- Historical rate caching optimization
- Enhanced error messages with recovery suggestions
- Webhook support for quota alerts (if XE adds API support)
- Automatic retry logic for transient failures
- Custom timeout configuration per merchant

### Under Consideration

- Monthly average rate endpoints (if package supports)
- Time-series data visualization
- Rate alert notifications for significant changes
- Multi-account support for load balancing
- Fallback to cached rates on quota exceeded

---

[1.0.0]: https://github.com/yourorg/shop/releases/tag/xe-v1.0.0

Ready to install XE Currency Data API?

Install from your Spwig admin → Marketplace tab. Don't have a Spwig install yet? The commerce platform is free and open source.

Get Spwig → Browse more