Use reporting endpoints
Learn how to use the query, statistics, and export Payabli API endpoints for tailored reporting
Although the PartnerHub and PayHub reporting tools allow partners and merchants to view reports, the reporting APIs offer more flexibility. For example,you may need to send daily settlement reporting details to their customers via an internal tool. Use the Payabli reporting APIs to get the data you need in the format you need it in.
The query API allows you to retrieve records related to various objects in Payabli, like customers, vendors, batches, transactions, and more.
The statistics API allows you to retrieve aggregated statistics for a certain period and mode, like total money out transactions, total money in transactions, number of new customers, total volume, and more.
The export API allows you to export a filtered list of records in CSV or XLSX file format. You can export things like lists of customers, vendors, boarding applications, payouts, and more.
This guide explains how to use the query, stats, and export endpoints.
Build the request
First, choose an endpoint. If you’re testing, use the Sandbox endpoint. for your target environment. Make sure you use the right token for your selected environment. The API reference organizes query, export, and statistic endpoints with their related object. For example, you can find all the reporting endpoints related to customers in the Customers section of the API reference.
Parameters
For a full list of available parameters, see the reference for the endpoint you choose. Most require at least an orgId
or entry
. Each endpoint may have other required fields. You can also use filters and conditions for most endpoints, so see Filters and Conditions Reference for examples and help understanding them.
#3# Example request
Because there are infinite ways to build a request for one of the reporting endpoints, here are several example requests. Be sure to read the code comments for important context.
Example response
A successful request returns a 200 response with a JSON body. Response bodies vary by endpoint, so check the reference for the endpoint you’re using for expected fields.
Filters and conditions reference
Each Query and Export endpoint accepts a set of field identifiers and conditions that allow you to filter and select data in the API.
Field identifiers and conditions are passed to the entrypoint path via parameters in the URL. The conditions are applied to the field in parentheses. The pattern is fieldName(condition)=value
For example: https://api.payabli.com/api/Query/transactions/entry?totalAmount(ge)=50
Here totalAmount is the field identifier to which you want to apply the comparison or condition. The condition is (ge), which in this case is greater or equal than. The value base for the condition is 50, so the expression above is filtering records with the value in field totalAmount>=50.
Below you can see all the conventions for comparison you can use in the fields:
All the fields and conditions passed to the API entrypoint are inclusive, meaning that all conditions need to be satisfied to get the result set.
Date formats
All dates must be in ISO 8601 format, for example YYYY-MM-DDTHH:mm:ss
.
Examples
The filters are appended as query parameters when making an API request. These examples are URL-encoded, the unencoded filter is included with the definition.
/api/Query/customers/entry?customerZip%28eq%29%3D37615%26customerFirstname%28ct%29%3DMary
Unencoded filter: customerZip(eq)=37615&customerFirstname(ct)=Mary
.
This query returns the first 20 transactions with a customer ZIP code of 37615 and a customer first name that contains “Mary”.
/api/Query/subscriptions/entry?frequency%28eg%29%3Dmonthly&limitRecord=20
Unencoded filter: frequency(eg)=monthly
.
This query returns the first 20 subscriptions with a monthly frequency.
/api/Query/vendors/org/orgID?ein%3Dnull&limitRecord=100
Unencoded filter: ein(eq)=null
.
This query returns the first 100 records with an empty EIN.