API Documentation & SDKs
Metadata Guide
Learn how to use metadata to store additional information about your Dodo Payments objects
Introduction
Metadata allows you to store additional, structured information about your objects in Dodo Payments. You can attach metadata to most Dodo Payments objects, including payments, subscriptions, and more.
Overview
- Metadata keys can be up to 40 characters long
- Metadata values can be up to 500 characters long
- You can have up to 50 metadata key-value pairs per object
- Keys should only contain alphanumeric characters, dashes, and underscores
- Metadata is not searchable using our API but is returned in API responses and webhooks
Use Cases
Metadata is useful for:
- Storing external IDs or references
- Adding internal annotations
- Linking Dodo Payments objects to your system
- Categorizing transactions
- Adding custom attributes for reporting
Adding Metadata
You can add metadata when creating or updating objects:
Retrieving Metadata
Metadata is included in API responses when retrieving objects:
Searching and Filtering
While metadata is not directly searchable via our API, you can:
- Store important identifiers in metadata
- Retrieve objects using their primary IDs
- Filter the results in your application code
Best Practices
Do:
- Use consistent naming conventions for metadata keys
- Document your metadata schema internally
- Keep values short and meaningful
- Use metadata for static data only
- Consider using prefixes for different systems (e.g.,
crm_id
,inventory_sku
)
Don’t:
- Store sensitive data in metadata
- Use metadata for frequently changing values
- Rely on metadata for critical business logic
- Store duplicate information that’s available elsewhere in the object
- Use special characters in metadata keys
Supported Objects
Metadata is supported on the following objects:
Object Type | Support |
---|---|
Payments | ✓ |
Subscriptions | ✓ |
Webhooks and Metadata
Metadata is included in webhook events, making it easy to handle notifications with your custom data: