Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

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
}
}
}
Replies 0 (0)