Store your own data on a payment, such as an order ID, in metadata. It comes back on the payment and in every event about it, so your webhook handler has what it needs.
Limits
- Up to 20 keys.
- Keys of up to 40 characters, using only letters, digits,
_,.and-. - String values of up to 500 characters.
Update and filter
PATCH /payments/{id}merges by key. Set a key to an empty string ornullto remove it, or send"metadata": nullto clear them all.- Filter lists by it, such as
GET /payments?metadata[order_id]=1042.
Next steps
Update metadata
curl -X PATCH "https://api.402pay.co/api/v1/payments/pmt_QI02vLdJGd48hBbg" \ -H "Authorization: Bearer $PAY402_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadata": { "plan": "pro", "seats": "5", "coupon": "" } }'