Skip to main content
Before running this script, you need to provide your API key and the API URL (e.g. Sandbox or Production).Also, you’ll need jq and uuidgen installed.
Shell
# Your API Key
API_KEY=''

# The IRON API Base URL. Currently set to sandbox.
BASE_URL="https://api.sandbox.iron.xyz/api"
Create a new customer on the IRON System and extract the customer_id from the response.
Shell
create_resp=$(curl -sSf \
  -X POST "$BASE_URL/customers" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "customer_type":"Person",
    "email":"alice@example.com",
    "name":"Alice Example"
  }')
customer_id=$(echo "$create_resp" | jq -r '.id')
To access the service, a Customer needs to accept the terms of (possibly multiple) documents.
This call retrieves the documents and - for this script - just assumes the first one is the correct one
Shell
unsigned_documents=$(curl -sSf -X GET "${BASE_URL}/customers/${customer_id}/unsigned-documents" \
  -H "X-API-Key: $API_KEY" \
  -H "Accept: application/json")
Once the customer has seen the document and checked his approval to signing it, it has to be stored as such.
Shell
signing_resp=$(curl -sSf \
  -X POST "$BASE_URL/customers/$customer_id/signings" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "signed":true,
    "document_id":"'$unsigned_id'"
  }')
identification_id=$(echo "$signing_resp" | jq -r '.["id"]')
In order to know the identity of the customer, we need to request a identification.
Shell
identification=$(curl -sSf \
  -X POST "$BASE_URL/customers/$customer_id/identifications" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "X-API-Key: $API_KEY")
echo "IDENTIFICATION: $identification"
identification_id=$(echo "$identification" | jq -r '.["id"]')
The response of the previous call contains a url field that the user has to visit in order to identify themselves.
Shell
"url":"https://app.sandbox.iron.xyz/verify?Okjvl2CbD-CmHumZ9pOM8j2kFB7XX5gJevGGBYl9"
On a sandbox system, we can mock this identification phase such that you don’t have to click around every time a new customer is created.
Shell
approve_resp=$(curl -sSf \
  -X POST "$BASE_URL/sandbox/identification/$identification_id" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "approved":true
  }')
Now that we have a fully approved and identified customer, we can register their wallet.
Shell
wallet_resp=$(curl -sSf \
  -X POST "$BASE_URL/addresses/crypto/hosted" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "customer_id":"'"$customer_id"'",
    "blockchain":"Solana",
    "wallet_address":"AkJmANXHHpRe8ya5dvuXLneNgkpYy8GM13mwupC6p44f",
    "travel_address":"TravelRuleAddr456",
    "first_name":"Alice",
    "last_name":"Example"
  }')
wallet_address=$(echo "$wallet_resp" | jq -r '.wallet_address')
Once the Wallet is registered, we can finally create the actual autoramp for this customer and wallet.
Once you have an autoramp, you can see incoming transactions.
Shell
curl -sSf \
  -X GET "$BASE_URL/autoramp-transactions?autoramp_id=$autoramp_id" \
  -H "X-API-Key: $API_KEY" \
| jq .
#!/usr/bin/env bash
set -euo pipefail

# This script requires the installation of:
#   - jq (https://stedolan.github.io/jq/)
#   - uuidgen (https://www.gnu.org/software/coreutils/uuidgen)

# Your API Key
API_KEY=''

# The IRON API Base URL. Currently set to sandbox.
BASE_URL="https://api.sandbox.iron.xyz/api"

# Helper to generate idempotency keys (requires uuidgen installation)
gen_key(){ uuidgen || echo "key-$RANDOM"; }

echo "Create Customer:"
IDEMPOTENCY_KEY=$(gen_key)
create_resp=$(curl -sSf \
  -X POST "$BASE_URL/customers" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "customer_type":"Person",
    "email":"alice@example.com",
    "name":"Alice Example"
  }')
customer_id=$(echo "$create_resp" | jq -r '.id')

echo "Get the first Unsigned Documents:"
unsigned_documents=$(curl -sSf -X GET "${BASE_URL}/customers/${customer_id}/unsigned-documents" \
  -H "X-API-Key: $API_KEY" \
  -H "Accept: application/json")

# There may be multiple unsigned documents. For simplicity, we just take the first one.
unsigned_id=$(echo "$unsigned_documents" | jq -r '.items[0]["id"]')

echo "Sign Document:"
IDEMPOTENCY_KEY=$(gen_key)
signing_resp=$(curl -sSf \
  -X POST "$BASE_URL/customers/$customer_id/signings" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "signed":true,
    "document_id":"'$unsigned_id'"
  }')
identification_id=$(echo "$signing_resp" | jq -r '.["id"]')

echo "Create Identification:"
IDEMPOTENCY_KEY=$(gen_key)
identification=$(curl -sSf \
  -X POST "$BASE_URL/customers/$customer_id/identifications" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "X-API-Key: $API_KEY")
echo "IDENTIFICATION: $identification"
identification_id=$(echo "$identification" | jq -r '.["id"]')

: <<'IDENTIFICATION_RESPONSE'
  "created_at":"2025-06-26T10:12:49.011195+00:00",
  "id":"0197abb9-c8f2-7802-a40e-182f8d16e7b7",
  "status":"Pending",
  "updated_at":"2025-06-26T10:12:49.011195+00:00",
  "url":"https://app.sandbox.iron.xyz/verify?Okjvl2CbD-CmHumZ9pOM8j2kFB7XX5gJevGGBYl9"
IDENTIFICATION_RESPONSE

# Only on sandbox: Approve the customer. Normally this has to be done by the customer.
# They will have to click a link in the email to verify their email address.
echo "Verifying customer..."
IDEMPOTENCY_KEY=$(gen_key)
approve_resp=$(curl -sSf \
  -X POST "$BASE_URL/sandbox/identification/$identification_id" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "approved":true
  }')

echo "Registering hosted Solana wallet..."
IDEMPOTENCY_KEY=$(gen_key)
wallet_resp=$(curl -sSf \
  -X POST "$BASE_URL/addresses/crypto/hosted" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "customer_id":"'"$customer_id"'",
    "blockchain":"Solana",
    "wallet_address":"AkJmANXHHpRe8ya5dvuXLneNgkpYy8GM13mwupC6p44f",
    "travel_address":"TravelRuleAddr456",
    "first_name":"Alice",
    "last_name":"Example"
  }')
wallet_address=$(echo "$wallet_resp" | jq -r '.wallet_address')

echo "Creating autoramp (EUR → USDC)..."
IDEMPOTENCY_KEY=$(gen_key)
autoramp_resp=$(curl -sSf \
  -X POST "$BASE_URL/autoramps" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
    "customer_id":"'"$customer_id"'",
    "name":"EUR to USDC Ramp",
    "source_is_third_party": true,
    "source_currencies":[{"type":"Fiat","code":"EUR"}],
    "destination_currency":{"type":"Crypto","blockchain":"Solana","token":"USDC"},
    "recipient_account":{"type":"Crypto","chain":"Solana","address":"'"$wallet_address"'"}
  }')
autoramp_id=$(echo "$autoramp_resp" | jq -r '.id')

# 4. List all transactions for that autoramp
echo "4) Listing transactions for autoramp $autoramp_id..."
curl -sSf \
  -X GET "$BASE_URL/autoramp-transactions?autoramp_id=$autoramp_id" \
  -H "X-API-Key: $API_KEY" \
| jq .
{"success":true}