---
title: PurchasingEntity - Customer API
description: >-
  Represents information about the purchasing entity for the order or draft
  order.
api_version: unstable
api_name: customer
source_url:
  html: 'https://shopify.dev/docs/api/customer/unstable/unions/PurchasingEntity'
  md: 'https://shopify.dev/docs/api/customer/unstable/unions/PurchasingEntity.md'
---

# Purchasing​Entity

union

Represents information about the purchasing entity for the order or draft order.

## Possible types

* [Customer](https://shopify.dev/docs/api/customer/unstable/objects/Customer)

  OBJECT

  Represents the personal information of a customer. Apps using the Customer Account API must meet the protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data).

  * addresses

    [Customer​Address​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/CustomerAddressConnection)

    non-null

    The addresses associated with the customer.

    * skip​Default

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      ### Arguments

      A flag indicating whether the default address should be included.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * reverse

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    ***

  * company​Contacts

    [Company​Contact​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/CompanyContactConnection)

    non-null

    The list of contacts the customer is associated with.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      ### Arguments

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * reverse

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    ***

  * creation​Date

    [Date​Time!](https://shopify.dev/docs/api/customer/unstable/scalars/DateTime)

    non-null

    The date and time when the customer was created.

  * default​Address

    [Customer​Address](https://shopify.dev/docs/api/customer/unstable/objects/CustomerAddress)

    The default address of the customer.

  * display​Name

    [String!](https://shopify.dev/docs/api/customer/unstable/scalars/String)

    non-null

    The full name of the customer, based on the first\_name and last\_name values. If these aren't available, it falls back to the customer's email address, and if that isn't available, the customer's phone number.

  * draft​Orders

    [Draft​Order​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/DraftOrderConnection)

    non-null

    The Draft Orders associated with the customer.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      ### Arguments

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * reverse

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    * sort​Key

      [Draft​Order​Sort​Keys](https://shopify.dev/docs/api/customer/unstable/enums/DraftOrderSortKeys)

      Default:ID

      Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).

    * query

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * * default

          string

        * company\_contact\_id

          id

        - Filter by a case-insensitive search of multiple fields in a document.

        - Example:
          * `query=Bob Norman`
          * `query=title:green hoodie`

      * created\_at

        time

      * customer\_id

        id

      * * id

          id

        * name

          string

        - Filter by `id` range.

        - Example:
          * `id:1234`
          * `id:>=1234`
          * `id:<=1234`

      * purchasing\_entity

        string

      * source

        string

      * status

        string

      * tag

        string

      * updated\_at

        time

    ***

  * email​Address

    [Customer​Email​Address](https://shopify.dev/docs/api/customer/unstable/objects/CustomerEmailAddress)

    [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The email address of the customer.

  * first​Name

    [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

    The first name of the customer.

  * id

    [ID!](https://shopify.dev/docs/api/customer/unstable/scalars/ID)

    non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    A globally-unique ID.

  * image​Url

    [URL!](https://shopify.dev/docs/api/customer/unstable/scalars/URL)

    non-null

    The URL to the avatar image of the customer.

  * last​Incomplete​Checkout

    [Checkout](https://shopify.dev/docs/api/customer/unstable/objects/Checkout)

    The customer's most recently updated, incomplete checkout.

  * last​Name

    [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

    The last name of the customer.

  * metafield

    [Metafield](https://shopify.dev/docs/api/customer/unstable/objects/Metafield)

    [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    A metafield found by namespace and key.

    * namespace

      [String!](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      required

      ### Arguments

      A container for a set of metafields.

    * key

      [String!](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      required

      The identifier for the metafield.

    ***

  * metafields

    [\[Metafield\]!](https://shopify.dev/docs/api/customer/unstable/objects/Metafield)

    non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The metafields associated with the resource matching the supplied list of namespaces and keys.

    * identifiers

      [\[Has​Metafields​Identifier!\]!](https://shopify.dev/docs/api/customer/unstable/input-objects/HasMetafieldsIdentifier)

      required

      ### Arguments

      The list of metafields to retrieve by namespace and key.

    ***

  * orders

    [Order​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/OrderConnection)

    non-null

    The orders associated with the customer.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      ### Arguments

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * reverse

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    * sort​Key

      [Order​Sort​Keys](https://shopify.dev/docs/api/customer/unstable/enums/OrderSortKeys)

      Default:ID

      Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).

    * query

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * * default

          string

        * confirmation\_number

          string

        - Filter by a case-insensitive search of multiple fields in a document.

        - Example:
          * `query=Bob Norman`
          * `query=title:green hoodie`

      * created\_at

        time

      * * id

          id

        * name

          string

        - Filter by `id` range.

        - Example:
          * `id:1234`
          * `id:>=1234`
          * `id:<=1234`

      * order\_number

        string

      * processed\_at

        time

      * purchasing\_company\_contact\_id

        id

      * purchasing\_company\_id

        id

      * purchasing\_company\_location\_id

        id

      * purchasing\_entity

        string

      * shipment\_status

        string

      * updated\_at

        time

    ***

  * phone​Number

    [Customer​Phone​Number](https://shopify.dev/docs/api/customer/unstable/objects/CustomerPhoneNumber)

    [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The phone number of the customer.

  * store​Credit​Accounts

    [Store​Credit​Account​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/StoreCreditAccountConnection)

    non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    A list of the owner resource's store credit accounts. Store credit accounts are not shown for shops with store credit disabled at checkout.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      ### Arguments

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * query

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * currency\_code

        string

      * id

        id

        Filter by `id` range.

        Example:

        * `id:1234`
        * `id:>=1234`
        * `id:<=1234`

    ***

  * subscription​Contract

    [Subscription​Contract](https://shopify.dev/docs/api/customer/unstable/objects/SubscriptionContract)

    Returns a `SubscriptionContract` resource by ID.

    * id

      [ID!](https://shopify.dev/docs/api/customer/unstable/scalars/ID)

      required

      ### Arguments

      The ID of the `SubscriptionContract` to return.

    ***

  * subscription​Contracts

    [Subscription​Contract​Connection!](https://shopify.dev/docs/api/customer/unstable/connections/SubscriptionContractConnection)

    non-null

    The Subscription Contracts associated with the customer.

    * first

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      ### Arguments

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * after

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/customer/unstable/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * reverse

      [Boolean](https://shopify.dev/docs/api/customer/unstable/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    * sort​Key

      [Subscription​Contracts​Sort​Keys](https://shopify.dev/docs/api/customer/unstable/enums/SubscriptionContractsSortKeys)

      Default:CREATED\_AT

      Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).

    * query

      [String](https://shopify.dev/docs/api/customer/unstable/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * created\_at

        time

      * * id

          id

        * last\_billing\_attempt\_error\_type

          string

        - Filter by `id` range.

        - Example:
          * `id:1234`
          * `id:>=1234`
          * `id:<=1234`

      * status

        string

      * updated\_at

        time

    ***

  * tags

    [\[String!\]!](https://shopify.dev/docs/api/customer/unstable/scalars/String)

    non-null

    A comma-separated list of tags that have been added to the customer.

* [Purchasing​Company](https://shopify.dev/docs/api/customer/unstable/objects/PurchasingCompany)

  OBJECT

  The information of the purchasing company for an order or draft order.

  * company

    [Company!](https://shopify.dev/docs/api/customer/unstable/objects/Company)

    non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The company associated with the order or draft order.

  * contact

    [Company​Contact](https://shopify.dev/docs/api/customer/unstable/objects/CompanyContact)

    [Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The company contact associated with the order or draft order.

  * location

    [Company​Location!](https://shopify.dev/docs/api/customer/unstable/objects/CompanyLocation)

    non-null[Pre-auth accessible](https://shopify.dev/docs/apps/build/customer-accounts/order-status-page#customer-account-api)

    The company location associated with the order or draft order.

***

## Fields with this union

* [Draft​Order.purchasingEntity](https://shopify.dev/docs/api/customer/unstable/objects/DraftOrder#field-DraftOrder.fields.purchasingEntity)

  OBJECT

  A draft order for the customer. Any fields related to money are in the presentment currency. Apps using the Customer Account API must meet the protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data).

* [Order.purchasingEntity](https://shopify.dev/docs/api/customer/unstable/objects/Order#field-Order.fields.purchasingEntity)

  OBJECT

  A customer’s completed request to purchase one or more products from a shop. Apps using the Customer Account API must meet the protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data).

***

```graphql
union PurchasingEntity = Customer | PurchasingCompany
```
