Operation MetadataCreate an operation relation

Create an operation relation

An explicit refund/reversal/correction/replacement relation (§11: an opposite payment is NOT automatically treated as a refund). Both operations must be in this Vault and accessible to the initiator. Self-reference is forbidden. relatedAmountRaw (partial refund) requires tokenId and is validated against the operation's token. Relations are never physically deleted.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/operation-relations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "sourceOperationType": "deposit",
  "sourceOperationId": "example_string",
  "targetOperationType": "deposit",
  "targetOperationId": "example_string",
  "relationType": "refund",
  "relatedAmountRaw": "example_string",
  "tokenId": "example_string",
  "comment": "example_string"
}'
{
  "id": "cmr3f41z20001psp7phmyapw3",
  "vaultId": "example_string",
  "sourceOperationType": "deposit",
  "sourceOperationId": "example_string",
  "targetOperationType": "deposit",
  "targetOperationId": "example_string",
  "relationType": "refund",
  "relatedAmountRaw": "example_string",
  "tokenId": "example_string",
  "comment": "example_string",
  "createdById": "example_string",
  "createdAt": "2026-07-02T11:25:15.134000Z"
}
POST
/api/v1/vaults/{code}/operation-relations
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Session token. Mobile/services. The web uses a cookie.

Session token. Mobile/services. The web uses a cookie.
API Key (cookie: session_token)
session_tokenstring
Required

API key (sent in cookie)

path
codestring
Required

Unique Vault code (slug)

Content-Typestring
Required

The media type of the request body

Options: application/json
sourceOperationTypestring
Required
Options: deposit, transfer
targetOperationTypestring
Required
Options: deposit, transfer
relationTypestring
Required
Options: refund, reversal, correction, replacement
relatedAmountRawstring

Partial amount (raw units); requires tokenId

Pattern: ^\d+$
commentstring
Max length: 1000
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Session token. Mobile/services. The web uses a cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Path Parameters

codestring
Required

Unique Vault code (slug)

Example:
demo_vault

Body

application/json
sourceOperationTypestring
Required
Allowed values:deposittransfer
targetOperationTypestring
Required
Allowed values:deposittransfer
relationTypestring
Required
Allowed values:refundreversalcorrectionreplacement
relatedAmountRawstring

Partial amount (raw units); requires tokenId

Responses