--- title: PurchasingEntity - GraphQL Admin description: Represents information about the purchasing entity for the order or draft order. api_version: 2025-10 api_name: admin type: union api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/unions/PurchasingEntity md: https://shopify.dev/docs/api/admin-graphql/latest/unions/PurchasingEntity.md --- # Purchasing​Entity union Requires The user must have access to customers and orders or draft orders. Represents information about the purchasing entity for the order or draft order. ## Possible types * [Customer](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer) OBJECT Represents information about a customer of the shop, such as the customer's contact details, their order history, and whether they've agreed to receive marketing material by email. **Caution:** Only use this data if it's required for your app's functionality. Shopify will restrict [access to scopes](https://shopify.dev/api/usage/access-scopes) for apps that don't have a legitimate use for the associated data. * addresses [\[Mailing​Address!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/MailingAddress) non-null A list of addresses associated with the customer. * addresses​V2 [Mailing​Address​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/MailingAddressConnection) non-null The addresses associated with the customer. * amount​Spent [Money​V2!](https://shopify.dev/docs/api/admin-graphql/latest/objects/MoneyV2) non-null The total amount that the customer has spent on orders in their lifetime. * can​Delete [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether the merchant can delete the customer from their store. A customer can be deleted from a store only if they haven't yet made an order. After a customer makes an order, they can't be deleted from a store. * company​Contact​Profiles [\[Company​Contact!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/CompanyContact) non-null A list of the customer's company contact profiles. * created​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime) non-null The date and time when the customer was added to the store. * data​Sale​Opt​Out [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether the customer has opted out of having their data sold. * default​Address [Mailing​Address](https://shopify.dev/docs/api/admin-graphql/latest/objects/MailingAddress) The default address associated with the customer. * default​Email​Address [Customer​Email​Address](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerEmailAddress) The customer's default email address. * default​Phone​Number [Customer​Phone​Number](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerPhoneNumber) The customer's default phone number. * display​Name [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null The full name of the customer, based on the values for first\_name and last\_name. If the first\_name and last\_name are not available, then this falls back to the customer's email address, and if that is not available, the customer's phone number. * events [Event​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/EventConnection) non-null A list of events associated with the customer. * first​Name [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The customer's first name. * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) non-null A globally-unique ID. * image [Image!](https://shopify.dev/docs/api/admin-graphql/latest/objects/Image) non-null The image associated with the customer. * last​Name [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The customer's last name. * last​Order [Order](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) The customer's last order. * legacy​Resource​Id [Unsigned​Int64!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/UnsignedInt64) non-null The ID of the corresponding resource in the REST Admin API. * lifetime​Duration [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null The amount of time since the customer was first added to the store. Example: 'about 12 years'. * locale [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null The customer's locale. * mergeable [Customer​Mergeable!](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerMergeable) non-null Whether the customer can be merged with another customer. * metafield [Metafield](https://shopify.dev/docs/api/admin-graphql/latest/objects/Metafield) A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information. * metafields [Metafield​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/MetafieldConnection) non-null A list of [custom fields](https://shopify.dev/docs/apps/build/custom-data) that a merchant associates with a Shopify resource. * multipass​Identifier [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) A unique identifier for the customer that's used with Multipass login. * note [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) A note about the customer. * number​Of​Orders [Unsigned​Int64!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/UnsignedInt64) non-null The number of orders that the customer has made at the store in their lifetime. * orders [Order​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/OrderConnection) non-null A list of the customer's orders. * payment​Methods [Customer​Payment​Method​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/CustomerPaymentMethodConnection) non-null A list of the customer's payment methods. * product​Subscriber​Status [Customer​Product​Subscriber​Status!](https://shopify.dev/docs/api/admin-graphql/latest/enums/CustomerProductSubscriberStatus) non-null Possible subscriber states of a customer defined by their subscription contracts. * state [Customer​State!](https://shopify.dev/docs/api/admin-graphql/latest/enums/CustomerState) non-null The state of the customer's account with the shop. Please note that this only meaningful when Classic Customer Accounts is active. * statistics [Customer​Statistics!](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerStatistics) non-null The statistics for a given customer. * store​Credit​Accounts [Store​Credit​Account​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/StoreCreditAccountConnection) non-null Returns a list of store credit accounts that belong to the owner resource. A store credit account owner can hold multiple accounts each with a different currency. * subscription​Contracts [Subscription​Contract​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/SubscriptionContractConnection) non-null A list of the customer's subscription contracts. * tags [\[String!\]!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null A comma separated list of tags that have been added to the customer. * tax​Exempt [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether the customer is exempt from being charged taxes on their orders. * tax​Exemptions [\[Tax​Exemption!\]!](https://shopify.dev/docs/api/admin-graphql/latest/enums/TaxExemption) non-null The list of tax exemptions applied to the customer. * updated​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime) non-null The date and time when the customer was last updated. * verified​Email [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether the customer has verified their email address. Defaults to `true` if the customer is created through the Shopify admin or API. * email [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) Deprecated * email​Marketing​Consent [Customer​Email​Marketing​Consent​State](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerEmailMarketingConsentState) Deprecated * has​Timeline​Comment [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-nullDeprecated * market [Market](https://shopify.dev/docs/api/admin-graphql/latest/objects/Market) Deprecated * metafield​Definitions [Metafield​Definition​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/MetafieldDefinitionConnection) non-nullDeprecated * phone [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) Deprecated * sms​Marketing​Consent [Customer​Sms​Marketing​Consent​State](https://shopify.dev/docs/api/admin-graphql/latest/objects/CustomerSmsMarketingConsentState) Deprecated * unsubscribe​Url [URL!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/URL) non-nullDeprecated * valid​Email​Address [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-nullDeprecated * [Purchasing​Company](https://shopify.dev/docs/api/admin-graphql/latest/objects/PurchasingCompany) OBJECT Represents information about the purchasing company for the order or draft order. * company [Company!](https://shopify.dev/docs/api/admin-graphql/latest/objects/Company) non-null The company associated to the order or draft order. * contact [Company​Contact](https://shopify.dev/docs/api/admin-graphql/latest/objects/CompanyContact) The company contact associated to the order or draft order. * location [Company​Location!](https://shopify.dev/docs/api/admin-graphql/latest/objects/CompanyLocation) non-null The company location associated to the order or draft order. *** ## Fields with this union * [Calculated​Draft​Order.purchasingEntity](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedDraftOrder#field-CalculatedDraftOrder.fields.purchasingEntity) OBJECT The calculated fields for a draft order. * [Draft​Order.purchasingEntity](https://shopify.dev/docs/api/admin-graphql/latest/objects/DraftOrder#field-DraftOrder.fields.purchasingEntity) OBJECT An order that a merchant creates on behalf of a customer. Draft orders are useful for merchants that need to do the following tasks: * Create new orders for sales made by phone, in person, by chat, or elsewhere. When a merchant accepts payment for a draft order, an order is created. * Send invoices to customers to pay with a secure checkout link. * Use custom items to represent additional costs or products that aren't displayed in a shop's inventory. * Re-create orders manually from active sales channels. * Sell products at discount or wholesale rates. * Take pre-orders. For draft orders in multiple currencies `presentment_money` is the source of truth for what a customer is going to be charged and `shop_money` is an estimate of what the merchant might receive in their shop currency. **Caution:** Only use this data if it's required for your app's functionality. Shopify will restrict [access to scopes](https://shopify.dev/api/usage/access-scopes) for apps that don't have a legitimate use for the associated data. Draft orders created on or after April 1, 2025 will be automatically purged after one year of inactivity. * [Order.purchasingEntity](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order#field-Order.fields.purchasingEntity) OBJECT The `Order` object represents a customer's request to purchase one or more products from a store. Use the `Order` object to handle the complete purchase lifecycle from checkout to fulfillment. Use the `Order` object when you need to: * Display order details on customer account pages or admin dashboards. * Create orders for phone sales, wholesale customers, or subscription services. * Update order information like shipping addresses, notes, or fulfillment status. * Process returns, exchanges, and partial refunds. * Generate invoices, receipts, and shipping labels. The `Order` object serves as the central hub connecting customer information, product details, payment processing, and fulfillment data within the GraphQL Admin API schema. *** Note Only the last 60 days' worth of orders from a store are accessible from the `Order` object by default. If you want to access older records, then you need to [request access to all orders](https://shopify.dev/docs/api/usage/access-scopes#orders-permissions). If your app is granted access, then you can add the `read_all_orders`, `read_orders`, and `write_orders` scopes. *** *** Caution Only use orders data if it's required for your app's functionality. Shopify will restrict [access to scopes](https://shopify.dev/docs/api/usage/access-scopes#requesting-specific-permissions) for apps that don't have a legitimate use for the associated data. *** Learn more about [building apps for orders and fulfillment](https://shopify.dev/docs/apps/build/orders-fulfillment). *** ```graphql union PurchasingEntity = Customer | PurchasingCompany ```