Learn how to use metadata to attach custom information to Straddle objects
Metadata is a powerful feature in Straddle that allows you to attach custom key-value pairs to various objects. This guide will explain how to use metadata effectively, its benefits, and best practices.
Metadata in Straddle is a set of key-value pairs that you can attach to objects such as customers, charges, payouts, and more. It allows you to store additional, structured information that is important for your business but isn’t covered by Straddle’s standard fields.
Metadata is not used by Straddle for any purpose other than storing on the object for your use in the future. It’s purely for your own record-keeping.
Use Consistent Keys: Establish a naming convention for your metadata keys and stick to it.
Keep It Simple: Metadata is best suited for simple key-value pairs. For complex data structures, consider storing a reference ID in metadata and keep the full data in your own database.
Avoid Sensitive Data: Don’t store sensitive information (like credit card numbers or social security numbers) in metadata.
Update Carefully: When updating metadata, be aware that you’re replacing the entire metadata object. To add or modify a single field without affecting others, first retrieve the current metadata, modify it, then update the object with the new metadata.
Use for Searchability: Leverage metadata for fields you’ll want to search or filter by later.
Metadata is a flexible and powerful feature in Straddle that allows you to customize and extend the platform to fit your specific business needs. By following these guidelines and best practices, you can effectively use metadata to enhance your integration with Straddle.For more information on how metadata behaves with specific API endpoints, refer to our API Reference documentation.