Stablecoin Deposit

(TODO: Need working APIs for fetching Crypto address by network)

  1. Generate a deposit address
  2. Listen to the deposit webhook
  3. Query deposits

Step 1: Generate a Stablecoin Deposit Address

Use the Retrieve Instruction API to generate a unique crypto deposit address for your user.

Example cURL:

curl --request GET \
     --url 'https://sandbox-api.1money.com/v1/portfolios/14f20ebd-893b-11f0-b308-2eaa4f6974f2/instruction?asset=USDT&network=ETHEREUM' \
     --header 'X-Api-Key: 123456' \
     --header 'accept: application/json'

Sample Response:

{
  "instructionId": "inst_crypto_abc123def456",
  "currency": "USDT",
  "network": "ETHEREEUM",
  "address": "0xa0C0f8248487B8f5bF2e9715d966CF29A704a494",
  "addressType": "bech32",
   "transaction_fee": "0.0005",
  "transaction_action": "DEPOSIT",
  "created_at": "2025-08-21T07:56:57.981Z",
  "modified_at": "2025-08-21T07:56:57.981Z"
}

Step 2: Set Up Webhook Monitoring

Configure webhook notifications to receive real-time updates when crypto deposits are received and confirmed.

Register Webhook for Crypto Deposits

curl -X POST \
  'https://api.1money.network/v1/webhooks' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "externalId": "crypto-deposit-monitor-001",
    "eventType": "crypto_deposit.confirmed",
    "url": "https://your-app.com/webhooks/crypto-deposit",
    "description": "Monitor confirmed crypto deposits"
  }'

Example Response:

{
    "event_name": "CRYPTO_DEPOSIT",
    "status": "COMPLETED",
    "portfolio_id": "7b327344-7e63-11f0-895a-4ac62f6385bb",
    "transaction_id": "7b327344-7e63-11f0-895a-4ac62f6385bb",
    "created_at": "2025-08-21T07:56:57.981Z",
    "modified_at": "2025-08-21T07:56:57.981Z"
}

Step 3: Query Crypto Transaction Status

Use the Retrieve Transaction API to manually check the status of crypto deposits.

Retrieve Transaction by ID

curl --request GET 
--url [https://sandbox-api.1money.com/v1/portfolios/14f20ebd-893b-11f0-b308-2eaa4f6974f2/transactions/aac5201f-7f1c-11f0-b018-de09fc637374](https://sandbox-api.1money.com/v1/portfolios/14f20ebd-893b-11f0-b308-2eaa4f6974f2/transactions/aac5201f-7f1c-11f0-b018-de09fc637374) 
--header 'X-Api-Key: 123456' 
--header 'accept: application/json'

Sample JSON Response:

{
  "transactionId": "tx_crypto_001zzz999",
  "instructionId": "inst_crypto_abc123def456",
  "type": "CRYPTO_DEPOSIT",
  "currency": "BTC",
  "network": "bitcoin",
  "amount": "0.05000000",
  "status": "CONFIRMED",
  "confirmations": 6,
  "requiredConfirmations": 6,
  "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "fromAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
  "txHash": "a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789a",
  "blockHash": "0000000000000000000a1b2c3d4e5f6789abcdef0123456789abcdef01234567",
  "blockHeight": 805432,
  "fees": {
    "network": "0.00001500",
    "processing": "0.00000000"
  },
  "createdAt": "2025-10-06T18:25:00Z",
  "confirmedAt": "2025-10-06T18:30:00Z"
}