Skip to content

Common Relations ​

These link relations are shared between the Payments API and the Insurance API. They are emitted with their IANA registry semantics — clients can treat them the way they would in any HTTP API.

RelationDescription
selfThe URL of the current resource. self links can be considered ad-hoc entry points into the API and can be safely stored for future visits to the resource in the representation of which the link was encountered.
firstFirst item (page) of the underlying collection. Emitted by resources advertising the item profile.
prevPrevious item (page), relative to the current one. Emitted by resources advertising the item profile.
nextNext item (page), relative to the current one. Emitted by resources advertising the item profile.
lastLast item (page) of the underlying collection. Emitted by resources advertising the item profile.
paymentA resource where payment is accepted. Emitted by representations of the payment-experience profile (Payments API) and the intermediated-insurance-application profile (Insurance API). Share the href with your client so they can complete payment in the prepared experience.
monitorExternal tracking page for a payment. Opens in a browser (different host); not intended for server-to-server traversal.
iconIcon image for a resource (for example, an insurance provider logo).
terms-of-serviceTerms and conditions document for a product.
previewA preview representation of the target resource.

Not exhaustive

This is not an exhaustive list of IANA relations the API may emit — any IANA-registered relation can appear on a response. Match by rel string and ignore links whose relation you do not understand.

When you need to act on one of these relations, match the link by its rel value as a string. For pagination relations, you typically also want to filter out anchored links (which apply to a single item rather than the resource as a whole — see Anchoring).

python
def find_link(body, rel):
    return next(
        (link for link in body["links"]
         if link["rel"] == rel and "anchor" not in link),
        None,
    )

next_page = find_link(payments, "next")
if next_page:
    payments = requests.get(next_page["href"], headers=auth).json()
javascript
function findLink(body, rel) {
  return body.links.find(link => link.rel === rel && !link.anchor);
}

const nextPage = findLink(payments, "next");
if (nextPage) {
  payments = await fetch(nextPage.href, { headers: auth }).then(r => r.json());
}

Flywire Agents API Documentation