Skip to content

cartBuyerIdentityUpdate does not clear buyerIdentity fields when passing null values #793

@mtaran89

Description

@mtaran89

Describe the bug
When using the Android Buy SDK to update a cart's buyerIdentity via the cartBuyerIdentityUpdate mutation, setting fields (e.g., customerAccessToken, email, phone) to null does not actually clear them on the cart object.
The same mutation works as expected on iOS (Shopify iOS Buy SDK) and via direct Storefront API calls, where passing null properly removes/clears the values.

On Android, it seems the SDK either omits the fields entirely or does not serialize the explicit null values in the GraphQL request, causing Shopify to keep the old values.


To Reproduce

  1. Have a cart with an existing buyerIdentity (e.g., after logging in a customer).
  2. Call cartBuyerIdentityUpdate from the Android Buy SDK:
Storefront.CartBuyerIdentityInput input = new Storefront.CartBuyerIdentityInput()
    .setCustomerAccessToken(null))

mutationQuery.cartBuyerIdentityUpdate(cartId, input, cart -> cart.id());

- Android Buy SDK version: 2025.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions