#demisel-checkout-taxid

1 messages ยท Page 1 of 1 (latest)

raven havenBOT
thorny panther
tawny sierra
#

Sure : req_ecuM28EC4j6aOo

thorny panther
#

And do you have an example of an API call with the same parameters that worked?

tawny sierra
#

yes, here is one from another dev's local environment :
req_3AvGrZ4Vn54wNg
Actually has even less entries in customer_update, but I have already tried that, and doesn't fix the issue (would be even stranger if it did ๐Ÿ˜„ )

#

Another one that went ok from the sandbox environment req_VpanYVClbHQuuj

#

At some point we wondered if may be due to my environment not getting webhooks, but the issue keeps happening even with webhooks setup (and successfully answered)

thorny panther
#

This request is not attempting to collect tax ID information

#

What happens if you leave that out of your request

tawny sierra
#

We actually want to optionnaly collect a tax id if the user ticks the box that says they are a company, but sure I can try by remove that

#

So indeed the requests works fine by removing

.setTaxIdCollection(
                        SessionCreateParams.TaxIdCollection.builder()
                        .setEnabled(true)
                        .build())
                        .setCustomerUpdate(
                        SessionCreateParams.CustomerUpdate.builder()
                        .setName(Name.AUTO)
                        .build())

But we'd like to leave this on

thorny panther
#

Wait, I totally missed it. The answer is in the error

tawny sierra
#

Ah yes I know what you're going to say

thorny panther
#

If you don't want to collect the customer address then you can't get the tax ID

tawny sierra
#

But let me enable the address update again; the error will be raised anyway, wait a bit

#

Trying that again :

.setTaxIdCollection(
                            SessionCreateParams.TaxIdCollection.builder()
                                    .setEnabled(true)
                                    .build())
                    .setCustomerUpdate(
                            SessionCreateParams.CustomerUpdate.builder()
                                    .setName(Name.AUTO)
                                    .setAddress(Address.AUTO)
                                    .setShipping(Shipping.AUTO)
                                    .build())
#

There : req_lqI8m13t3TAZ6aerror 400 with the same error message :

We could not find a valid address on the provided customer. To enable tax ID collection, please set customer_update[address] to auto.

Although the body contains :

  "customer_update": {
    "name": "auto",
    "address": "auto",
    "shipping": "auto"
  },
#

Just tried adding

  "billing_address_collection": "auto",

Got the same result, error 400 with the error talking about customer_update[address]

thorny panther
#

Hmmm ... ๐Ÿค”

tawny sierra
#

And again, those exact same requests work when called from other dev environments

thorny panther
#

The previous requests you shared were different between "your" request and other requests. Are you certain those requests are exactly the same?

tawny sierra
#

Yes that is true they are not exactly the same, the line_items and callback urls are different. It doesn't feel like that should have an effect though

thorny panther
#

Are they also requesting tax ID collection?

tawny sierra
#

Yes, req_3AvGrZ4Vn54wNgfor instance

#

Same API Version, only different client ip, line items and callback urls

thorny panther
#

This customer has a completed address though

tawny sierra
#

I'll try again with a valid address, but afair providing an already valid address didn't solve the issue

#

Alright @thorny panther you solved it !
Our backend code put the locale instead of the country in the address, which failed because I was in the enlocale. The other developper got it to work by being on the frlocale, which appears to resolve to a valid address

#

Thanks for your help !

thorny panther
#

Great ๐ŸŽ‰ I'm happy we got that resolved ๐Ÿ™‚

#

To be fair, you're the one who did all the digging so don't forget to pat yourself on the back too

tawny sierra
#

Maybe something could be changed about the documentation ? I was expecting the API to accept an invalid address and allow updating it through customer_update[address] = auto

raven havenBOT
thorny panther
#

That is a good suggestion and I will raise it internally