SpacePay API Reference
Welcome to the SpacePay API documentation. This reference provides comprehensive information about our REST API endpoints, authentication methods, and integration examples.Getting Started
1
Get Your API Keys
Generate your API keys in the admin dashboard under Settings → Developers → API Keys.
API Keys: Available in both testnet and mainnet environments. Test keys start with
pk_test_ and sk_test_.2
Choose Your Environment
Select the appropriate base URL for your integration: - Testnet:
https://api-testnet.spacepay.co.uk (for development) - Mainnet:
https://api.spacepay.co.uk (for production)3
Start Integrating
Use our SDK or integrate directly with our REST API endpoints.
Authentication
All API requests require authentication using your secret key with theX-SpacePay-Secret-Key header:
Learn More
Detailed authentication examples and API integration guide
Base URLs
SpacePay provides different base URLs for different environments:Testnet Environment
Base URL:
https://api-testnet.spacepay.co.ukNetworks: Base Sepolia, Ethereum SepoliaUse for: Development and testingMainnet Environment
Base URL:
https://api.spacepay.co.ukNetworks: Base, Ethereum, Polygon, BSC, AvalancheUse for: Production with real tokensLearn More
Detailed test environments, scenarios, and token addresses
Payment Statuses
SpacePay payments progress through the following statuses:PENDING
Payment has been created and is waiting for customer payment.
PROCESSING
Payment is being processed and waiting for blockchain confirmations.
COMPLETED
Payment has been confirmed and is complete.
FAILED
Payment failed due to network issues or insufficient funds.
EXPIRED
Payment expired before completion.
CANCELLED
Payment was cancelled by the merchant.
Learn More
Detailed payment processing flow and status explanations
Webhook Events
SpacePay sends webhooks for the following events:payment.created: Payment has been created and is ready for customer paymentpayment.updated: Payment status has been updated (confirmed, failed, expired, etc.)
Webhook Secret: Each webhook endpoint gets its own unique secret key for
signature verification. Set up webhooks in your admin dashboard under Settings
→ Developers → Webhooks.
Learn More
Complete webhook setup, payload structure, and signature verification
Error Handling
SpacePay uses standard HTTP status codes and provides detailed error information:Learn More
Detailed error handling examples and troubleshooting guide
Integration Resources
SDK Integration
Use our official SDK for easier integration with built-in functionality.
API Integration
Integrate directly with SpacePay’s REST APIs for full control.
Webhooks
Set up real-time payment notifications with secure signature verification.
Testing
Learn about test environments and scenarios for development.