#yumemi_api
1 messages · Page 1 of 1 (latest)
👋 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.
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:
- Delete tax ID: https://docs.stripe.com/api/tax_ids/customer_delete
- Create tax ID: https://docs.stripe.com/api/tax_ids/customer_create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you, I'm going to try it now👍
No problem!
Could you help me to understand where you see tax_id_data from in Customer.modify()? I don't see it in stripe-python v9.3.0 from the request you made: https://github.com/stripe/stripe-python/blob/v9.3.0/stripe/_customer.py#L944-L1025
Updating / modifying customer API doesn't support changing tax_id_data and the SDK seems to align with the spec as per my checking
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?
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 thetax_id_data. I'd recommend checking API spec to check what fields can be updated here: https://docs.stripe.com/api/customers/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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!☺️