curl --request POST \
--url https://api.hevn.finance/dapi/v1/escrow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"senderClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"receiverClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"token": "USDC",
"maxAmount": "500.00"
}
'import requests
url = "https://api.hevn.finance/dapi/v1/escrow"
payload = {
"senderClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"receiverClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"token": "USDC",
"maxAmount": "500.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senderClientId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41',
receiverClientId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41',
token: 'USDC',
maxAmount: '500.00'
})
};
fetch('https://api.hevn.finance/dapi/v1/escrow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "draft",
"availableActions": [
"approve"
],
"sender": {
"clientId": "<string>"
},
"receiver": {
"clientId": "<string>"
},
"token": "<string>",
"maxAmount": "500.00",
"authorizedAmount": "500.00",
"capturableAmount": "500.00",
"refundableAmount": "500.00",
"windows": {
"approveBy": "2023-11-07T05:31:56Z",
"holdUntil": "2023-11-07T05:31:56Z",
"refundableUntil": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"action": {
"action": "approve",
"idempotencyKey": "<string>",
"status": "awaitingSignature",
"amount": "500.00",
"feeBps": 123,
"transactionHash": "<string>",
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"consistent": true
}{
"id": "<string>",
"status": "draft",
"availableActions": [
"approve"
],
"sender": {
"clientId": "<string>"
},
"receiver": {
"clientId": "<string>"
},
"token": "<string>",
"maxAmount": "500.00",
"authorizedAmount": "500.00",
"capturableAmount": "500.00",
"refundableAmount": "500.00",
"windows": {
"approveBy": "2023-11-07T05:31:56Z",
"holdUntil": "2023-11-07T05:31:56Z",
"refundableUntil": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"action": {
"action": "approve",
"idempotencyKey": "<string>",
"status": "awaitingSignature",
"amount": "500.00",
"feeBps": 123,
"transactionHash": "<string>",
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"consistent": true
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Open an escrow and return the approval to sign
Create an escrow draft and return the exact approval payload that the authorized developer key must sign. No on-chain action is submitted until the signature is confirmed.
curl --request POST \
--url https://api.hevn.finance/dapi/v1/escrow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"senderClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"receiverClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"token": "USDC",
"maxAmount": "500.00"
}
'import requests
url = "https://api.hevn.finance/dapi/v1/escrow"
payload = {
"senderClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"receiverClientId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41",
"token": "USDC",
"maxAmount": "500.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senderClientId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41',
receiverClientId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41',
token: 'USDC',
maxAmount: '500.00'
})
};
fetch('https://api.hevn.finance/dapi/v1/escrow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "draft",
"availableActions": [
"approve"
],
"sender": {
"clientId": "<string>"
},
"receiver": {
"clientId": "<string>"
},
"token": "<string>",
"maxAmount": "500.00",
"authorizedAmount": "500.00",
"capturableAmount": "500.00",
"refundableAmount": "500.00",
"windows": {
"approveBy": "2023-11-07T05:31:56Z",
"holdUntil": "2023-11-07T05:31:56Z",
"refundableUntil": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"action": {
"action": "approve",
"idempotencyKey": "<string>",
"status": "awaitingSignature",
"amount": "500.00",
"feeBps": 123,
"transactionHash": "<string>",
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"consistent": true
}{
"id": "<string>",
"status": "draft",
"availableActions": [
"approve"
],
"sender": {
"clientId": "<string>"
},
"receiver": {
"clientId": "<string>"
},
"token": "<string>",
"maxAmount": "500.00",
"authorizedAmount": "500.00",
"capturableAmount": "500.00",
"refundableAmount": "500.00",
"windows": {
"approveBy": "2023-11-07T05:31:56Z",
"holdUntil": "2023-11-07T05:31:56Z",
"refundableUntil": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"action": {
"action": "approve",
"idempotencyKey": "<string>",
"status": "awaitingSignature",
"amount": "500.00",
"feeBps": 123,
"transactionHash": "<string>",
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"consistent": true
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
Platform access token from POST /auth/token, carrying the platform audience and the developer_key_id of the registration that minted it. It acts as your own account; name a client you created with X-Hevn-Account: cl_…. Every request re-checks that the registration is still active and that the caller's source IP is inside its allowlist. A token is valid only against the server that issued it, so sandbox tokens are refused in production and production tokens in the sandbox.
Headers
The client account to act for, as a cl_… id. Omit it to act as yourself.
"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Your own key for this write, ^[A-Za-z0-9._:-]{1,128}$. A retry with the same key replays the first answer; the same key with a different request is refused.
"po-inv-2026-114"
Body
Account funding the escrow.
^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Account entitled to receive captured funds.
^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Digital asset held in escrow.
1 - 16"USDC"
Maximum token amount that may be authorized.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$"500.00"
Time allowed for the sender to approve funding.
^\d{1,4}[smhd]$"14d"
Time captured funds remain held after approval.
^\d{1,4}[smhd]$"14d"
Time during which a refund remains available.
^\d{1,4}[smhd]$"14d"
Variable fee in basis points; 100 basis points equals 1 percent.
0 <= x <= 10000Caller reference stored with the escrow.
Response
OK
Stable public identifier for this escrow.
Current public lifecycle status of the escrow.
draft, authorized, charged, partiallyCaptured, captured, voided, reclaimed, partiallyRefunded, refunded Actions permitted by current state and deadlines.
approve, authorize, charge, capture, reject, void, reclaim, refund Account sending or authorizing escrow funds.
Show child attributes
Show child attributes
Account entitled to captured escrow funds.
Show child attributes
Show child attributes
Digital asset held in escrow.
Maximum token amount that may be authorized.
"500.00"
Token amount currently authorized for capture.
"500.00"
Token amount that may currently be captured.
"500.00"
Token amount that may currently be refunded.
"500.00"
Approval, holding and refund deadlines.
Show child attributes
Show child attributes
UTC timestamp when the escrow was created.
UTC timestamp when the escrow was last updated.
Latest prepared or submitted escrow action.
Show child attributes
Show child attributes
Whether persisted state matches the latest chain state.
Was this page helpful?