Skip to content

GET   /accounts/relationship

Get account relationships with filtering and pagination

Retrieve parent-child relationships between accounts. Supports filtering by parent account, child account, or any account (either parent or child). Requires Super Admin permissions.

Typical hierarchies: ISO → Agent → Merchant

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Optional Parameters

Click here to view an exhaustive list of all available parameters
page   query integer

Page number for pagination

pageSize   query integer

Number of relationships per page

parentAccountId   query string

Filter by parent account ID (exact match)

childAccountId   query string

Filter by child account ID (exact match)

accountId   query string

Get all relationships where account is either parent OR child

Try it out

Loading...

Output:

Responses

Description

Successful response

{
"relationships": [
{
"parentAccountId": "string",
"childAccountId": "string",
"createdBy": "string",
"createdAt": "string",
"parentAccount": {
"uniqueId": "string",
"name": "string",
"accountTypeId": "string",
"repcode": "string"
},
"childAccount": {
"uniqueId": "string",
"name": "string",
"accountTypeId": "string",
"repcode": "string"
}
}
],
"totalCount": 0,
"totalPages": 0,
"currentPage": 0
}

References

#/components/schemas/AccountSummary

type: object
properties:
uniqueId:
type: string
description: Unique identifier for the account
name:
type: string
description: Account name
accountTypeId:
type: string
nullable: true
description: Type of account (e.g., "iso", "agent", "merchant")
repcode:
type: string
nullable: true
description: Representative code for the account
required:
- uniqueId
- name

#/components/schemas/AccountRelationship

type: object
properties:
parentAccountId:
type: string
description: Unique ID of the parent account
childAccountId:
type: string
description: Unique ID of the child account
createdBy:
type: string
description: Email of the user who created the relationship
createdAt:
type: string
format: date-time
description: Timestamp when the relationship was created
parentAccount:
$ref: "#/components/schemas/AccountSummary"
childAccount:
$ref: "#/components/schemas/AccountSummary"
required:
- parentAccountId
- childAccountId
- createdBy
- createdAt

Route Source Code

Check out the source code for this route entrypoint here: /accounts/relationship/route.ts

Or the swagger.yaml spec this documentation was generated from: /accounts/swagger.yaml