Solana API Reference
This document provides a comprehensive reference for WhiskyPay’s Solana payment integration.SDK Components
createSession
Creates a new payment session.Parameters
Returns
A session ID string that you’ll use with the PaymentModal.Example
PaymentModal
React component for displaying the payment UI.Props
ThemeOptions
Example
getSessionDetails
Retrieves details about a payment session.Parameters
Returns: SessionDetails
Example
checkPaymentStatus
Checks the status of a payment.Parameters
Returns: PaymentStatusResponse
PaymentStatus Enum
Example
verifyPayment
Verifies a payment on-chain.Parameters
Returns: VerificationResult
Example
REST API Endpoints
These endpoints are available for server-side operations.POST /api/v1/sessions
Creates a new payment session.Request Body
Headers
Response
GET /api/v1/sessions/:sessionId
Retrieves details about a payment session.Parameters
Headers
Response
GET /api/v1/payments/:sessionId/status
Checks the status of a payment.Parameters
Headers
Response
POST /api/v1/payments/verify
Verifies a payment on-chain.Request Body
Headers
Response
Webhook Events
WhiskyPay sends webhook notifications for payment status changes.Payment Completed
Payment Failed
Signature Verification
Verify webhook signatures to ensure authenticity:Error Handling
WhiskyPay API uses standard HTTP status codes and error responses.Error Response Format
Common Error Codes
Token Support
WhiskyPay supports the following Solana tokens:Best Practices
Security
- Use HTTPS: Always use secure connections
- Validate Signatures: Verify webhook signatures
- Store API Keys Securely: Use environment variables
- Verify Transactions: Always verify payments on-chain
Performance
- Connection Pooling: Reuse HTTP connections
- Caching: Cache token prices and session data
- Background Processing: Handle webhooks asynchronously
Error Handling
- Retry Logic: Implement exponential backoff for failed API calls
- Monitoring: Set up alerts for failed payments
- Logging: Log all API interactions for debugging
Rate Limits
The WhiskyPay API has the following rate limits:- Session Creation: 60 requests per minute
- Session Status: 120 requests per minute
- Payment Verification: 60 requests per minute
Support and Troubleshooting
For issues with the API, contact support at support@whiskypeak.com with:- Your merchant ID
- The session ID(s) in question
- Error messages received
- Steps to reproduce the issue
- “Invalid API Key”: Verify your API key in dashboard settings
- “Session Not Found”: Check if the session has expired
- “Payment Failed”: Verify the user has sufficient balance