top of page

How to add metadata to Stripe objects




Using the metadata parameter in Stripe objects offers a great opportunity to create customized, relevant experiences for your customers. Metadata can reference other databases, or store data such as product descriptions, discount codes or virtually anything relevant to your customer experience. Metadata can be added to defined Stripe objects such as a Charge, Account, Customer, Refund, Subscription or a Transfer and you may use up to 50 keys and values up to 500 characters, just note that it is not recommended to use it for sensitive information such as bank account numbers etc.


Here is a guide about how to get started with metadata in Stripe.


#1 - Manually enter metadata in the Stripe dashboard

Login to your Stripe account. Choose an object to which you want to add your metadata (here we are adding data to a Charge object) and simply add the information directly. This works well if you have few customers, but clearly takes a lot of time, and doesn't scale very well.


#2 - Add metadata with code

You can add metadata to Stripe objects using the Stripe API by including the metadata as an additional parameter when creating or updating the object.


The Stripe developers' channel on youtube provides great guidance for adding metadata using code, including php, java, node, .net, ruby and python. Using the Stripe API to sync metadata is of course the most flexible way, but it requires coding skills.



#3 - Add metadata through plugins & partners

You can use Stripe plugins like Stripe Elements, Checkout, etc. that allow you to add metadata to Stripe objects by including the metadata as an additional parameter when creating or updating the object.


In case you are looking to populate metadata fields in Stripe through your CRM system, your ERP, or similar software, many of the well-known vendors have Stripe integrations.


Have a look among the Stripe Partners to see if they have built integrations covering your specific use case. For example, you can sync records between Salesforce and Stripe using a connector where you can map to default fields or your own customized metadata fields. There are several other integrations including one commonly used for Hubspot.



#4 - Add metadata using webhooks

Webhooks are one way that apps can send automated messages or information to other apps, normally if a specific event happens. An example is that Stripe can tell your CRM or accounting system that a Charge was successful using Webhooks. This method does require coding skills, and ideally some experience with Webhooks.


If your application is already connected to your Stripe account via the API keys, you can head over to Stripe's dashboard > API > Webhooks where you can add URL endpoints under both the live and test modes.


Get Paperplain - use metadata to enrich receipts, invoices and other documents

Head over to Paperplain and sign up for access to our Stripe app. Whether you are a developer, founder, accountant or designer doesn't matter. Anyone can customize and build relevant and beautiful templates, with all data fields available in Stripe, including metadata.


94 views0 comments

Comentarios


bottom of page