Pagination

If a request returns a lot of results you can use pagination to split the results up into smaller pieces. On the server side, pagination helps to reduce the payload which leads to better response times. On your side, it leads to a better user experience since instead of one long list they get a shorter list separated into multiple pages. This can be helpful especially on smaller screens like on mobile devices.

Pagination parameters and how to add them

Can I use pagination with any endpoint?

No, only specific endpoints containing lists support pagination.

Is there a default pagination?

If an endpoint supports pagination, the result will always be returned with default pagination.

The default setting is:

  • page=1 (start on page 1)

  • per_page=10 (display 10 entries per page)

You can change the pagination setting in your request via the pagination parameters.

How to use the pagination parameters in a requests

Pagination parameters are added as query parameters with the request in the format

{endpoint_path}?page=2&per_page=10

curl https://base-url-placeholder/offers?amount=12000&country=US&recipient=FWU&page=1&per_page=10 \
-X GET \
-H "Content-Type: application/json" \
-H "X-Authentication-Key: {api_key}" \

Response example with pagination

The pagination parameters are followed by an array of the actual items (in the example, those items are offers) of the current page. The number of items in the array depends on the per_page value, for example the array will contain 10 items if the per_page value is 10.

Parameters for pagination

offers object

payment_method object

Contains information about the payment method of this offer.

price object

Contains the amount of money the payer has to send if this offer is selected.

The amount to pay (price) in offers can change due to FX rates. The final amount is only "locked in" when you create a payment from the order.

fields array

Some countries' regulations require extra fields in order to process a payment depending on the selected offer. If an offer contains any extra fields, they are required fields.

{
  "total_entries": 1,
  "total_pages": 1,
  "page": 1,
  "per_page": 10,
  "offers": [
    {
	"id": "MXZwMDAyHHUSE9PVF9POlIgS33j",
	"payment_method": {
		"id": "529_provider",
		"name": "Domestic USD 529 payment",
		"kind": "529_payment"
		},
	"description": "529 payment with specific provider",
	"extra_terms": null,
	"price": {
		"value": 1200000,
		"currency": "USD"
		},
	"fees": 0,
	"exchange_rate": 1,
	"fields":[]
    }
  ]
}