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.
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"}’
}