#jzills-unset-address
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ do you happen to have a request ID from a request where you saw this behavior?
I will generate one give me a second - thanks @torpid compass !
req_KWf0uMFTLrEIL5
So on our end I'm seeing an address being included, but I think the SDK may be doing that if you're passing a null value for that request.
I think for unsetting you'll want to use an empty string rather null.
The SDK uses a ShippingOptions object though. I won't be able to set that to a string?
Do I need to pass a ShippingOptions object with all null values instead?
I am setting the "Shipping" property (ShippingOption object) to null directly.
Good point, that field is an object rather than a single parameter. Yeah, can you try creating a ShippingOptions object with all empty strings and pass that to the customer?
Yes I'll try that now...one minute
As an aside while I boot this up...there isn't a way to set that toggle Shipping as the same as Billing in the SDK, is there?
req_jGo7lu5aZEldGm
Correct, there is not a parameter to automatically make the Shipping address match the Billing address.
And it looks like that request did unset (replaced them with empty strings) all the values for the shipping address fields.
It looks like it did remove the fields when I generate a preview Invoice however the Ship to still shows up with the name and phont number of the Customer.
I'd like to remove the Ship to entirely because I will set those to empty strings when they match in our system.
If they differ I'll have the 2 addresses like normal.
When I fetch that customer in the CLI, the shipping node as empty strings for everything including name and phone so I'm not sure why it is showing up in the Invoice PDF?
Doing some testing on my end, can you share the ID of that invoice?
So far in my testing i haven't been able to full unset the shipping parameter on a customer (disclaimer, I'm testing in Python)
Yeah the only way I was able to was through the Stripe CLI.
Is there an http request that will allow it? I don't mind making a manual request if it gets me this functionality but I can't figure out the right key/value for the server to accept it.
Oh, that's an interesting idea. ๐ค
I tried posting with shipping[address] with values "", {}, null and none of them worked.
I also tried with the key "shipping" with the same values and it didn't work either.
I was able to do it by passing nothing for shipping, here is the curl call I used:
curl https://api.stripe.com/v1/customers/cus_LVZroypR2RWkdl -u sk_test_XXX: -d "shipping"=
Perfect - of course I didn't try putting nothing in the value field ๐
Thanks a lot for your help!
Any time! Thanks for your patience while we worked through it.
Not a problem - take care!
You too ๐