Overview
Metadata lets you attach custom key–value pairs to certain API requests and resources so you can carry business context (e.g., internal references, batch IDs, PSP transaction IDs) through your workflows. It’s echoed back in reads so you can reconcile systems without adding custom fields.Not to be confused withmeta
:
meta
(insidedata.meta
) is pagination information (limit
,page
,total
).
metadata
is your custom annotations attached to a resource.
Where you can use it
Currently supported in the Utilization workflow:- Request:
ConfirmSettlementRequest.metadata
- Response:
UtilizationItem.metadata
metadata
in future versions.
Data format
metadata
is a JSON object with string keys. Values can be any JSON type.
- Keys: short, stable,
snake_case
recommended (e.g.,accounting_ref
,batch_id
). - Values: string, number, boolean,
null
, arrays, or nested objects. - Size: keep it small and purposeful (aim for a few KB max). Very large payloads may be rejected with
422 Unprocessable Entity
.
Avoid PII, secrets, and volatile data. Use metadata
for correlation, not as a primary data store.
Examples
Add metadata when confirming a settlement
Read metadata on a utilization item
Validation & errors
- Invalid shapes (e.g., non-object
metadata
) or oversized payloads may return422 Unprocessable Entity
with a structured error body. - Authentication/permission issues return
401/403
; rate limits return429
.
Best practices
- Use stable keys: choose names you can rely on long-term (
integration_order_id
,reconciliation_run
). - Keep it lean: store identifiers, not verbose blobs. Link out to your systems as needed.
- No secrets/PII: treat metadata as broadly visible to your team and logs.
- Consistent casing: prefer
snake_case
keys; avoid spaces and special characters. - Idempotency friendly: include your own
client_request_id
or correlation keys inmetadata
to simplify retries and reconciliation.