Solgateway Documentation
  • Introduction
  • Getting Started
  • API Documentation
  • Integration Guides
  • Configuration
  • Troubleshooting
  • Best Practices
  • FAQs
  • Additional Resources
  • Changelog
Powered by GitBook
On this page

API Documentation

API Documentation

The Solgateway API provides a comprehensive set of tools for integrating cryptocurrency payments into your applications. This section covers the essential aspects of our API, including authentication, available endpoints, request/response formats, and error handling.

API Overview

Solgateway API enables you to create, manage, and track cryptocurrency transactions on the Solana network. The API is designed to be straightforward and developer-friendly, supporting various programming languages.

  • Base URL: https://api.solgateway.com/v1

  • Authentication: All API requests require an API key for authentication. Include your API key in the request headers.

Authentication

  • Header: Authorization: Bearer YOUR_API_KEY

  • API Key: Obtain your API key from the Solgateway dashboard under the "API Keys" section.

Rate Limits

To ensure fair usage, the Solgateway API enforces rate limits. Typically, you are allowed:

  • 1000 requests per minute

  • 10000 requests per day

For higher limits, contact our support team.

Endpoints

1. Transaction API

  • Create Transaction

    • Endpoint: POST /transactions

    • Description: Initiate a new payment transaction.

    • Request Body:

      jsonCopy code{
        "amount": "100.00",
        "currency": "SOL",
        "description": "Payment for Order #1234",
        "callback_url": "https://yourdomain.com/callback"
      }
    • Response:

      jsonCopy code{
        "transaction_id": "abc123",
        "status": "pending",
        "amount": "100.00",
        "currency": "SOL",
        "payment_url": "https://solgateway.com/pay/abc123"
      }
    • Errors:

      • 400 Bad Request: Invalid request parameters.

      • 401 Unauthorized: Invalid API key.

  • Retrieve Transaction Status

    • Endpoint: GET /transactions/{transaction_id}

    • Description: Retrieve the status of a specific transaction.

    • Response:

      jsonCopy code{
        "transaction_id": "abc123",
        "status": "completed",
        "amount": "100.00",
        "currency": "SOL"
      }
    • Errors:

      • 404 Not Found: Transaction ID does not exist.

2. Payment Integration API

  • Payment Requests

    • Endpoint: POST /payments/requests

    • Description: Create a new payment request.

    • Request Body:

      jsonCopy code{
        "amount": "50.00",
        "currency": "SOL",
        "requestor": "merchant@example.com",
        "description": "Payment for Invoice #5678"
      }
    • Response:

      jsonCopy code{
        "payment_request_id": "xyz789",
        "status": "pending",
        "amount": "50.00",
        "currency": "SOL"
      }
    • Errors:

      • 400 Bad Request: Invalid request parameters.

  • Refund Requests

    • Endpoint: POST /payments/refunds

    • Description: Request a refund for a payment.

    • Request Body:

      jsonCopy code{
        "payment_request_id": "xyz789",
        "amount": "50.00",
        "reason": "Customer requested refund"
      }
    • Response:

      jsonCopy code{
        "refund_id": "refund123",
        "status": "processed",
        "amount": "50.00",
        "currency": "SOL"
      }
    • Errors:

      • 400 Bad Request: Invalid refund request.

3. Webhooks

  • Setting Up Webhooks

    • Endpoint: POST /webhooks

    • Description: Register a new webhook URL to receive event notifications.

    • Request Body:

      jsonCopy code{
        "url": "https://yourdomain.com/webhook",
        "events": ["transaction_completed", "payment_received"]
      }
    • Response:

      jsonCopy code{
        "webhook_id": "webhook123",
        "status": "active"
      }
    • Errors:

      • 400 Bad Request: Invalid webhook URL or event type.

  • Handling Webhook Events

    • Webhooks are used to notify your application of events such as completed transactions or received payments. Ensure your webhook endpoint can handle incoming POST requests with event data.

API Reference

  • Request/Response Format: All API requests and responses use JSON format.

  • Error Codes and Messages: Refer to the above endpoints for common error codes and their meanings. For additional errors, consult the error documentation.

Conclusion

The Solgateway API provides a powerful and flexible way to manage cryptocurrency payments. For detailed usage examples and further assistance, please refer to the specific API endpoint documentation or contact our support team.

PreviousGetting StartedNextIntegration Guides

Last updated 8 months ago