Update contract metadata

View as Markdown
Merges the keys you send into the contract's existing metadata, following JSON Merge Patch (RFC 7386) at the top level. A key with a value overwrites whatever is stored under that key; a key set to `null` removes it; a key you leave out of the payload is preserved. Removing a key that does not exist succeeds and changes nothing, so the same request can be replayed safely. Only top-level `null`s delete. The merge is shallow — sending an object as a value replaces the stored value outright rather than merging into it — so a `null` inside a nested object is stored as part of that object, not treated as a deletion. Removing every remaining key leaves an empty object, not null. Use DELETE on this path to clear the metadata back to null. Scoped to the authenticated merchant: a contract belonging to another merchant returns 404. The stored metadata is capped at 16KB, measured as the UTF-8 byte length of its JSON serialization. The cap applies to the merged result rather than to the request body, so a payload that is small on its own is still rejected with 400 if it would push the stored document over; the error names the attempted size. A request that only removes keys is always accepted, so metadata that is already over the cap can be brought back under it.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

idstringRequired
Contract Id

Request

This endpoint expects an object.
metadatamap from strings to anyRequired

Keys to merge into the contract’s existing metadata. A key with a value overwrites the existing key; a key set to null removes it; a key you leave out is preserved. Removing a key that is not there succeeds and changes nothing. Only top-level nulls delete — a null inside a nested object is stored as part of that object’s value. The merged document may not exceed 16KB of UTF-8 encoded JSON; the limit is checked against the merge result, not against this payload on its own.

Response

The contract's metadata after the merge
payloadobject
Response payload, will be empty when success is false
successboolean

Boolean with true=success, false=failure

messagestring

Plain-text description of the result

errorobjectOptional
json element with any error messages or warnings

Errors

400
Bad Request Error
404
Not Found Error