Discussing APIs and development related to customers, discounts, and order management.
Hi,
Please let me know if there is a better discussion area to ask this question 🙂
I have a store where we sell a digital product so we don't collect a shipping address on the checkout page. We also have an app we use to receive and update information for the order, including adding tags and note attributes to it.
Everything was working fine until we recently started using a newer API version (2023-04). Until now we were using a version that was a few years old. Now, when we try and do something like add a note attribute to an order we get the following error:
Response(code=400, body="b'{"errors":{"shipping_address":"Required parameter missing or invalid"}}'"
In our app (written in Python) we make a session with the following code:
session = getShopifySession() // this returns our store URL with our API information
shopify.ShopifyResource.activate_session(session)
Then we create an order object with:
order = shopify.Order.find(ORDER_ID)
The error happens when we update the order with order.save()
This only happens when we try to update an order and not when we retrieve information about it.
Hello @Santa,
We are seeing a similar issue on our Shopify integration. Did you get the issue resolved or any response (I see none here)?
Hi @tregister,
I did open a support ticket and got a response there. While I never got a reason for the need to have a shipping address now, I do have a simple work around. We're just setting the shipping address to equal the billing address if it doesn't already have a shipping address. ie:
`if order.shipping_address == None:
order.shipping_address = order.billing_address`
Maybe something like that would work for you?
Hi @Santa,
Amazingly swift reply!
Unfortunately, the billing address is usually derived from the shipping address, so no luck there.
Thanks for trying to help. 👍
Hi @tregister,
My pleasure 🙂
Ah, sorry to hear that. Maybe open a ticket and see if a developer can point you in the right direction?
For anyone facing the same problem, assigning the following object as the shipping address and billing address fixes the issue.
{
address1: nil,
city: nil,
company: nil,
country: nil,
country_code: nil,
first_name: nil,
last_name: nil,
name: nil,
phone: nil,
province: nil,
province_code: nil,
zip: nil
}
Above code is in Ruby