Auto-Populating Delivery Address in Checkout Page Using Storefront API

Auto-Populating Delivery Address in Checkout Page Using Storefront API

sheena7
Visitor
1 0 0

Hello Shopify Community,

I'm currently developing a custom checkout experience using the Storefront API and have encountered a challenge. Despite successfully creating carts and associating them with user identities (including delivery address preferences), the delivery address fields are not being pre-populated on the generated checkout page.

Here's a brief overview of my process:

  1. I create a cart using the  cartCreate mutation.
  2. I update the buyer identity with the cartBuyerIdentityUpdate mutation, including deliveryAddressPreferences.
    The checkout URL is generated correctly, but when navigating to this URL, the delivery address sections remain unfilled. I'm looking for guidance on how to ensure these fields are automatically populated with the information provided via the API.

Here's a snippet of my cartBuyerIdentityUpdate mutation for reference:

mutation {
cartBuyerIdentityUpdate(cartId: "cart_id", buyerIdentity: {
email: "user_email",
phone: "user_phone",
countryCode: "user_country_code",
deliveryAddressPreferences: [{
deliveryAddress: {
address1: "user_address1",
city: "user_city",
province: "user_province",
country: "user_country",
zip: "user_zip"
}
}]
}) {
cart {
checkoutUrl
}
}
}
Reply 1 (1)

thegreatone99
Shopify Partner
3 0 4

Hey, any luck with this? I am running into the same thing