#jzills-unset-address

1 messages ยท Page 1 of 1 (latest)

torpid compass
#

Hi there ๐Ÿ‘‹ do you happen to have a request ID from a request where you saw this behavior?

lethal canyon
#

I will generate one give me a second - thanks @torpid compass !

#

req_KWf0uMFTLrEIL5

torpid compass
#

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.

lethal canyon
#

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.

torpid compass
#

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?

lethal canyon
#

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

torpid compass
#

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.

lethal canyon
#

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?

torpid compass
#

Doing some testing on my end, can you share the ID of that invoice?

lethal canyon
#

in_1KoYbkGlQRIgvmTkhR2OXyUG

#

Thank you - I appreciate your help

torpid compass
#

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)

lethal canyon
#

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.

torpid compass
#

Oh, that's an interesting idea. ๐Ÿค”

lethal canyon
#

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.

torpid compass
#

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"=

lethal canyon
#

Perfect - of course I didn't try putting nothing in the value field ๐Ÿ˜„

#

Thanks a lot for your help!

torpid compass
#

Any time! Thanks for your patience while we worked through it.

lethal canyon
#

Not a problem - take care!

torpid compass
#

You too ๐Ÿ‘‹