Overview
This quickstart guide will walk you through:- Installing the InventPay SDK
- Getting your API credentials
- Creating your first payment
- Checking payment status
Prerequisites
Before you begin, make sure you have:- An InventPay account (sign up at inventpay.io)
- Node.js 14+ (for JavaScript/TypeScript) or Python 3.7+ (for Python)
- Your API key from the InventPay Dashboard
Step 1: Install the SDK
Choose your preferred language and install the InventPay SDK:Step 2: Get Your API Key
- Log in to your InventPay Dashboard
- Navigate to Settings → API Keys
- Click Generate New API Key
- Copy your API key and store it securely
Step 3: Initialize the SDK
Set up the SDK with your API key:Step 4: Create Your First Payment
Now let’s create a payment request. You have two options:Option A: Fixed Currency Payment
Create a payment for a specific cryptocurrency (customer must pay in that currency):Option B: Multi-Currency Invoice
Create an invoice where customers can choose their preferred cryptocurrency:The
invoiceUrl is a hosted payment page where your customer can complete the
payment. You can redirect them to this URL or display it in an iframe.Step 5: Check Payment Status
You can check the status of any payment at any time:Payment Status Values
| Status | Description |
|---|---|
PENDING | Waiting for payment to be received |
COMPLETED | Payment received and confirmed |
EXPIRED | Payment window expired without receiving full payment |
FAILED | Payment failed due to an error |
Step 6: Set Up Webhooks (Recommended)
Instead of polling for payment status, configure webhooks to receive real-time notifications:Learn more about handling webhooks in the Webhooks
Guide.
Next Steps
Congratulations! You’ve successfully created your first crypto payment with InventPay. Here’s what to explore next:Handle Webhooks
Set up real-time notifications for payment events
Manage Balances
Check your balances and transaction history
Process Withdrawals
Withdraw funds to external wallets
API Reference
Explore all available endpoints and methods
Supported Cryptocurrencies
InventPay supports the following cryptocurrencies:| Currency | Network | Code | Description |
|---|---|---|---|
| Bitcoin | Bitcoin | BTC | Native Bitcoin network |
| Ethereum | Ethereum | ETH | Native Ethereum network |
| Litecoin | Litecoin | LTC | Native Litecoin network |
| Tether | Ethereum (ERC-20) | USDT_ERC20 | USDT on Ethereum |
| Tether | BSC (BEP-20) | USDT_BEP20 | USDT on Binance Smart Chain |
Complete Example
Here’s a complete example showing payment creation and status checking:Troubleshooting
Authentication Errors
If you get a 401 Unauthorized error:- Verify your API key is correct
- Ensure the API key is properly set in environment variables
- Check that the API key hasn’t been revoked in the dashboard
Payment Not Found
If you get a 404 error when checking payment status:- Verify the payment ID is correct
- Ensure the payment was created successfully
- Check that you’re using the correct environment (test/production)
Timeout Errors
If requests are timing out:- Check your internet connection
- Verify the InventPay API status
- Try increasing the timeout value in SDK configuration
