Welcome to the InventPay API
The InventPay API allows you to integrate cryptocurrency payment processing into your applications. Our RESTful API is designed to be simple, predictable, and easy to integrate.RESTful Design
Standard HTTP methods and status codes
JSON Format
All requests and responses use JSON
Comprehensive SDKs
Official libraries for JavaScript and Python
Real-time Webhooks
Instant notifications for all events
Base URL
All API requests should be made to:Authentication
The InventPay API uses API keys for authentication. Include your API key in theX-API-Key header of every request.
Get Your API Key
- Sign up at inventpay.io
- Navigate to Dashboard → Settings → API Keys
- Click “Generate New API Key”
- Copy and securely store your API key
Example Authentication
Request Format
HTTP Methods
The API uses standard HTTP methods:| Method | Usage |
|---|---|
GET | Retrieve resources |
POST | Create new resources |
PUT | Update existing resources |
DELETE | Remove resources |
Content Type
All requests with a body must include theContent-Type: application/json header.
Example Request
Response Format
All API responses are returned in JSON format with a consistent structure.Successful Response
Error Response
HTTP Status Codes
The API uses standard HTTP status codes:| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
Error Handling
Error Response Structure
Common Errors
401 Unauthorized
401 Unauthorized
400 Bad Request
400 Bad Request
Cause: Invalid request parametersSolution: Check the
details field for specific validation errors429 Rate Limit Exceeded
429 Rate Limit Exceeded
Cause: Too many requests in a short timeSolution: Implement exponential backoff and respect rate limits
404 Not Found
404 Not Found
Cause: Resource doesn’t existSolution: Verify the resource ID is correct
Rate Limits
To ensure fair usage and system stability, the API implements rate limiting:| Endpoint Type | Limit | Window |
|---|---|---|
| Payment Creation | 100 requests | Per minute |
| Status Checks | 300 requests | Per minute |
| Withdrawals | 10 requests | Per minute |
| Other Endpoints | 60 requests | Per minute |
Rate Limit Headers
All responses include rate limit information:Handling Rate Limits
Pagination
Endpoints that return lists support pagination using query parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 10 | Items per page (max 100) |
Example
Response
Idempotency
To safely retry requests without performing the same operation twice, use idempotency keys:Idempotency keys are stored for 24 hours. Use a unique key for each unique
request.
Versioning
The API version is included in the URL path:SDKs and Libraries
JavaScript/TypeScript
Official Node.js and browser SDK with full TypeScript support
Python
Official Python SDK with type hints and async support
Webhooks
For real-time event notifications, configure webhooks:1
Configure Webhook URL
Set your endpoint in the dashboard or via API
2
Verify Signatures
Always verify webhook signatures for security
3
Handle Events
Process payment and withdrawal events
4
Return 200 OK
Respond quickly to acknowledge receipt
Webhook Documentation
Learn how to set up and secure webhooks
Testing
Test Mode
Use separate test API keys for development and testing:- Test payments don’t process real cryptocurrency
- Test all integration flows safely
- Generate test API keys in dashboard
Test Data
Use these test values for development:| Field | Test Value |
|---|---|
| Amount | Any positive number |
| Currency | All supported currencies |
| Order ID | Any string |
Best Practices
Secure Your API Keys
Secure Your API Keys
- Store keys in environment variables
- Never commit keys to version control
- Rotate keys periodically
- Use separate keys for different environments
Handle Errors Gracefully
Handle Errors Gracefully
- Always check response status codes - Parse error messages for details - Implement retry logic with exponential backoff - Log errors for debugging
Use Webhooks
Use Webhooks
- Don’t poll for status changes - Implement webhook signature verification - Handle duplicate deliveries - Return 200 OK quickly
Implement Idempotency
Implement Idempotency
- Use idempotency keys for critical operations - Store request IDs to prevent duplicates - Handle retries safely
Monitor Your Integration
Monitor Your Integration
- Track API response times
- Monitor error rates
- Set up alerts for failures
- Review webhook delivery success rates
API Endpoints
Payments
Create Payment
Create a fixed-currency payment request
Create Invoice
Create a multi-currency invoice
Get Payment Status
Check payment status and confirmations
Balances
Get Balances
Retrieve all cryptocurrency balances
Get Balance by Currency
Get specific currency balance
Withdrawals
Support
Documentation
Browse complete documentation
Email Support
Contact our support team
API Status
Check current API status
GitHub Issues
Report bugs or request features
Next Steps
1
Get Your API Key
Sign up and generate your API key
2
Try the Quickstart
Create your first payment in 5 minutes
3
Install an SDK
Choose JavaScript or Python SDK
4
Set Up Webhooks
Configure real-time notifications
5
Go Live
Switch to production API keys
Quickstart Guide
Get started in under 5 minutes
