Developers

Search for documents

Dev

Filtering, Sorting & Fields

List endpoints accept query parameters to filter, sort, shape, and expand the data they return. Aggregation endpoints accept a full pipeline.

Filtering and sorting

The filter and sort parameters take a JSON object expressed in MongoDB Query Language (MQL), passed as a URL-encoded string.

Parameter

Type

Description

filter

string

JSON object of MQL filter criteria, e.g. {"status":"open"}.

sort

string

JSON object of MQL sort criteria, e.g. {"createdAt":-1}.

curl "https://api.valpay.com/v1/disputes?limit=50&page=0&filter=%7B%22status%22%3A%22open%22%7D" \
  -H "Authorization: Bearer YOUR_TOKEN"
curl "https://api.valpay.com/v1/disputes?limit=50&page=0&filter=%7B%22status%22%3A%22open%22%7D" \
  -H "Authorization: Bearer YOUR_TOKEN"
curl "https://api.valpay.com/v1/disputes?limit=50&page=0&filter=%7B%22status%22%3A%22open%22%7D" \
  -H "Authorization: Bearer YOUR_TOKEN"
Selecting fields

Parameter

Type

Description

selectFields

string

Comma-separated list of fields to include. If provided, excludeFields is ignored.

excludeFields

string

Comma-separated list of fields to exclude. Defaults to all fields.

populateOptions

string

JSON object describing related data to include (populate) in the results.

Aggregation pipelines

The Transactions and Deposits aggregated endpoints (POST /v1/transactions/aggregated, POST /v1/deposits/aggregated) accept a read-only MongoDB-style pipeline in the request body. Supported stages include $match, $group, $project, $sort, $limit, $skip, $lookup, $unwind, and $count.

{
  "$match": { "currency": "USD" },
  "$group": { "_id": "$storeId", "total": { "$sum": "$amount" } },
  "$sort": { "total": -1 },
  "$limit": 10
}
{
  "$match": { "currency": "USD" },
  "$group": { "_id": "$storeId", "total": { "$sum": "$amount" } },
  "$sort": { "total": -1 },
  "$limit": 10
}
{
  "$match": { "currency": "USD" },
  "$group": { "_id": "$storeId", "total": { "$sum": "$amount" } },
  "$sort": { "total": -1 },
  "$limit": 10
}