CryptoGate

API documentation

Authentication

Every request must include two headers. Sign the raw JSON body with your API secret using HMAC-SHA256.

X-API-KEY: pk_xxx...
X-API-SIGN: hmac_sha256(raw_json_body, api_secret)
// PHP example
$body = json_encode(['coin' => 'USDT', 'amount' => 25]);
$sign = hash_hmac('sha256', $body, $apiSecret);
// send $body as raw POST payload with headers above

POST /api/create_invoice.php

Creates a deposit invoice / pay address for your customer.

{
  "coin": "USDT",
  "amount": 25.00,
  "order_id": "ORDER-1029",
  "callback_url": "https://yourapp.com/webhook"
}

Response includes pay_address, invoice_id, and a check_url.

GET /api/invoice_status.php?invoice_id=...

Polls / auto-detects deposit confirmation. On completion, credits the user's balance and fires callback_url once.

POST /api/withdraw.php

{
  "coin": "USDT",
  "amount": 10.5,
  "address": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb"
}

Checks your balance, deducts the admin-configured transaction fee + commission, then sends the remaining net amount on-chain.

POST /api/swap.php

{
  "from_coin": "BTC",
  "to_coin": "USDT",
  "amount": 0.01
}

Error format

{ "success": false, "error": "Insufficient balance" }