Skip to content
Docs menu

Endpoints

Metadata

Attach your own key-value data to payments and filter by it.

Attach your own data to a payment with metadata: up to 20 keys of up to 40 characters, with string values up to 500 characters. Keys use only letters, digits, _, . and -.

  • PATCH /payments/{id} merges by key. Set a key to an empty string or null to remove it, or send "metadata": null to clear them all.
  • Filter lists by it, such as GET /payments?metadata[order_id]=1042.
  • It comes back on the payment and in every event about it, so your webhook handler has what it needs.
Update metadata
curl -X PATCH "https://dash.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": ""    }  }'