/add-card Failure
# support
l
I am getting a 400 from https://api.vapi.ai/stripe/add-card with the error response:
Couldn't Create Customer. Stripe Error: Metadata values can have up to 500 characters, but you passed in a value that is 512 characters.
Need to update payment!
v
Hi there! I see you're getting a 400 error from the Stripe API when trying to add a card. This is happening because one of your metadata values exceeds Stripe's character limit of 500 characters (you're passing 512 characters). Here's how to fix this issue: 1. Adjust your metadata value to ensure it doesn't exceed 500 characters. You'll need to truncate the value that's currently 512 characters to fit within this limit [source](https://stripe.com/docs/api). 2. **Example solution**: If you're using code to add the card, you could implement something like:
Copy code
javascript
// Example of truncating metadata before sending
if (metadata.key.length > 500) {
    metadata.key = metadata.key.substring(0, 500);  // Truncate to 500 characters
}
**Best practices for managing metadata**: * Keep metadata descriptions concise * Use consistent formats for dates and values * Consider using structured JSON for complex metadata * Avoid redundancy in your metadata fields * Test your implementation thoroughly Once you've adjusted your metadata to comply with the 500-character limit, you should be able to successfully update your payment information. I hope this helps! Let me know if you have any other questions. 😊 Source: - [Stripe API error regarding metadata character limits](https://stripe.com/docs/api)
l
@Shubham Bajaj both card and link methods not working
Stripe has a hard cap on metadata so there's something on my user/org that is causing an issue
@User
Can anyone please resolve this? I have been trying to spend money on this platform and am unable to
@Shubham Bajaj can you help me with this
@Mason can you help with this?
k
Hey, could you please provide me your org ID and I'll escalate this for you.
l
this is happening across all orgs on my account but I at least need these two handled: 03ce2577-e070-4965-976f-6b865e774daa 489a7120-163c-4a4b-a750-82042e17aaa3
@Mason any word here?
@Shubham Bajaj
s
@LBThree is it resolved? If not can you send me a screenrecording and make sure to hide sensitive data.
l
No its still occuring
Same error message, I can take a video if you need
trying to hide PII
do you want me to send here or directly?
@Sahil
s
send me directly to dm
l
sent