Quick Start Guide

Get your first Neutron API call working in 5 minutes.

Prerequisites

  • Neutron account with API credentials (Sign up)
  • Your API Key and API Secret from the dashboard

Base URL

All API requests use the production endpoint:

https://api.neutron.me

Step 1: Authenticate

Generate an HMAC-SHA256 signature and exchange it for an access token:

API_KEY="your_api_key"
API_SECRET="your_api_secret"
PAYLOAD='{"test":"auth"}'
STRING_TO_SIGN="${API_KEY}&payload=${PAYLOAD}"
SIGNATURE=$(echo -n "$STRING_TO_SIGN" | openssl dgst -sha256 -hmac "$API_SECRET" | cut -d' ' -f2)

curl -X POST https://api.neutron.me/api/v2/authentication/token-signature \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $API_KEY" \
  -H "X-Api-Signature: $SIGNATURE" \
  -d "$PAYLOAD"

Response:

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "expiredAt": 1770428400000,
  "accountId": "ne01-abc123def456"
}

Save the accessToken -- you'll use it in all subsequent requests.

Step 2: Check Your Wallets

curl https://api.neutron.me/api/v2/account/YOUR_ACCOUNT_ID/wallet/ \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "data": [
    {"id": "wal_btc_001", "ccy": "BTC", "amount": 0.01, "availableBalance": 0.01},
    {"id": "wal_usdt_001", "ccy": "USDT", "amount": 100.00, "availableBalance": 100.00}
  ]
}

Step 3: Create a Lightning Invoice

Create an invoice to receive 10,000 sats (0.0001 BTC):

curl -X POST https://api.neutron.me/api/v2/transaction/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "sourceReq": {
      "ccy": "BTC",
      "method": "lightning",
      "reqDetails": {}
    },
    "destReq": {
      "ccy": "BTC",
      "method": "neutronpay",
      "amtRequested": 0.0001,
      "reqDetails": {}
    }
  }'
{
  "txnId": "5e25d2f4-9bca-4b7a-a1ad-2cf056100cb6",
  "txnState": "quoted",
  "sourceReq": {
    "ccy": "BTC",
    "method": "lightning",
    "reqDetails": {
      "paymentRequest": "lnbc100u1pn9x..."
    }
  }
}

Step 4: Confirm the Transaction

curl -X PUT https://api.neutron.me/api/v2/transaction/5e25d2f4-9bca-4b7a-a1ad-2cf056100cb6/confirm \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

The invoice is now active. Share the paymentRequest string with the payer.

Step 5: Check Payment Status

curl https://api.neutron.me/api/v2/transaction/5e25d2f4-9bca-4b7a-a1ad-2cf056100cb6 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Watch for txnState to change to completed. For production, use webhooks instead of polling.

Key Concepts

  • Amounts are in BTC, not satoshis. 0.0001 BTC = 10,000 sats
  • Two-step flow: Create transaction (quoted) then Confirm to execute
  • Set amount on one side only -- source OR destination, not both
  • sourceReq = where funds come FROM
  • destReq = where funds go TO

Next Steps