Metadata
Mandates and parties have a metadata object for your own use: your order id, your customer id, a project code. It round-trips through the API, events and exports.
Rules#
- At most 50 keys.
- A key matches
^[A-Za-z0-9_-]{1,40}$and never starts withholdyn_. Dots are not allowed; useorder_id, notorder.id. - A value is a string of at most 500 characters.
- A broken rule answers
400 metadata_invalidwithparam. - In a
PATCH, keys you send are merged into the existing object. A key set tonullis deleted.
json
{ "metadata": { "order_id": "ord_1001", "region": "west", "old_key": null } }What metadata does not do#
Metadata is never read by the release gate and never copied into Stripe. It cannot change what a release needs. Store anything that should change behaviour in the terms or the settings instead.
References#
external_reference is a separate field for one id that must be unique: per tenant and mode on mandates, and per tenant, mode and kind on parties. A duplicate answers 409 external_reference_in_use and names the existing object, which makes it a good key for "create or find" logic. To clear it, send null.
