> ## 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.

# Property Closing Referral Bulk Create

> Creates multiple property closing referrals.

<RequestExample>
  ```graphql Request [expandable] theme={null}
  mutation PropertyClosingReferralBulkCreate($input: [PropertyClosingReferralInput!]!) {
    propertyClosingReferralBulkCreate(input: $input) {
      referrals {
        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
          }
        }
      }
      userErrors {
        code
        field
        message
      }
    }
  }
  ```

  ```graphql Variables theme={null}
  {
    "input": [
      {
        "contacts": [
          {
            "email": "jane@example.com",
            "firstName": "Jane",
            "lastName": "Doe",
            "phoneNumber": "+14165551234",
            "primary": true
          }
        ],
        "customAttributes": [
          {
            "key": "example-key",
            "type": "BOOLEAN",
            "value": "example-value"
          }
        ],
        "files": [
          {
            "fileRecordId": "gid://ownright/FileRecord/1",
            "tags": [
              "example-tags"
            ]
          }
        ],
        "intentLevel": "HIGH",
        "purchaseAmount": {
          "amount": "100.00",
          "currencyCode": "CAD"
        },
        "purchasePropertyAddress": {
          "city": "Toronto",
          "country": "CANADA",
          "postalCode": "M5V 1A1",
          "province": "ALBERTA",
          "street": "123 Main St",
          "unitNumber": "Suite 100"
        },
        "salePropertyAddress": {
          "city": "Toronto",
          "country": "CANADA",
          "postalCode": "M5V 1A1",
          "province": "ALBERTA",
          "street": "123 Main St",
          "unitNumber": "Suite 100"
        },
        "type": "PURCHASE_PROPERTY_CLOSING"
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "propertyClosingReferralBulkCreate": {
        "referrals": [
          {
            "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"
            }
          }
        ],
        "userErrors": []
      }
    }
  }
  ```
</ResponseExample>

## Mutation field

`propertyClosingReferralBulkCreate`

### Arguments

<ParamField path="input" type="[PropertyClosingReferralInput!]!" required>
  Input required to create property closing referrals.

  <Expandable title="properties">
    <ParamField path="contacts" type="[ReferralContactCreateInput!]">
      Contacts to be associated with the referral.

      <Expandable title="properties">
        <ParamField path="email" type="String!" required>
          The email for the referral contact.
        </ParamField>

        <ParamField path="firstName" type="String!" required>
          The first name for the referral contact.
        </ParamField>

        <ParamField path="lastName" type="String">
          The last name for the referral contact.
        </ParamField>

        <ParamField path="phoneNumber" type="String">
          The phone number for the referral contact.
        </ParamField>

        <ParamField path="primary" type="Boolean!" required>
          Whether this contact is the primary contact for the referral.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="customAttributes" type="[CustomAttributeCreateInput!]">
      Custom attributes to be associated with the referral.

      <Expandable title="properties">
        <ParamField path="key" type="String!" required>
          The key of the custom attribute.
        </ParamField>

        <ParamField path="type" type="CustomAttributeType!" required>
          The type of the custom attribute.
        </ParamField>

        <ParamField path="value" type="String!" required>
          The value of the custom attribute.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="files" type="[FileBulkCommitInput!]!" required>
      The files to be associated with the referral.

      <Expandable title="properties">
        <ParamField path="fileRecordId" type="FileRecordGID!" required>
          The identifier of a staged file record to commit.
        </ParamField>

        <ParamField path="tags" type="[String!]!" required>
          Tags to add to the committed versioned file.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="intentLevel" type="ReferralIntentLevel">
      The intent level of the referral.
    </ParamField>

    <ParamField path="purchaseAmount" type="MoneyInput">
      The amount the purchase property is being purchased for.

      <Expandable title="properties">
        <ParamField path="amount" type="Decimal!" required>
          The amount of money.
        </ParamField>

        <ParamField path="currencyCode" type="CurrencyCode!" required>
          The currency of the money.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="purchasePropertyAddress" type="AddressInput">
      The address of the property the person is buying.

      <Expandable title="properties">
        <ParamField path="city" type="String">
          The city of the address.
        </ParamField>

        <ParamField path="country" type="Country">
          The country of the address.
        </ParamField>

        <ParamField path="postalCode" type="String">
          The postal code of the address.
        </ParamField>

        <ParamField path="province" type="Province">
          The province of the address.
        </ParamField>

        <ParamField path="street" type="String">
          The street name and number of the address.
        </ParamField>

        <ParamField path="unitNumber" type="String">
          The unit number, suite number, apartment number, etc. of the address.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="salePropertyAddress" type="AddressInput">
      The address of the property the person is selling.

      <Expandable title="properties">
        <ParamField path="city" type="String">
          The city of the address.
        </ParamField>

        <ParamField path="country" type="Country">
          The country of the address.
        </ParamField>

        <ParamField path="postalCode" type="String">
          The postal code of the address.
        </ParamField>

        <ParamField path="province" type="Province">
          The province of the address.
        </ParamField>

        <ParamField path="street" type="String">
          The street name and number of the address.
        </ParamField>

        <ParamField path="unitNumber" type="String">
          The unit number, suite number, apartment number, etc. of the address.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="type" type="ReferralType!" required>
      The type of the referral.
    </ParamField>
  </Expandable>
</ParamField>

### Return fields

<ResponseField name="referrals" type="[Referral!]">
  The created referrals.

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

      <Expandable title="properties">
        <ResponseField name="email" type="String!" required>
          The email of the contact.
        </ResponseField>

        <ResponseField name="firstName" type="String!" required>
          The first name of the contact.
        </ResponseField>

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

        <ResponseField name="isPrimary" type="Boolean!" required>
          Whether the contact is the primary contact.
        </ResponseField>

        <ResponseField name="lastName" type="String">
          The last name of the contact.
        </ResponseField>

        <ResponseField name="phoneNumber" type="String">
          The phone number of the contact.
        </ResponseField>
      </Expandable>
    </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.

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

        <ResponseField name="key" type="String!" required>
          The key of the custom attribute.
        </ResponseField>

        <ResponseField name="type" type="CustomAttributeType!" required>
          The type of the custom attribute.
        </ResponseField>

        <ResponseField name="value" type="String!" required>
          The value of the custom attribute.
        </ResponseField>
      </Expandable>
    </ResponseField>

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

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

      <Expandable title="properties">
        <ResponseField name="email" type="String!" required>
          The email of the contact.
        </ResponseField>

        <ResponseField name="firstName" type="String!" required>
          The first name of the contact.
        </ResponseField>

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

        <ResponseField name="isPrimary" type="Boolean!" required>
          Whether the contact is the primary contact.
        </ResponseField>

        <ResponseField name="lastName" type="String">
          The last name of the contact.
        </ResponseField>

        <ResponseField name="phoneNumber" type="String">
          The phone number of the contact.
        </ResponseField>
      </Expandable>
    </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="userErrors" type="[PropertyClosingReferralBulkCreateUserError!]!" required>
  List of errors that occurred while executing the mutation.

  <Expandable title="properties">
    <ResponseField name="code" type="PropertyClosingReferralBulkCreateUserErrorCode">
      Error code associated with the error.
    </ResponseField>

    <ResponseField name="field" type="[String!]">
      The path to the input field that caused the error.
    </ResponseField>

    <ResponseField name="message" type="String!" required>
      A description of the error.
    </ResponseField>
  </Expandable>
</ResponseField>

### Types

* [`AddressInput`](/partner-api/reference/members/inputs/address-input) (input) — Input to create or update an address.
* [`Country`](/partner-api/reference/members/enums/country) (enum) — Possible countries.
* [`CurrencyCode`](/partner-api/reference/members/enums/currency-code) (enum) — Possible currency codes.
* [`CustomAttribute`](/partner-api/reference/members/objects/custom-attribute) (object) — A custom attribute.
* [`CustomAttributeCreateInput`](/partner-api/reference/members/inputs/custom-attribute-create-input) (input) — Input to create a custom attribute.
* [`CustomAttributeType`](/partner-api/reference/members/enums/custom-attribute-type) (enum) — Possible custom attribute types.
* [`Decimal`](/partner-api/reference/members/scalars/decimal) (scalar) — A signed decimal number, which supports arbitrary precision and is serialized as a string.
* [`FileBulkCommitInput`](/partner-api/reference/members/inputs/file-bulk-commit-input) (input) — Input for a file to committed as part of a bulk file commit.
* [`FileRecordGID`](/partner-api/reference/members/scalars/file-record-gid) (scalar) — A global identifier for a FileRecord object in format of 'gid://ownright/FileRecord/ID'.
* [`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
* [`MoneyInput`](/partner-api/reference/members/inputs/money-input) (input) — Input that represents money.
* [`PropertyClosingReferralBulkCreatePayload`](/partner-api/reference/members/objects/property-closing-referral-bulk-create-payload) (object) — Return type for the `propertyClosingReferralBulkCreate` mutation.
* [`PropertyClosingReferralBulkCreateUserError`](/partner-api/reference/members/objects/property-closing-referral-bulk-create-user-error) (object) — An error that could occur during the execution of the `propertyClosingReferralBulkCreate` mutation.
* [`PropertyClosingReferralBulkCreateUserErrorCode`](/partner-api/reference/members/enums/property-closing-referral-bulk-create-user-error-code) (enum) — Possible error codes that can be returned by PropertyClosingReferralBulkCreateUserError.
* [`PropertyClosingReferralInput`](/partner-api/reference/members/inputs/property-closing-referral-input) (input) — Input to create a property closing referral.
* [`Province`](/partner-api/reference/members/enums/province) (enum) — Possible provinces.
* [`Referral`](/partner-api/reference/members/interfaces/referral) (interface) — Represents a referral.
* [`ReferralContact`](/partner-api/reference/members/objects/referral-contact) (object) — A contact for a referral.
* [`ReferralContactCreateInput`](/partner-api/reference/members/inputs/referral-contact-create-input) (input) — The input to create a referral contact.
* [`ReferralIntentLevel`](/partner-api/reference/members/enums/referral-intent-level) (enum) — Possible levels of intent for a referral.
* [`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.
