#yumemi_api

1 messages · Page 1 of 1 (latest)

raven cloudBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1339136059535261747

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

soft bone
#

This is likely the mismatch of API and the SDK if you're able to modify tax_id_data. To update the tax_id_data, this API can be used:

grizzled scarab
#

Thank you, I'm going to try it now👍

soft bone
#

No problem!

#

Updating / modifying customer API doesn't support changing tax_id_data and the SDK seems to align with the spec as per my checking

grizzled scarab
#

What I meant was that I saw "This request accepts mostly the same arguments as the customer creation call" in the documentation. After comparing, I noticed that there isn't a tax_data_id key, so I thought that the tax data for an existing customer couldn’t be modified. I tried the method you provided, and it resolved the issue with updating the tax information. Here's my implementation:

`if tax_dict:
update_dict.pop('tax_id_data', None)
tax_dict = {
'type': tax_type,
'value': tax_id
}
tax_ids = stripe.Customer.list_tax_ids(stripe_id)
for tax_id in tax_ids:
stripe.Customer.delete_tax_id(stripe_id, tax_id)

stripe.Customer.create_tax_id(stripe_id, **tax_dict)

stripe.Customer.modify(stripe_id, **update_dict)`
This seems to be the correct way to modify the customer, right?

soft bone
#

It's expected that tax_id_data can only be set in Create Customers API, but not Update Customers API (modify) as mentioned in the API spec. Looks good to me with your implementation.

#

stripe.Customer.modify(stripe_id, **update_dict)
This seems to be the correct way to modify the customer, right?
Yes, but not for modifying the tax_id_data. I'd recommend checking API spec to check what fields can be updated here: https://docs.stripe.com/api/customers/update

grizzled scarab
#

That's why I removed the tax_id_data part from Customer.modify and instead used an if statement to modify the tax information. Thank you for your help, I really appreciate it!☺️