Pre-transaction flow
Create a Travel Rule message before broadcasting, then add the hash or cancel.
Use this flow when your backend needs to evaluate available information before broadcasting a payment. The beneficiary VASP may receive and review the message before the on-chain transfer exists.
1. Create the message
Send the transaction data without blockchainInfo.transactionHash. Use your actual customer and beneficiary details; the values below illustrate the request structure.
curl --location --request POST 'https://api-dev.cryptoswift.eu/transactions' \
--header "x-api-key: $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"asset": "BTC",
"amount": 0.00341,
"blockchainInfo": {
"blockchain": "Bitcoin",
"origin": "17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ",
"destination": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY",
"destinationType": "CUSTODIAL"
},
"vaspInfo": {
"beneficiaryVaspName": "SwiftExchange"
},
"originator": {
"type": "NATURAL",
"name": "Marwin Hillar",
"accountNumber": "04143282398",
"address": "Alexanderplatz 25, Berlin",
"country": "DE"
},
"beneficiary": {
"type": "NATURAL",
"name": "Hanne Nikol",
"accountNumber": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY"
}
}'
{
"id": "233e3fd4-2ef0-477c-a398-8f993d131a19",
"status": "DELIVERED",
"statusReasoning": null,
"direction": "OUTGOING",
"createdAt": "2026-11-11T09:00:00.000Z",
"asset": "BTC",
"amount": 0.00341,
"amountUsd": 240.18,
"amountEur": 221.5,
"metadata": null,
"blockchainInfo": {
"transactionHash": null,
"origin": "17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ",
"destination": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY",
"destinationType": "CUSTODIAL",
"blockchain": "Bitcoin",
"isDestinationConfirmed": true,
"destinationWalletId": 7069
},
"vaspInfo": {
"originatorVaspName": "Example Originator VASP",
"originatorVaspEmail": "support@originator.example",
"beneficiaryVaspName": "SwiftExchange",
"beneficiaryVaspEmail": "support@beneficiary.example",
"beneficiaryVaspExtraInfo": null
},
"originator": {
"type": "NATURAL",
"name": "Marwin Hillar",
"accountNumber": "04143282398",
"address": "Alexanderplatz 25, Berlin",
"country": "DE"
},
"beneficiary": {
"type": "NATURAL",
"name": "Hanne Nikol",
"accountNumber": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY"
},
"travelRuleMessageSource": "CryptoSwift",
"riskScore": {
"originatorRiskScore": 18,
"originatorRiskSeverity": "low",
"beneficiaryRiskScore": 12,
"beneficiaryRiskSeverity": "low",
"sanctions": {
"originatorWallet": {
"isSanctioned": false,
"details": []
},
"beneficiaryWallet": {
"isSanctioned": false,
"details": []
}
}
},
"ruleEngine": {
"decision": "WAIT",
"ruleEngineId": "6292e827-ce05-4cae-a3c8-43e1fb073e1e",
"ruleId": "wait-for-counterparty",
"ruleName": "Wait for counterparty review",
"conditions": {
"all": [
{
"field": "status",
"operator": "EQ",
"value": "DELIVERED"
}
],
"any": []
},
"ruleEngineVersion": 3,
"scope": "OUTGOING",
"waitForSeconds": 120,
"onTimeoutDecision": "REVIEW"
},
"warnings": []
}
The response example assumes a published policy that returns WAIT for a delivered message. Risk data and the actual policy outcome depend on your tenant and processing state. The transaction hash remains null until your backend attaches it.
Save the returned transaction id. A PENDING message is awaiting delivery; DELIVERED means it reached the beneficiary VASP, which may still need to review it.
2. Evaluate the response
Read status, riskScore, warnings, converted amounts when available, and the optional ruleEngine result. Use your own backend policy or apply the Rule Engine decision. The Travel Rule data model defines the shared response fields.
A policy may consider amount, counterparty, wallet type, risk, or the beneficiary's response. CONFIRMED is a message-review outcome; it does not prove that an on-chain payment has occurred. Your policy determines which signals are required before broadcasting.
3. Wait or review when needed
Continue processing webhooks or polling known transaction IDs while a decision is pending. Later updates can change delivery status, participant data, or available risk information. Always reconcile the latest API record before acting.
If the Rule Engine returns WAIT, your backend must persist and enforce the deadline using waitForSeconds and apply onTimeoutDecision when it expires. CryptoSwift returns policy values; it does not run your withdrawal timer, broadcast funds, or cancel the message for you. See waiting behavior.
An immediate counterparty response is not guaranteed. Define the waiting period and fallback under your policy, including manual review where required. Re-evaluate updates that arrive before the deadline; a duplicate notification should not restart the timer.
4. Proceed and attach the hash
When your policy permits the payment, broadcast it using your own infrastructure. As soon as its hash is available, PATCH the same Travel Rule record:
curl --request PATCH "https://api-dev.cryptoswift.eu/transactions/{transactionId}" \
--header "x-api-key: $API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"blockchainInfo": {
"transactionHash": "cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79"
}
}'
HTTP/1.1 200 OK
This success response has no body. Do not parse it as JSON.
Read the updated record:
curl --location 'https://api-dev.cryptoswift.eu/transactions/233e3fd4-2ef0-477c-a398-8f993d131a19' \ --header "X-Api-Key: $API_KEY"
{
"id": "233e3fd4-2ef0-477c-a398-8f993d131a19",
"status": "DELIVERED",
"statusReasoning": null,
"direction": "OUTGOING",
"createdAt": "2026-11-11T09:00:00.000Z",
"asset": "BTC",
"amount": 0.00341,
"amountUsd": 240.18,
"amountEur": 221.5,
"metadata": null,
"blockchainInfo": {
"transactionHash": "cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79",
"origin": "17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ",
"destination": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY",
"destinationType": "CUSTODIAL",
"blockchain": "Bitcoin",
"isDestinationConfirmed": true,
"destinationWalletId": 7069
},
"vaspInfo": {
"originatorVaspName": "Example Originator VASP",
"originatorVaspEmail": "support@originator.example",
"beneficiaryVaspName": "SwiftExchange",
"beneficiaryVaspEmail": "support@beneficiary.example",
"beneficiaryVaspExtraInfo": null
},
"originator": {
"type": "NATURAL",
"name": "Marwin Hillar",
"accountNumber": "04143282398",
"address": "Alexanderplatz 25, Berlin",
"country": "DE"
},
"beneficiary": {
"type": "NATURAL",
"name": "Hanne Nikol",
"accountNumber": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY"
},
"travelRuleMessageSource": "CryptoSwift",
"riskScore": {
"originatorRiskScore": 18,
"originatorRiskSeverity": "low",
"beneficiaryRiskScore": 12,
"beneficiaryRiskSeverity": "low",
"sanctions": {
"originatorWallet": {
"isSanctioned": false,
"details": []
},
"beneficiaryWallet": {
"isSanctioned": false,
"details": []
}
}
},
"ruleEngine": {
"decision": "PROCEED",
"ruleEngineId": "6292e827-ce05-4cae-a3c8-43e1fb073e1e",
"ruleId": "hash-attached",
"ruleName": "Payment broadcast",
"conditions": {
"all": [
{
"field": "hasTxHash",
"operator": "EQ",
"value": true
}
],
"any": []
},
"ruleEngineVersion": 3,
"scope": "OUTGOING",
"waitForSeconds": null,
"onTimeoutDecision": null
},
"warnings": []
}
Adding the hash links the message to the transfer. It does not complete delivery or beneficiary review, and does not require a second sender-side status update. Continue reconciling later updates and exceptions.
Only supply fields supported by the update schema. Direction and destination cannot be changed; some network integrations also restrict replacing an existing hash. See transaction update constraints.
5. Cancel an abandoned payment
If your policy blocks or abandons the payment before broadcast, do not send funds. Update the outgoing record with CANCELLED and a non-empty reason:
curl --request PATCH "https://api-dev.cryptoswift.eu/transactions/{transactionId}" \
--header "x-api-key: $API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"status": "CANCELLED",
"statusReasoning": "Blocked by internal policy due to high beneficiary risk score."
}'
HTTP/1.1 200 OK
This success response has no body. Do not parse it as JSON.
Read the updated record:
curl --location 'https://api-dev.cryptoswift.eu/transactions/233e3fd4-2ef0-477c-a398-8f993d131a19' \ --header "X-Api-Key: $API_KEY"
{
"id": "233e3fd4-2ef0-477c-a398-8f993d131a19",
"status": "CANCELLED",
"statusReasoning": "Blocked by internal policy due to high beneficiary risk score.",
"direction": "OUTGOING",
"createdAt": "2026-11-11T09:00:00.000Z",
"asset": "BTC",
"amount": 0.00341,
"amountUsd": 240.18,
"amountEur": 221.5,
"metadata": null,
"blockchainInfo": {
"transactionHash": null,
"origin": "17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ",
"destination": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY",
"destinationType": "CUSTODIAL",
"blockchain": "Bitcoin",
"isDestinationConfirmed": true,
"destinationWalletId": 7069
},
"vaspInfo": {
"originatorVaspName": "Example Originator VASP",
"originatorVaspEmail": "support@originator.example",
"beneficiaryVaspName": "SwiftExchange",
"beneficiaryVaspEmail": "support@beneficiary.example",
"beneficiaryVaspExtraInfo": null
},
"originator": {
"type": "NATURAL",
"name": "Marwin Hillar",
"accountNumber": "04143282398",
"address": "Alexanderplatz 25, Berlin",
"country": "DE"
},
"beneficiary": {
"type": "NATURAL",
"name": "Hanne Nikol",
"accountNumber": "1MLh2UVHgonJY4ZtsakoXtkcXDJ2EPU6RY"
},
"travelRuleMessageSource": "CryptoSwift",
"riskScore": {
"originatorRiskScore": 18,
"originatorRiskSeverity": "low",
"beneficiaryRiskScore": 12,
"beneficiaryRiskSeverity": "low",
"sanctions": {
"originatorWallet": {
"isSanctioned": false,
"details": []
},
"beneficiaryWallet": {
"isSanctioned": false,
"details": []
}
}
},
"ruleEngine": {
"decision": "BLOCK",
"ruleEngineId": "6292e827-ce05-4cae-a3c8-43e1fb073e1e",
"ruleId": "cancelled-payment",
"ruleName": "Cancelled payment",
"conditions": {
"all": [
{
"field": "status",
"operator": "EQ",
"value": "CANCELLED"
}
],
"any": []
},
"ruleEngineVersion": 3,
"scope": "OUTGOING",
"waitForSeconds": null,
"onTimeoutDecision": null
},
"warnings": []
}
The cancellation records your decision and is reflected to the counterparty through the applicable integration. It does not reverse any on-chain payment. The API rejects cancellation when the message is already CONFIRMED or DECLINED and has a transaction hash.
Next steps
- Test the lifecycle in Sandbox
- Recover missed updates
- Review pre-transaction policy examples
- Outgoing integration overview