FROM CACHE - en_header

order/updated webhook payload does not have the updated shipping_address

wynd
New Member
14 0 0

There is a shop that has "Shipping Address Verification" app installed. I have registered to order/updated event and listen to order changes on this shop.

When the shipping address of an order is corrected by "Shipping Address Verification" app (e.g. address2 changes from null to "Apt 104"), the order/updated webhook payload does not have this change in the shipping_address, while the actual order on Shopify shows this change on the web UI of the Shop.

This is important because we are a shipping company and when the address changes are not reflected on our backend, goods are mailed to the wrong address!

Could this be a bug in Shopify backend? Can someone from Shopify please help us with this?

Thank you so much.

 

Replies 14 (14)
wynd
New Member
14 0 0
Kevin_A
Shopify Staff
Shopify Staff
318 42 60

Hey @wynd 

I just tested this and I saw the updated address 2 line in the order update webhook. Can you post the request/response of the address update API request, and then also the body of the webhook that you receive? Additionally, it may be helpful if you can send me the request_id from the API response headers so I can see it in our logs. 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

wynd
New Member
14 0 0

Can you post the request/response of the address update API request, and then also the body of the webhook that you receive?

The address update is made by a shopify app that I do not have access to. ("Shipping Address Verification" app)

Our app, wynd, has registered for orders/updated events on the shop and we expect to get the changes made to the order (and the order address) in the payload of the webhook.


Additionally, it may be helpful if you can send me the request_id from the API response headers so I can see it in our logs.

I was not sure which request_id you were referring to so I am including the headers of the webhook payload:

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:54a1659c-e2ef-48fc-bcc6-81fa1421241d' \
--header 'Content-Length:6492' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1597200352378' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2637058834592' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:onmh/JydQPENnbIcVijNHYKQsIpfEVtiWu/YoOcEjzQ=' \
--header 'X-Shopify-Shop-Domain:xxxsomeshopxxx.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:1' \
--header 'Content-Type:application/json' \
--data '{contains customer data that I cannot share on the forum}'

The shipping_address of the webhook payload (anonymized):

"shipping_address": {
"first_name": "xxx",
"address1": "xxx xxxxx Lane",
"phone": "(xxx) xxx-xxxx",
"city": "State College",
"zip": "168xx",
"province": "Pennsylvania",
"country": "United States",
"last_name": "xxx",
"address2": "", <=== EMPTY AFTER UPDATE!
"company": "",
"latitude": xxx,
"longitude": xxx,
"name": "xxx xxx",
"country_code": "US",
"province_code": "PA"
},

The changes to order reflected on the shop's dashboard:

Screen Shot 2020-08-13 at 15.21.09 .png

Please let me know if there is any other information I can provide to help resolve the issue.

Thanks a lot for taking the time to look into this.

wynd
New Member
14 0 0

Hi Kevin, thanks for looking into this. I responded with all the details but the forum's spam detection tool thought it's spam and didn't allow my reply be posted.

 

I also reached out to the forum admins, twice, but I didn't hear back or see my reply being posted here.

 

Do you have the means to remove the spam flag so my previous post can appear on the forum?

wynd
New Member
14 0 0

@Kevin_AIt seems a forum admin allowed the post I mentioned earlier.

Can you please take a look? Thanks.

wynd
New Member
14 0 0
Kevin_A
Shopify Staff
Shopify Staff
318 42 60

Hey @wynd 

Do you have a more recent order example of this happening? Unfortunately the order information you posted above is outside our logging window. 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

wynd
New Member
14 0 0

@Kevin_AHere is a more recent example of an order with this issue:

Headers of the webhook payload:

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:e28bdb1d-76cb-4c9f-b7a2-efbbf6b122af' \
--header 'Content-Length:6236' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1600475815389' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2735525789856' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:pTqOIcbLx0B+ofI1XvSAtfAsRqN63KsLTu9czSxYpbQ=' \
--header 'X-Shopify-Shop-Domain:XXXX-shop.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:1' \
--header 'Content-Type:application/json' \
--data '{contains customer data that I cannot share on the forum}'


The shipping_address of the webhook payload (anonymized):

"shipping_address": {
"first_name": "xxx",
"address1": "xxx Wailea Alanui Dr",
"phone": "+1 xxx-xxx-xxxx",
"city": "Wailea", <============ This did NOT change to "Kihei" (see below screenshot)
"zip": "967xx",
"province": "Hawaii",
"country": "United States",
"last_name": "xxx",
"address2": "Wailea",  <======== This was NOT removed (see below screenshot)
"company": "",
"latitude": xxx,
"longitude": xxx,
"name": "xxxx xxxx",
"country_code": "US",
"province_code": "HI"
}


The changes to order reflected on the shop's dashboard:

Screen Shot 2020-09-21 at 12.27.04 .png

wynd
New Member
14 0 0

@Kevin_A Here is another example of this issue. This one has two incoming webhook requests for update:

Headers of webhook request 1:

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:25b37fed-8248-4563-948b-40a455666b0c' \
--header 'Content-Length:6345' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1600837805310' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2748099166368' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:OPNglAua7mYjoLWLbfDdN8E0rpV1aYQoEZ/ONiqpL/A=' \
--header 'X-Shopify-Shop-Domain:some-shop.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:1' \
--header 'Content-Type:application/json' \
--data '... removed for privacy ...}'

and the shipping_address part of the webhook payload for request 1:

"shipping_address": {
    "first_name": "xxx",
    "address1": "xxx xxx Ave", <===== Did not change
    "phone": "xxxxxxxxxx",
    "city": "Venice",
    "zip": "91xxx", <===== Did not change
    "province": "California",
    "country": "United States",
    "last_name": "xxx",
    "address2": "Unit xxx", <===== Was not removed
    "company": "",
    "latitude": null,
    "longitude": null,
    "name": "xxx xxx",
    "country_code": "US",
    "province_code": "CA"
}

Headers of webhook request 2:

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:a09fa366-446e-4c4e-b8ee-38d807e7d176' \
--header 'Content-Length:6359' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1600837816183' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2748099166368' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:CN36/sCyDQI9smjkwzh+5dSMp+5QcM6oU45CF/OX+PU=' \
--header 'X-Shopify-Shop-Domain:some-shop.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:1' \
--header 'Content-Type:application/json' \
--data '{... removed ...}'

and the shipping_address part of the webhook payload for request 2:

"shipping_address": {
    "first_name": "xxx",
    "address1": "xxx xxx Ave", <== Did not change
    "phone": "xxxxxxxxxx",
    "city": "Venice",
    "zip": "91xxx", <== Did not change
    "province": "California",
    "country": "United States",
    "last_name": "xxx",
    "address2": "Unit xxx", <=== Was not removed
    "company": "",
    "latitude": null,
    "longitude": null,
    "name": "xxx xxx",
    "country_code": "US",
    "province_code": "CA"
}

 

Shopify dashboard screenshot:

Screen Shot 2020-09-24 at 13.00.34 .png

 

 

wynd
New Member
14 0 0

@Kevin_A in case the other examples I sent before are now out of your logging window, I am posting a new one.

This one has two order/update webhook requests:

 

Request 1 (Received On 2020-10-01 11:40:42 pm EDT)

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:6c8527cd-4df4-4bde-a3d3-f099a5e01729' \
--header 'Content-Length:8644' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1601610042134' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2775482302624' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:UedL372YhnBV9NKUL7X0d2OW9zRpzqQxUIr/bj2fIXs=' \
--header 'X-Shopify-Shop-Domain:some-shop.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:1' \
--header 'Content-Type:application/json' \
--data '{ ... redacted ... }'

 

shipping_address part of the payload for Request 1

"shipping_address": {
    "first_name": "xxxx",
    "address1": "12xxx Aneta St",
    "phone": "xxxxxxxxxx",
    "city": "Los Angeles",
    "zip": "900xx",
    "province": "California",
    "country": "United States",
    "last_name": "xxxx",
    "address2": "Aneta St", <=== Was NOT removed!
    "company": null,
    "latitude": xx.xx,
    "longitude": xx.xx,
    "name": "xxxx xxxx",
    "country_code": "US",
    "province_code": "CA"
}

 

Request 2 (Received On 2020-10-01 11:40:29 pm EDT)

--request POST 'https://xxxwynd-domainxxx/shopify/orders/update' \
--header 'X-Shopify-Test:false' \
--header 'X-Request-Id:02b2ed46-d302-4c60-9045-6538eb1a9800' \
--header 'Content-Length:8644' \
--header 'Version:HTTP/1.1' \
--header 'X-Shopify-Api-Version:2020-04' \
--header 'X-Shopify-Topic:orders/updated' \
--header 'User-Agent:Shopify-Captain-Hook' \
--header 'X-Request-Start:1601610029781' \
--header 'Host:xxxwynd-domainxxx' \
--header 'X-Shopify-Order-Id:2775482302624' \
--header 'Accept-Encoding:gzip;q=1.0,deflate;q=0.6,identity;q=0.3' \
--header 'X-Forwarded-Port:443' \
--header 'Total-Route-Time:0' \
--header 'Connection:close' \
--header 'X-Shopify-Hmac-Sha256:UedL372YhnBV9NKUL7X0d2OW9zRpzqQxUIr/bj2fIXs=' \
--header 'X-Shopify-Shop-Domain:some-shop.myshopify.com' \
--header 'Via:1.1 vegur' \
--header 'X-Forwarded-For:xxx.xxx.xxx.xxx' \
--header 'Accept:*/*' \
--header 'X-Forwarded-Proto:https' \
--header 'Connect-Time:0' \
--header 'Content-Type:application/json' \
--data '{ ... redacted ... }'

 

shipping_address part of the payload for Request 2


"shipping_address": {
    "first_name": "xxxx",
    "address1": "12xxx Aneta St",
    "phone": "3107178794",
    "city": "Los Angeles",
    "zip": "900xx",
    "province": "California",
    "country": "United States",
    "last_name": "xxxx",
    "address2": "Aneta St",  <=== Was NOT removed!
    "company": null,
    "latitude": xx.xx,
    "longitude": xx.xx,
    "name": "xxxx xxxx",
    "country_code": "US",
    "province_code": "CA"
}

 

See the changes to address on the shop's Shopify dashboard:

Screen Shot 2020-10-02 at 12.12.34 .png

wynd
New Member
14 0 0
wynd
New Member
14 0 0

Hi, we are still having this issue.

I was able to replicate this problem just today:

  1. Placed an order via Shopify store front of my test shop
  2. The order/create webhook was called and the payload had all the relevant info
  3. I then opened the order on Shopify Dashboard and changed the shipping address. A few seconds later Shopify made a call to order/update webhook and the changes to the shipping address was present in the payload.
  4. 1 minute later, I changed the shipping address on Shopify Dashboard for a 2nd time but this time the order/update webhook was not called. (even after hours)
  5. 20 minutes later I changed the shipping address on Shopify Dashboard for a 3rd time and this time the order/update webhook was called and I got the shipping address change in the payload.

 

Screen Shot 2020-11-12 at 13.21.03 .png

Kevin_A
Shopify Staff
Shopify Staff
318 42 60

Hey @wynd 

It looks like the root of this issue is related to how we deal with duplicate webhooks. There is some work being done to address this behaviour which will hopefully improve situations like this. In the meantime, you may want to consider using the order API to reconcile any webhooks that may have come in at a set time interval (perhaps once a week, or once a day depending on how many events you see per day). 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

wynd
New Member
14 0 0

Polling the Shoppify server for changes made to orders is not an option. We appreciate it if Shopify fixes this bug ASAP. Thank you.