Discussing APIs and development related to customers, discounts, and order management.
I have mentioned pass the shipping_address in draftOrder API but when I open the invoice url Shopify checkout is not pre filled with the shipping address passed to the API.
The shipping_address is present in the JSON response of draftOrder API.
When I use cart permalinks to preload cart with shipping address, it automatically prefilled in the checkout page.
draftOrder doesn't have a shipping address prefill option?
Am I missing anything?
On trial and error, what I noticed in I am not passing province and country code to shipping_address field. That may be the issue.
Because i added province and country to the shipping address in same draft order created via api and it works. Customer address is prefilled.
BTW, My app enable customer to enter address in our address form and we are passing it to draft order.
So how can we present list of countries and its provinces in our form like in shopify checkout?
Thanks in advance
@captainzero We are using https://github.com/Shopify/quilt/tree/master/packages/address . It's shopify's recommended way of showing Country+Province fields for your address form.
I would recommend you check out their entire "quilt" repository. Its a set of loosely related packages, with very handy things in between.
That's definitely will help us to overcome our challenge.
Thanks a ton.
Lots of love
@tolgapaksoy I look into the package now, Unfortunately it only formats address what we need is the data of countries and its provinces to show to the customer
Any ideas are welcome.
Thanks in advance
Hi @captainzero
We do use this package to fetch supported countries, and their provinces (if required by Shopify).
It's all in this file: https://github.com/Shopify/quilt/blob/master/packages/address/src/loader.ts
Hey,
On trial and error, what I noticed in I am not passing province and country code to shipping_address field. That may be the issue.
Because i added province and country to the shipping address in same draft order created via api and it works. Customer address is prefilled.
I'm stuck with this same issue. The draft order API returns an invoice_url where I want the shipping address to be pre-populated.
The address isn't getting pre-populated there. How did you do this?
This is my API request body:
I am experiencing the same issue
So, through testing I have discovered that passing the long country name in the "country" element for the draft order will result in the desired outcome of having the shipping address pre-populated automatically when clicking through to the checkout page. Example: "country": "United States"