Introduction
Welcome to the FinitePay crypto API! This guide will help you get started with integrating our payment system, allowing your application to accept cryptocurrency as payment seamlessly.
Overview
FinitePay's Payments API allows developers to build secure, efficient, and reliable payment integrations for receiving crypto payments. Whether you're setting up for the first time or testing in a sandbox environment, this guide will walk you through key endpoints, API keys, and integration steps to accept payments using FinitePay APIs.
Environments
Environment | Base URL |
---|---|
Sandbox (Testing) | https://business-sandbox.finitepay.org/api/v1 |
Production (Live) | https://business.finitepay.org/api/v1 |
Get your FinitePay for businesses API keys
Your API requests are authenticated using API Keys generated by you in your FinitePay for Businesses Dashboard. To begin using the API, you'll need to generate your API keys from the FinitePay Dashboard. These keys are essential for authenticating your requests.
Generating your API Keys
- Log into your FinitePay for businesses Dashboard: Visit the FinitePay business website and log in with your credentials.
- Navigate to Settings: Once logged in, find the Settings option in the sidebar.
- Select API Keys: Under Settings, select API Keys. Here, you'll find options to generate and manage your API keys.
- Generate API Keys: You can create keys for Sandbox or Production depending on which environment you are currently logged in to. Make sure to keep these keys secure as they authenticate your application's requests.
The API keys are unique to each environment (Sandbox or Production), so you'll need to ensure you're using the correct key based on where you're testing or deploying.
API Endpoints
FinitePay for businesses provides distinct endpoints for Sandbox (testing) and Production (live transactions). The endpoints are structured similarly but serve different environments.
1. Sandbox Environment (Testing)
Sandbox allows you to test your integration without processing real payments.
2. Production Environment (Live)
The production environment processes real payments and requires live API keys.
Each endpoint requires your API key for authentication, which you'll include in the request headers.
Create Payments
This section provides everything you need to start accepting cryptocurrency payments online seamlessly. With our E-Commerce Payments API, you can integrate crypto payment functionality directly into your web-app.
In this section, we'll guide you through:
- Setting up a new payment transaction
- Customising payment details such as amount, currency, and callback URLs
- Monitoring and updating the status of payments in real time
Whether you're building a single-page checkout or integrating crypto payments into an existing cart, FinitePay offers the flexibility and security needed for a reliable eCommerce solution.
Create an Ecommerce Payment
Name | Type | Description |
---|---|---|
asset* |
String | The asset you would like to settle in your account |
requested_asset |
String | The asset you would like your customer to pay in |
amount* |
String | Amount you would like to receive in the settlement asset |
cart_items* |
Object | Contains item_name , item_desc , item_quantity , unit_price (e.g., DVD1,Movie Name,1,80 ) |
email* |
String | Email of customer who will be doing the payment |
description* |
String | Description of the payment |
reference* |
String | Your payment reference |
postback_url |
String | After postback please return a response JSON { "status": "ok" } . We will try 10 attempts until response received. |
redirect_url |
String | URL user will be redirected to after completed or canceled payment |
exp |
String | Hours until payment expires (1 = 1 hour) |
apiKey* |
String | Merchant's Terminal API ID |
apiSecret |
String | Merchant's Terminal API Secret |
Example JSON Body
{ "asset": "USD", "amount": "3", "email": "your_email@example.com", "description": "some description", "reference": "some-ref", "auto_settle": "true", "apiKey": "Your API Key", "apiSecret": "Your API Secret", "cart_items": [ "E-book,Crypto Trading,1,3" ] }
400 - Payment Creation Failed with reason
{ "status": "nok", "message": "Operation Failed!", "error": "Asset is required, Amount is required", "validated": false }
201: Created Payment Successfully Created
{ "status": "ok", "paymentId": "X8sjfaja8", "paymentShortId": "", "mobile_check_url": "", "payment_url": "/en/payment/detail/X8sjfaja8", "payment_address": "", "message": "Payment successfully created!" }
The API Endpoint can be used in multiple ways to deliver the payment page which is covered in the examples below.
Examples
Create a Payment & Custom Deliver
This is used when you would like to handle how the payment is delivered to your user.
The default response (show_payment_html=false
or null) returns a JSON response with URLs that you can present to your customer any way you wish. QR code, SMS, email, or a payment button are common examples. If your account supports mobile payments you can present the mobile_check_url
which will attempt to launch any installed mobile app for payment, otherwise, it will default the user to the payment page.
Create a Payment & Redirect User
To simplify your integration you can post to the endpoint from a form and with show_payment_html=true
we will generate the payment and display the payment page on the fly.
Payment Management
Get Payment
The Get Payment Details endpoint allows merchants to request and review comprehensive information about a specific payment.
This endpoint returns the current status, transaction history, and key details associated with the payment, enabling merchants to track and verify payment progression accurately. Use this endpoint to monitor the state of each transaction, confirm payment amounts, and access metadata for customer support or reconciliation purposes. This ensures you stay updated on payment statuses without relying on notifications or redirects alone.
Request Body
Name | Type | Description |
---|---|---|
payment_code* |
String | Payment code supplied |
apiKey* |
String | Merchant's API Key |
apiSecret* |
String | Merchant's API Secret |
400: OK Get Payment Failed
{ "status": "nok", "message": "Get Payment Detail Failed!", "error": "Payment Code is required", "validated": false }
200: OK Get Payment Success
{ "status": "ok", "payment": { "status": "success", "details": { ... } } }