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.
You can add metadata when creating or updating objects through the API. For products, you also have the option to add metadata directly from the dashboard UI.
For products, you can also add metadata directly from the Dodo Payments dashboard when creating or editing a product. The metadata section allows you to easily add custom key-value pairs without writing code.
Using the dashboard UI for product metadata is particularly useful for non-technical team members who need to manage product information and categories.
Metadata is included in webhook events, making it easy to handle notifications with your custom data:
Copy
// Example webhook handlerapp.post('/webhook', (req, res) => { const event = req.body; if (event.type === 'payment.succeeded') { const orderId = event.data.object.metadata.order_id; // Process order using your internal order ID }});