Issue with buyerIdentity returning null

Hello,

We are experiencing an issue with the Shopify Functions API where the buyerIdentity field is returning as null. This field is crucial for our app to detect customer metafield information and to apply discounts accurately. We have entered the email of an existing customer in the checkout, but the buyerIdentity is still null

We would like to know if there are any known settings, configurations, or bugs within Shopify that might cause the buyerIdentity to not be present in the input from the Shopify Functions API. For instance, we discovered that specific settings, such as the “compare price hiding” feature in Shopify markets, can affect how data is reported.

Any insights or guidance on resolving this issue would be greatly appreciated.

1 Like

Here are the relevant parts of our query for amount-off-product discounts:

query Input(
  $customerTagsToCheck: [String!]
  $collectionIdsToCheck: [ID!]
  $metafieldKeyToCheck: String = ""
  $metafieldNamespaceToCheck: String = ""
  $productTagsToCheck: [String!]
) {
  cart {
    buyerIdentity {
      customer {
        id
        hasTags(tags: $customerTagsToCheck) {
          tag
          hasTag
        }
        numberOfOrders
        checkMetafield: metafield(
          key: $metafieldKeyToCheck
          namespace: $metafieldNamespaceToCheck
        ) {
          value
        }
      }
      isAuthenticated
    }
    
    // Irrelevant fields redacted
  }
}

However, for one specific store, the buyerIdentity is null. We haven’t seen this on other stores yet.

Thanks in advance for any help!

Hi Seun and Tobe, is it possible the store is using Dynamic Checkout buttons similar to this other issue?

There also may be some limitations if the merchant is using their own API to pull the cart details from shopify, preventing the logged in customer’s customerAccessToken from being associated with the cart.

Other than that, a potential safeguard could be to enable “Accounts are required” in the store settings, which would ensure customers are authenticated before proceeding to checkout.

Coming from the discounts perspective, other than these two limitations I am unaware of anything else that could be preventing the buyer identity from showing up. If that doesn’t help, I’ll bring it to the attention of our customer accounts team to see if they have anything else to add.

It doesn’t look like the app needs any access scopes for this info, though I’m assuming you have attained level 2 access of protected customer data, as I see that’s required according to the graphql API for buyerIdentity, dropping the link here anyway in case it’s useful at all for this issue.

Hi Mathius, thank you for your response. We have reached out to the affected merchants to ask whether this was the case.

Also, I have verified we have level 2 customer data access:

Thanks for your help.

Hi Mathius,

Thanks for the response, yes they were indeed using accelerated checkout and the issue stopped after deactivating it.

Thank you for your support.