#sayori-api-error
1 messages ยท Page 1 of 1 (latest)
You passed an empty string for 'invoice_settings[rendering_options]'. We assume empty values are an attempt to unset a parameter; however 'invoice_settings[rendering_options]' cannot be unset. You should remove 'invoice_settings[rendering_options]' from your request or supply a non-empty value
In our original code, we were updating a Customer object with the invoice_settings dictionary, but without the rendering_options field. The API here describes rendering_options as optional, see: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
(sorry, got the details wrong in the original message)
In the end we fixed this issue by passing "rendering_options": {}, as part of the invoice_settings dictionary, but it's very weird that we suddenly started running into this issue when no changes were made on our end to our Stripe API code. Do you know if anything changed on the backend?
Do you have the request ID for the request that errored out?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Let me pull one up
Sorry, still searching - quite noisy in the logs down there, and I don't have a full error response (just the snippet earlier)
No worries!
Can't find any so I'm going to spin up an env in the old code and try to replicate
That error is odd if you were able to create these with empty strings before. Our docs say that it's supposed to take an empty object. Do you have a request in your log that shows it was successful before when you were passing an empty string?
Okay, finally caught one that I just ran on old code: req_6kJueIywCqW2kR
Looking at POST data, it says the body is ``` "invoice_settings": {
"default_payment_method": "pm_1LAdzmGQ5L54VFKVS4DmfVUX",
"custom_fields": "",
"footer": "",
"rendering_options": ""
}
but it looks like those empty strings are all default values here
because the only value I'm passing from the backend is default_payment_method. It looks like this is working fine now for some reason
Meanwhile, here's a request running on the updated code: req_Uue08sDYQcE3Vi
this one has POST data that says
"invoice_settings": {
"default_payment_method": "pm_1LAduDGQ5L54VFKViahoLHmd",
"custom_fields": "",
"footer": ""
}
}```
note the absence of `rendering_options` now (maybe because we pass in an empty dictionary now?)
For the record, this log is how we discovered something went wrong - our general signups dropped to near-zero in that afternoon
Found a request from further back (06/02) that definitely had the old code, where we were only passing invoice_settings[default_payment_method]: req_x2QZdk7pmZhbxf
Finally found the gold for you! Here's a request on 06/09 with the error I pasted earlier: req_nJxriy4Z8iSeG4
Double checked with git log that the file making this API call was not changed since 05/10, other than to fix this issue
That's incredibly odd, because passing in an empty string works just fine now. I assume a deploy got rolled back after the product team noticed an increase in error rates, but I can't confirm that in real time.
That makes the most sense here
I can check with them if you want, but I'll have to update you async via an email thread. If that's of interest to you, can you open a support email thread and mention my Discord handle (two-shoes)?
Sounds good! I'll go ahead and do that, thanks ๐
Sure thing!