Metadata

metadata is a JSON object of your own keys and values that HL Hunt stores on a resource and returns to you unchanged. Use it to carry your order id, CRM id or any correlation data.

Which resources accept it

ResourceAccepted onReturned byCarried in webhooks
ChargePOST /v1/chargesGET /v1/charges/{id}charge.succeeded, charge.failed (always; metadata is part of the charge object, {} when none)
CustomerPOST /v1/customers, PUT /v1/customers/{id} (replaces)GET /v1/customers/{id}customer.created, customer.updated
Checkout SessionPOST /v1/checkout/sessionssession objectcheckout.session.completed, checkout.session.expired; also copied onto the resulting charge
SubscriptionPOST /v1/subscriptions, PUT /v1/subscriptions/{id}subscription objectsubscription.*
ProductPOST /v1/products, PUT /v1/products/{id}product objectproduct.created
Payment ArrangementPOST /v1/arrangementsarrangement objectarrangement.*

Refunds, payment methods, payouts and webhook endpoints do not take metadata.

Rules the code applies

  • Any JSON object is accepted; values may be strings, numbers, booleans, nested objects or arrays. The validators do not enforce a key count or a size limit, and nothing truncates values. The only bound is the request body size. Keep it small (a few short keys) so webhook payloads stay small.
  • Keys are stored exactly as sent. Webhook payloads convert resource field names to snake_case, but keys inside metadata are passed through untouched.
  • Charges: HL Hunt adds nothing to your metadata in the stored copy. After an ACH return the charge's metadata gains a bankReturn object (see ACH & bank accounts). Reserve that key.
  • Checkout Sessions: keys beginning with _ are reserved for HL Hunt and are stripped from the public session object and webhooks. When the session is paid, the remaining keys are copied onto the charge with every value converted to a string (objects are JSON-encoded).
  • Customers: PUT with metadata replaces the whole object; it is not merged.
  • tags is not a request field. Older pages showed a tags object on POST /v1/charges; the handler ignores it. Use metadata.