Skip to content
payrocdevelopers

Hypermedia as the engine of application state (HATEOAS)

Explains how the Payroc API uses HATEOAS links to surface related resources and paginate large result sets within API responses.

We implement HATEOAS throughout our API to help you:

View additional information about a resource

If a resource has a relationship with other resources in our API, we provide HATEOAS links to the other resources in our response.

Example

If you retrieve the details of a payment, we include a links object that contains links to any referenced refunds or reversals that are related to the payment.

The following example response contains links to two refunds related to the payment.

JSON
"links": [
  {
    "rel": "refund",
    "method": "get",
    "href": "https://api.payroc.com/v1/refunds/CD3HN88U9F"
  },
  {
    "rel": "refund",
    "method": "get",
    "href": "https://api.payroc.com/v1/refunds/FPU8P48WN8"
  }
]

If a GET request returns a large number of results, we send the results as a paginated list. To help you navigate through the results, we include HATEOAS links so that you can navigate through the results.

Example

The following example response contains a links object with HATEOAS links to the next page and previous page of a paginated list of payments.

JSON
{
  "links": [
    {
      "rel": "next",
      "method": "get",
      "href": "<https://api.payroc.com/v1/payments?processingTerminalId=1001&limit=2&after=CW4BA4MUH0>"
    },
    {
      "rel": "previous",
      "method": "get",
      "href": "<https://api.payroc.com/v1/payments?processingTerminalId=1001&limit=2&before=IFA1T74OBS>"
    }
  ]
}

Browse knowledge

Search documentation

API reference169
Guides118
Knowledge38
legal1
Solutions32
Workflows74
↑↓highlight↵openView all search results

Menu

Theme

Sign out

Your saved plans remain in your organization. This browser’s private draft and account view will be cleared.

Talk to an engineer