1. Organizations
  2. Retrieve Organizations

Organizations

Retrieve Organizations

Retrieve Organization

This endpoint enables the retrieval of comprehensive organization information, including configuration settings, carrier credentials, and tenant relationships.

GET
`/v1/organizations/:organization`

Request Parameters

The endpoint accepts optional query parameters to customize the response:

js
        {
  tenant_ids?: string[]          // Filters tenant relationships
}

      
js
        const response = await fetch(`https://api.packagex.io/v1/org`, {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
});

const organization = response.data;

      

List Organizations

GET
`/v1/organizations`

You will never have more than one organization scoped to an API key. Therefore, this endpoint will always return a single organization, just in an array.

js
        const response = await fetch(`https://api.packagex.io/v1/organizations`, {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const org = response.data[0]; //There will always only be one response
const pagination = response.pagination; //The has_more property will be null

      

Retrieve Organization Payouts Profile

This endpoint provides access to detailed information about an organization's payout configuration and status.

GET
`/v1/organizations/:organization_id/payouts`

Example Request

js
        const response = await fetch(`https://api.packagex.io/v1/organizations/${org_id}/payouts`, {
  method: 'GET',
  headers: {
    'PX-API-KEY': process.env.PX_API_KEY,
    'Content-Type': 'application/json'
  }
});

      

Access Requests

GET
`/v1/organizations/access-requests`

List access requests for the organization. This endpoint is restricted to owner roles.

Query Parameters

page number
Page number for pagination. Default: 1.

limit number
Number of results per page. Default: 10.

order_by string
Field to order results by. One of: created_at, updated_at. Default: created_at.

direction asc|desc
Sort direction. Default: desc.

status string
Filter by access request status. One of: requested, approved, rejected.

created_at string
Filter by creation date.

updated_at string
Filter by last updated date.

updated_by string
Filter by the user, API key, or organization that last updated the request.

Example Request

js
        const response = await fetch("https://api.packagex.io/v1/organizations/access-requests?status=requested&limit=20", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const access_requests = response.data;
const pagination = response.pagination;