Payment APIs Documentation

Comprehensive API documentation for integrating payment processing into your applications.

Overview

The FinvyPay Payment API provides a unified interface for processing payments across multiple payment methods, including card payments, alternative payment methods (APM), crypto payments, payouts, and payment links.

API Documentation Overview

Secure & Compliant

Bank-level encryption and PCI-DSS compliant infrastructure to protect your transactions.

Fast Processing

Real-time transaction processing with optimized infrastructure for instant responses.

Global Support

Multi-currency support and international payment methods for global reach.

API Key Authentication

Secure API key-based authentication for all payment endpoints.

Base URL & Environments

All API requests should be made to the following base URL:

Base URL

https://api.finvypay.com

The difference between production and sandbox environments is in the API path:

Production Endpoints

https://api.finvypay.com/api/v1/production/...

Sandbox Endpoints (Testing)

https://api.finvypay.com/api/v1/sandbox/...
Use the sandbox environment for testing and development. All sandbox transactions are simulated and do not process real payments.

Authentication

All payment API endpoints require authentication using an API key. Include your API key in the Authorization header:

Authorization Header

Authorization: Bearer your_api_key_or_sandbox_api_key
Important: Keep your API keys secure. Never expose them in client-side code or commit them to version control. Use environment variables or secure key management systems.

You can obtain your API keys from your merchant dashboard after completing the onboarding process.

API Versioning

The Payment API uses versioning in the URL path. The current version is v1.

/api/v1/production/card
/api/v1/sandbox/card
When we release breaking changes, we will increment the version number. We will provide migration guides and maintain backward compatibility for a reasonable period.

Request & Response Format

Content-Type

All requests must include the Content-Type: application/json header.

Request Body

Request bodies should be JSON-encoded objects.

Response Format

All responses are JSON objects. Successful responses return a 200 OK status code.

Success Response Example

{
  "success": true,
  "data": {
    "transactionId": "TXN-20240101-ABC123",
    "status": "SUCCESS",
    "amount": 100.50,
    "currency": "USD"
  }
}

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

200 OKRequest succeeded
400 Bad RequestInvalid request parameters
401 UnauthorizedInvalid or missing API key
403 ForbiddenAPI key lacks required permissions
404 Not FoundResource not found
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error

Error Response Format

{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The request parameters are invalid",
    "details": {
      "field": "amount",
      "reason": "Amount must be greater than 0"
    }
  }
}

Rate Limits

To ensure fair usage and system stability, API requests are rate-limited:

Standard Tier100 requests per minute per API key
Premium Tier500 requests per minute per API key
Enterprise TierCustom rate limits based on agreement

Rate limit information is included in response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200
If you exceed the rate limit, you will receive a 429 Too Many Requests response. Wait until the reset time before making additional requests.

Idempotency

For payment endpoints, you can include an idempotencyKey in the request header to ensure that duplicate requests are not processed multiple times:

Idempotency Header

Idempotency-Key: unique-key-per-request

If you make the same request (with the same idempotency key) multiple times, only the first request will be processed. Subsequent requests will return the same response as the first request.

Idempotency keys should be unique per transaction. Use a UUID or a unique identifier from your system.

Webhooks

Webhooks allow you to receive real-time notifications about transaction status changes. Configure your webhook URL when creating a payment, and we will send POST requests to your endpoint when events occur.

SUCCESSTransaction successfully processed
FAILEDTransaction failed
BLOCKEDTransaction blocked due to security/compliance

Webhook requests include a signature header for verification:

fs-webhook-hash: HMAC-SHA256 signature
Always verify webhook signatures to ensure requests are from FinvyPay. The signature is generated using HMAC-SHA256 with your secret key.

Payment Statuses

Transactions can have the following statuses:

SUCCESSPayment has been successfully processed
FAILEDPayment failed due to an error or insufficient funds
PENDINGPayment is pending and awaiting further action
INITPayment process has been initialized but not yet completed
REDIRECTUser has been redirected to a third-party page for payment completion
BLOCKEDPayment blocked due to security or compliance reasons
ABANDONEDPayment process was started but not completed by the user

Quick Start

Ready to get started? Here's a quick example of processing a card payment:

Example: Process Card Payment

curl -X POST https://api.finvypay.com/api/v1/sandbox/card \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key_or_sandbox_api_key" \
  -d '{
    "orderId": "ORD-12345",
    "amount": 100.50,
    "currency": "USD",
    "cardNumber": "4111111111111111",
    "cardExpiryMonth": 12,
    "cardExpiryYear": 2025,
    "cvv": "123",
    "cardholderName": "John Doe",
    "email": "john@example.com"
  }'

API Categories