Pagniate Resources With Uniform Structure

Payiano provides convenient ways to fetch multiple items from its API resources through list API methods. These methods are available for various top-level resources, such as Payment Links, Taxes, Customers, Discounts and Customer Tags. They all share a common structure.

  • Consistent Structure: One of the key advantages is the uniformity in the structure of these methods. Regardless of the specific resource you're working with, the "list" methods share a common structure. This consistency simplifies the development process and reduces the learning curve for developers.
  • Ease of Use: With the common structure, developers can quickly understand how to use these methods. They typically require parameters like per_page, page and q to specify the number of items to retrieve and the order in which they should be returned.
  • Resource Flexibility: The fact that these methods are available for various top-level resources means that you can apply the same approach to retrieve data from different parts of the Payiano ecosystem. This consistency makes it easier to work with different aspects of your business logic.
  • Streamlined Development: When you're building applications that involve fetching and managing multiple records, having a common structure for retrieving these records can streamline development efforts. You can apply similar code patterns and logic across different resource types.
GET/resource
Sandbox: https://api.payiano.dev/v1/resource
Live: https://api.payiano.com/v1/resource
Request
Request body schema:
application/json
Query parameters:
page
Type: integer|null
Default: 1

The page number to be retrieved, for the list of items. So, a combination of page=1 and per_page=25 returns the first 25 items. A combination of page=2 and per_page=25 returns the next 25 items.

per_page
Type: integer|null
Default: 25
Possible values: [1 ... 200]

The maximum number of items to return in the response.

order_by
Type: string|null

This refers to the column or attribute by which you would like to sort or order the results. When retrieving a list of items, you can specify a particular column as a reference point for organizing the items in a specific order.

order
Type: enum|null
Possible values:
[
"ASC", "DESC" ]

This refers to the way by which you would like to sort or order the results. When retrieving a list of items, you can specify a particular way for organizing the items in a specific order, such as ascending or descending.

q
Type: string|null

An easy and effective free search text to search items. Please provide a minimum of 3 characters for each search item. This ensures that your search query is specific enough to yield relevant results.

Response
200
Response schema:
application/json
Response body:
total_pages
Type: integer

The total number of pages that are available for the items search criteria.

current_page
Type: integer

The current pagination page.

per_page
Type: integer

The amount of items items return per page.

total_items
Type: integer

The total number of items that match the search criteria.

items
Type: array_of_objects

The list of items that match the search criteria.

Response sample:
1
{
2 "per_page": 25, 3 "total_pages": 1, 4 "total_items": 1, 5 "current_page": 1, 6 "items": [] 7}