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).

ServiceURL
Production APIhttps://api.harpfi.com/v1
Sandbox APIhttps://sandbox.api.harpfi.com/v1
Dashboardhttps://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:

JSON
{
    "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 page
  • totalCount: Total number of items available across all pages
  • nextPage: Cursor token to fetch the next page (use as page parameter)
  • previousPage: Cursor token to fetch the previous page (use as page parameter)

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

AttributesWhat it tells you
successBoolean false when there's an error
messageHuman-readable error description
codeError grouping by type for debugging
dataAn object or array with additional details about what went wrong
JSON
{
    "success": false,
    "code": "invalid_request",
    "message": "Invalid request data",
    "data": [
        {
            "code": "required",
            "fieldName": "address",
            "message": "This field is required"
        }
    ]
}
HTTP Status Code
200OK - Everything worked perfectly
201Created - New resource was created successfully
400Bad Request - Missing or invalid data in your request
401Unauthorized - Your API key is missing or invalid
404Not Found - The endpoint or resource doesn't exist
409Conflict - The resource already exists or conflicts with current state
429Too Many Requests - You're hitting our rate limits - slow down
500Server Error - An internal issue occurred
Error Code
invalid_requestYou're missing a required field or it's the wrong format
unsupported_actionYour don't have access to a product/functionality
too_many_requestsYou're making requests too fast - slow down
internal_errorWe messed up - let us know if this keeps happening