> ## Documentation Index
> Fetch the complete documentation index at: https://dev.ownright.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Referrals

> Returns all referrals the business contact is involved in.

<RequestExample>
  ```graphql Request [expandable] theme={null}
  query GetReferrals($after: String, $before: String, $first: Int, $last: Int) {
    referrals(after: $after, before: $before, first: $first, last: $last) {
      nodes {
        createdAt
        id
        status
        type
        updatedAt
        contacts {
          email
          firstName
          id
          isPrimary
          lastName
          phoneNumber
        }
        customAttributes {
          id
          key
          type
          value
        }
        primaryContact {
          email
          firstName
          id
          isPrimary
          lastName
          phoneNumber
        }
        ... on PurchasePropertyClosingReferral {
          propertyAddress {
            city
            country
            latitude
            longitude
            mapImageUrl
            postalCode
            province
            shortTitle
            street
            title
            unitNumber
          }
          purchaseAmount {
            amount
            currencyCode
          }
        }
        ... on RefinanceReferral {
          mortgageAmount {
            amount
            currencyCode
          }
          propertyAddress {
            city
            country
            latitude
            longitude
            mapImageUrl
            postalCode
            province
            shortTitle
            street
            title
            unitNumber
          }
        }
        ... on SalePropertyClosingReferral {
          propertyAddress {
            city
            country
            latitude
            longitude
            mapImageUrl
            postalCode
            province
            shortTitle
            street
            title
            unitNumber
          }
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
  ```

  ```graphql Variables theme={null}
  {
    "after": "example-after",
    "before": "example-before",
    "first": 10,
    "last": 10
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "referrals": {
        "nodes": [
          {
            "createdAt": "2025-01-15T10:30:00Z",
            "id": "gid://ownright/Object/1",
            "status": "CONVERTED",
            "type": "PURCHASE_PROPERTY_CLOSING",
            "updatedAt": "2025-01-15T10:30:00Z",
            "contacts": [
              {
                "email": "jane@example.com",
                "firstName": "Jane",
                "id": "gid://ownright/Object/1",
                "isPrimary": true,
                "lastName": "Doe",
                "phoneNumber": "+14165551234"
              }
            ],
            "customAttributes": [
              {
                "id": "gid://ownright/Object/1",
                "key": "example-key",
                "type": "BOOLEAN",
                "value": "example-value"
              }
            ],
            "primaryContact": {
              "email": "jane@example.com",
              "firstName": "Jane",
              "id": "gid://ownright/Object/1",
              "isPrimary": true,
              "lastName": "Doe",
              "phoneNumber": "+14165551234"
            },
            "propertyAddress": {
              "city": "Toronto",
              "country": "CANADA",
              "latitude": 1,
              "longitude": 1,
              "mapImageUrl": "https://example.com",
              "postalCode": "M5V 1A1",
              "province": "ALBERTA",
              "shortTitle": "123 Main St, Toronto",
              "street": "123 Main St",
              "title": "123 Main St, Toronto",
              "unitNumber": "Suite 100"
            },
            "purchaseAmount": {
              "amount": "100.00",
              "currencyCode": "CAD"
            },
            "mortgageAmount": {
              "amount": "100.00",
              "currencyCode": "CAD"
            }
          }
        ],
        "pageInfo": {
          "hasNextPage": true,
          "endCursor": "cursor_abc123"
        }
      }
    }
  }
  ```
</ResponseExample>

## Query field

`referrals`

### Arguments

<ParamField path="after" type="String">
  Returns the elements in the list that come after the specified cursor.
</ParamField>

<ParamField path="before" type="String">
  Returns the elements in the list that come before the specified cursor.
</ParamField>

<ParamField path="first" type="Int">
  Returns the first *n* elements from the list.
</ParamField>

<ParamField path="last" type="Int">
  Returns the last *n* elements from the list.
</ParamField>

### Return fields

<ResponseField name="referrals" type="ReferralConnection!" required>
  Returns all referrals the business contact is involved in.

  <Expandable title="properties">
    <ResponseField name="edges" type="[ReferralEdge]">
      A list of edges.

      <Expandable title="properties">
        <ResponseField name="cursor" type="String!" required>
          A cursor for use in pagination.
        </ResponseField>

        <ResponseField name="node" type="Referral">
          The item at the end of the edge.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="nodes" type="[Referral]">
      A list of nodes.

      <Expandable title="properties">
        <ResponseField name="contacts" type="[ReferralContact!]!" required>
          The contacts for the referral.
        </ResponseField>

        <ResponseField name="createdAt" type="ISO8601DateTime!" required>
          The time the referral was created.
        </ResponseField>

        <ResponseField name="customAttributes" type="[CustomAttribute!]!" required>
          The custom attributes for the referral.
        </ResponseField>

        <ResponseField name="id" type="GID!" required>
          ID of the object.
        </ResponseField>

        <ResponseField name="primaryContact" type="ReferralContact!" required>
          The primary contact for the referral.
        </ResponseField>

        <ResponseField name="status" type="ReferralStatus!" required>
          The current status of the referral.
        </ResponseField>

        <ResponseField name="type" type="ReferralType!" required>
          The type of the referral.
        </ResponseField>

        <ResponseField name="updatedAt" type="ISO8601DateTime!" required>
          The time the referral was updated.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pageInfo" type="PageInfo!" required>
      Information to aid in pagination.

      <Expandable title="properties">
        <ResponseField name="endCursor" type="String">
          When paginating forwards, the cursor to continue.
        </ResponseField>

        <ResponseField name="hasNextPage" type="Boolean!" required>
          When paginating forwards, are there more items?
        </ResponseField>

        <ResponseField name="hasPreviousPage" type="Boolean!" required>
          When paginating backwards, are there more items?
        </ResponseField>

        <ResponseField name="startCursor" type="String">
          When paginating backwards, the cursor to continue.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Types

* [`CustomAttribute`](/partner-api/reference/members/objects/custom-attribute) (object) — A custom attribute.
* [`CustomAttributeType`](/partner-api/reference/members/enums/custom-attribute-type) (enum) — Possible custom attribute types.
* [`GID`](/partner-api/reference/members/scalars/gid) (scalar) — A global identifier for an object in the format of 'gid://ownright/ObjectType/ID'.
* [`ISO8601DateTime`](/partner-api/reference/members/scalars/iso8601-date-time) (scalar) — An ISO 8601-encoded datetime
* [`PageInfo`](/partner-api/reference/members/objects/page-info) (object) — Information about pagination in a connection.
* [`Referral`](/partner-api/reference/members/interfaces/referral) (interface) — Represents a referral.
* [`ReferralConnection`](/partner-api/reference/members/objects/referral-connection) (object) — The connection type for Referral.
* [`ReferralContact`](/partner-api/reference/members/objects/referral-contact) (object) — A contact for a referral.
* [`ReferralEdge`](/partner-api/reference/members/objects/referral-edge) (object) — An edge in a connection.
* [`ReferralStatus`](/partner-api/reference/members/enums/referral-status) (enum) — Possible statuses for referrals.
* [`ReferralType`](/partner-api/reference/members/enums/referral-type) (enum) — Possible types of referrals.
