Coindirectly — Developer Docs
Accept Litecoin on your site with simple REST + webhooks
Get API key Dashboard Base URL: https://coindirectly.org/v1

Quickstart

  1. Create an account and grab an API key from Dashboard.
  2. Add a webhook endpoint (e.g. https://your-site.com/webhooks/coindirectly) and copy the secret.
  3. Generate an invoice via POST /v1/invoices and redirect the buyer to the payment page.
  4. We notify your webhook on invoice.pending and invoice.confirmed.
If your origin server calls Toolfuz directly (payouts), make sure its IP is whitelisted on your Toolfuz gateway.

Authentication & Headers

HeaderValueNotes
AuthorizationBearer <YOUR_API_KEY>Required on all merchant API calls.
Idempotency-KeyUUID v4Optional but recommended for POSTs.
Content-Typeapplication/jsonJSON request bodies.

Create an invoice

Request a fresh deposit address + QR for your customer.

POST /v1/invoices

curl -sX POST "https://coindirectly.org/v1/invoices" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_ltc": "0.01000000",
    "metadata": { "order_id": "ORD-1001" },
    "redirect_url": "https://your-site.com/thank-you"
  }'
        

Response (200)

{
  "ok": true,
  "data": {
    "invoice_uid": "INV-8Q2A1N",
    "amount_ltc": "0.01000000",
    "payment_address": "ltc1qxyz…",
    "qr_uri": "litecoin:ltc1qxyz...?amount=0.01000000",
    "status": "pending",
    "created_at": "2025-09-01T12:00:00Z"
  }
}
        

Node / PHP snippets


// Node / browser (server-side recommended)
await fetch('https://coindirectly.org/v1/invoices', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk_live_xxx',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ amount_ltc: '0.01000000', metadata: { order_id: 'ORD-1001' } })
}).then(r => r.json());
        

// PHP (server-side)
$ch = curl_init("https://coindirectly.org/v1/invoices");
curl_setopt_array($ch, [
  CURLOPT_POST => 1,
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer sk_live_xxx",
    "Content-Type: application/json"
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "amount_ltc" => "0.01000000",
    "metadata"   => ["order_id" => "ORD-1001"]
  ])
]);
$res = curl_exec($ch);
        

Retrieve an invoice

GET /v1/invoices/{invoice_uid}

curl -s "https://coindirectly.org/v1/invoices/INV-8Q2A1N" \
  -H "Authorization: Bearer sk_live_xxx"
        

Status values: pending, confirmed, expired.

Webhooks

Add your endpoint in the dashboard. We deliver JSON events and sign each payload.

Signature

We send X-Coindirectly-Signature header: t=<unix>,v1=<hex hmac sha256>
where v1 = HMAC_SHA256(secret, t + "." + raw_body)


// PHP verify example
function valid(string $secret, string $raw, string $header): bool {
  parse_str(str_replace([',',' '], ['&',''], $header), $p); // t=...,v1=...
  $sig = $p['v1'] ?? ''; $t = $p['t'] ?? '';
  $calc = hash_hmac('sha256', $t.'.'.$raw, $secret);
  return hash_equals($calc, $sig);
}
        

Event schema

{
  "id": "evt_abc123",
  "type": "invoice.confirmed",
  "created": "2025-09-01T12:34:56Z",
  "data": {
    "invoice_uid": "INV-8Q2A1N",
    "amount_ltc": "0.01000000",
    "payment_address": "ltc1qxyz…",
    "confirmations": 1,
    "metadata": { "order_id": "ORD-1001" }
  }
}
        
Respond with HTTP 2xx. Non-2xx responses will be retried with backoff.

Payouts (optional)

Send LTC from your merchant wallet (requires your server IP to be whitelisted on Toolfuz).

POST /v1/payouts

curl -sX POST "https://coindirectly.org/v1/payouts" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "to_address":"ltc1q...", "amount_ltc":"0.01000000" }'
        

Errors

All responses are HTTP 200 with a stable JSON envelope.

{
  "ok": false,
  "error": { "code": "INVALID_INPUT", "message": "amount_ltc is required" }
}
        
CodeMeaning
AUTH_FAILEDBad or missing API key
RATE_LIMITEDToo many requests; back off and retry
INVALID_INPUTMalformed or missing field
INSUFFICIENT_FUNDSFor payouts: wallet balance too low