Key Concepts
Learn the essential components for integrating with the HarpFi APIs, including authentication, environment setup, onboarding, balances, and webhooks.
Service URLs
Every request uses one of the two following URLs, depending on whether you're working in your live environment (production) or your test environment (sandbox).
| Service | URL |
|---|---|
| Production API | https://api.harpfi.com/v1 |
| Sandbox API | https://sandbox.api.harpfi.com/v1 |
| Dashboard | https://dashboard.harpfi.com |
Request ID
Every API response includes a unique request ID in the response headers. This request ID is essential for debugging purposes and should be included when contacting support about specific API requests.
The request ID is returned in the x-request-id header of all API responses. When you encounter an issue or need assistance, providing this request ID helps our support team quickly locate and investigate the specific request in our systems.
Example Response Header:
x-request-id: req-1234567890abcdef
Note: Always capture and store the request ID from response headers when making API calls. This will significantly speed up troubleshooting if you need to contact support.
Pagination
HarpFi API uses cursor-based pagination for efficient data retrieval. This approach provides consistent results even when data changes between requests.
Pagination Structure
All paginated endpoints return data in this format:
{
"success": true,
"message": "Payments retrieved successfully",
"data": {
"records": [...],
"paging": {
"totalCount": 10,
"nextPage": "string",
"previousPage": "string"
}
}
}
How It Works
records: Array of items for the current pagetotalCount: Total number of items available across all pagesnextPage: Cursor token to fetch the next page (use aspageparameter)previousPage: Cursor token to fetch the previous page (use aspageparameter)
Making Requests
To navigate pages, include the cursor token and limit in your request:
- Next page:
GET /endpoint?page=nextPage&limit=50 - Previous page:
GET /endpoint?page=previousPage&limit=50 - First page:
GET /endpoint?limit=50(no page parameter)
Parameters
page: Cursor token for pagination (optional)limit: Number of items per page (optional, min: 1, max: 100)
Errors
Our API uses standard HTTP status codes to tell you if your request succeeded or failed. Here's the simple breakdown:
- 2xx codes = Success ✅
- 4xx codes = Something's wrong with your request (missing data, invalid format, etc.)
- 5xx codes = Something's wrong on our end (we'll fix it)
When something goes wrong, you'll get a response with these fields:
RESPONSE BODY ATTRIBUTES
| Attributes | What it tells you |
|---|---|
success | Boolean false when there's an error |
message | Human-readable error description |
code | Error grouping by type for debugging |
data | An object or array with additional details about what went wrong |
{
"success": false,
"code": "invalid_request",
"message": "Invalid request data",
"data": [
{
"code": "required",
"fieldName": "address",
"message": "This field is required"
}
]
}
| HTTP Status Code | |
|---|---|
| 200 | OK - Everything worked perfectly |
| 201 | Created - New resource was created successfully |
| 400 | Bad Request - Missing or invalid data in your request |
| 401 | Unauthorized - Your API key is missing or invalid |
| 404 | Not Found - The endpoint or resource doesn't exist |
| 409 | Conflict - The resource already exists or conflicts with current state |
| 429 | Too Many Requests - You're hitting our rate limits - slow down |
| 500 | Server Error - An internal issue occurred |
| Error Code | |
|---|---|
| invalid_request | You're missing a required field or it's the wrong format |
| unsupported_action | Your don't have access to a product/functionality |
| too_many_requests | You're making requests too fast - slow down |
| internal_error | We messed up - let us know if this keeps happening |