Skip to content

Integration examples

Creating a new transaction

The following example creates a new outgoing Travel Rule transaction.

First make sure you have your API key ready:

API_KEY='a70fcedf-416b-4f83-845c-a05aba0d7da4'

Then create a POST request against the CryptoSwift API, with the relevant data:

curl --location --request POST 'https://api.cryptoswift.eu/transactions' \
--header 'x-api-key: a70fcedf-416b-4f83-845c-a05aba0d7da4' \
--header 'Content-Type: application/json' \
--data-raw '{
    "asset": "ETH",
    "amount": 4,
    "blockchainInfo": {
        "transactionHash": "6146ccf6a66d994f7c363db875e31ca35581450a4bf6d3be6cc9ac79233a69d0",
        "origin": "0xb794f5ea0ba39494ce839613fffba74279579268",
        "destination": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
        "destinationType": "CUSTODIAL"
    },
    "vaspInfo": {
        "beneficiaryVaspName": "SwiftCryptoExchange",
        "beneficiaryVaspEmail": "info@SwiftCryptoExchange.domain",
        "beneficiaryVaspExtraInfo": "Tel +372 1234 5678"
    },
    "originator": {
        "type": "NATURAL",
        "name": "Marwin Hillar",
        "accountNumber": "04143282398",
        "address": "Alexanderplatz 25, Berlin",
        "country": "Germany",
        "nationalIdentificatorType": "IDC",
        "nationalIdentificator": "DE123456789",
        "customerNumber": "A5433634",
        "dateOfBirth": "1991",
        "placeOfBirth": "Germany"
    },
    "beneficiary": {
        "type": "NATURAL",
        "name": "Hanne Nikol",
        "accountNumber": "AB54234232",
        "country": "Estonia",
        "nationalIdentificatorType": "IDC",
        "nationalIdentificator": "EE11234566"
    }
}'

The API responds with the full data of the created Travel Rule transaction object, including the newly generated UUID of the transaction that can be used later to find or modify existing transaction data.

Receiving transaction data

When a Travel Rule transaction is sent out using CryptoSwift or a third party provider that is integrated with CryptoSwift, the beneficiary VASP is searched from the CryptoSwift database. If the VASP is found, they will automatically receive Travel Rule transaction message marked as INCOMING (the ones sent out by originator VASP's are marked OUTGOING). The incoming (and also outgoing) messages are stored and available in the CryptoSwift client dashboard.

Additionally you can set up webhooks to receive incoming Travel Rule transaction messages in real time to your application. See the webhooks section for more details.

Next steps