#ripitried
1 messages · Page 1 of 1 (latest)
Hello! You can create a Customer without any details at all. Happy to take a look at your request IDs!
req_Z7CdaEnLNhUdfO
req_o2S1H1cpQwpCzc
Here are 2, its showing that "address" is required
// user might not have addressInfo
let address: AddressInfo = undefined;
if (user.addressInfo) address = user.addressInfo;
const fullName = `${user.firstName?.trim()} ${user.lastName?.trim()}`;
const params: Stripe.CustomerCreateParams | Stripe.CustomerUpdateParams = {
name: fullName,
email: user.emailAddr || '',
phone: user.phoneNumber || '',
shipping: {
name: fullName,
address,
},
metadata: {
uid: user.uid,
},
};
Here is the code snippet that I believe we are creating the customer from
Ah, if you specify shipping information you must supply a full address. You can't just supply a name. You can omit the shipping property entirely though.
Ah okay so if I do not have the shipping address yet i need to skip providing the shipping property
Yep. You can see here shipping is optional, but if you supply it both name and address are required: https://stripe.com/docs/api/customers/create#create_customer-shipping
Ah great
alright thanks!
So if i just conditionally omit the shipping when I do not have the address but all other fields persist the customer creation should be ok right?
Yep!