#j_r_e

1 messages ยท Page 1 of 1 (latest)

ornate copperBOT
spark turret
#

HI Hanzo, I'm creating a Subscription on my Java Backend but every invoices generated are in English, I would like to change by end customer's preferred language (most of the time French)

mystic vessel
spark turret
#

I tried preferredLocale but no effect:

#
                CustomerCreateParams.builder()
                    .setEmail(signupUser.getEmail())
                    .setName(signupUser.getNom())
                    .addPreferredLocale(signupUser.getLanguage())
                    .setShipping(
                    CustomerCreateParams.Shipping.builder()
                        .setAddress(
                        CustomerCreateParams.Shipping.Address.builder()
                            .setCity(signupUser.getVille())
                            .setCountry(signupUser.getLanguage())
                            .setLine1(signupUser.getAdresse())
                            .setPostalCode(signupUser.getCp())
                            .setState("")
                            .build()
                        )
                        .setName(createdSubscription.getNom())
                        .build()
                    )
                    .setAddress(
                CustomerCreateParams.Address.builder()
                        .setCity(signupUser.getVille())
                        .setCountry(signupUser.getLanguage())
                        .setLine1(signupUser.getAdresse())
                        .setPostalCode(signupUser.getCp())
                        .setState("")
                        .build()
                    )
                    .build();

                Customer customer = Customer.create(params);```
#

but I do not see any way to set the Preferred Language, only the locale

mystic vessel
#

Updating the customer after the invoice has been generated won't retroactivelly update the invoice.
The changes will apply when the next invoice is generated.

Can you create a new invoice for the customer after updating the locale?

spark turret
#

but since the beginning the Locale is set to FR

#

and every invoices are in EN

mystic vessel
#

Can you share an example customer ID and the invoice?

spark turret
#

yes

#

in_1NpB9uGwS6hWApc4oMYGu4a2

#

cus_OcPvi9d4FTt2Fq

#

I can change the Language of the Customer on the Dashboard but I would need to do it programmatically

#

but though API, they mention preferred_locales but I do not see how to do it

mystic vessel
spark turret
#

sorry preferred locale is set correctly

#
                CustomerCreateParams.builder()
                    .setEmail(signupUser.getEmail())
                    .setName(signupUser.getNom())
                    .addPreferredLocale(signupUser.getLanguage())```
#

but there is no effect on the language

mystic vessel
spark turret
#

hum...it seems it shall be fr but i set FR may be this is the reason why it doesn't work

mystic vessel
#

Try changing it

spark turret
#

I did

#

and I was right

#

language shall be set in lowercase

mystic vessel
#

Great, did that create the invoice in preferred locale too?

spark turret
#

yes

#

๐Ÿ˜‰

#

finally !

#

that was a simple one !