Skip to main content

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

  1. Use HTTPS: Always use secure connections
  2. Validate Signatures: Verify webhook signatures
  3. Store API Keys Securely: Use environment variables
  4. Verify Transactions: Always verify payments on-chain

Performance

  1. Connection Pooling: Reuse HTTP connections
  2. Caching: Cache token prices and session data
  3. Background Processing: Handle webhooks asynchronously

Error Handling

  1. Retry Logic: Implement exponential backoff for failed API calls
  2. Monitoring: Set up alerts for failed payments
  3. 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:
  1. Your merchant ID
  2. The session ID(s) in question
  3. Error messages received
  4. Steps to reproduce the issue
Common solutions to frequent problems:
  • “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