title: Shopify - prepopulate billing address based on query param
body: <p>I am trying to prepopulate the shipping/billing address in Shopify checkout via URL query params. I've found this is easy to do with the shipping address as referenced here:</p>
  <p><a href="https://community.shopify.com/c/Shopify-APIs-SDKs/Autofill-checkout-fields/td-p/318793" rel="nofollow noreferrer">https://community.shopify.com/c/Shopify-APIs-SDKs/Autofill-checkout-fields/td-p/318793</a></p>
  <p>But when I try to do the same with the billing info, the &quot;Same as shipping address&quot; radio is always selected on the payment screen and if I manually select the option for a different address, all values are blank</p>
  <p>How can I prepopulate both addresses? I've tried adding the billing query params directly to the checkout payment page URL, but that does not work either. Here is the URL I've been trying:</p>
  <pre><code>demo-store.myshopify.com/checkout?checkout[email]=fake.name@gmail.com&amp;checkout[shipping_address][first_name]=John&amp;checkout[shipping_address][last_name]=Doe&amp;checkout[shipping_address][address1]=333%20Fake%20St.&amp;checkout[shipping_address][city]=San%20Diego&amp;checkout[shipping_address][province]=CA&amp;checkout[shipping_address][country]=USA&amp;checkout[shipping_address][zip]=92116&amp;checkout[shipping_address][phone]=333-333-3333&amp;checkout[different_billing_address]=true&amp;checkout[billing_address][first_name]=Jane&amp;checkout[billing_address][last_name]=Doe&amp;checkout[billing_address][address1]=444%20Fake%20St%20&amp;checkout[billing_address][city]=San%20Diego&amp;checkout[billing_address][province]=CA&amp;checkout[billing_address][country]=USA&amp;checkout[billing_address][zip]=92121&amp;checkout[billing_address][phone]=444-444-4444
  </code></pre>
  <p>Also, bonus question, the shipping state always seems to be populated based on IP address, so even if I pass it a value, it shows the state I'm in. How can I get it to always reflect the value of the query param?</p>