Metadata Limits

Using metadata, you are able to associate custom values with most of Stripes objects using in the Dashboard and via the API. Metadata can be viewed on an object as a group of key and value pairs:

{
"customer_name": "John Doe",
"internal_customer_id": "1231235555",
"phone_number": "555-111-555"
}

In this example, the metadata contains three pairs, with the key on the left and the corresponding value on the right. As you can see, metadata is useful to store all different types of data that may be relevant to the object or to your business.

Limits Associated with Metadata

  • Metadata only accepts strings for both keys and values
  • You can have up to 50 keys
  • Keys can only contain up to 40 characters
  • Values can contain up to 500 characters long

What if I need more than 50 metadata keys?

If you need more than 50 metadata keys, it is recommended to store multiple information under one key. Since the value can be anything, you can store the information as structured data, potentially using JSON that you serialize to a string.

For example, here’s where you can store the shipping details but using just one key.

{
’shipping_address’: ’{"line1":"18th street","city":"San Francisco","zip":"94110","state":"CA","country":"US"}’
}

Did this answer your question?
We use cookies to improve your experience and for marketing. Read our cookie policy or manage cookies.