---
url: /en/guide/quickstart.md
---
# Quickstart

## 1. Get credentials

After your merchant account is opened, the platform provides:

| Credential | Purpose |
|---|---|
| API key + API secret | Sign API requests. The secret is shown only once — store it safely. Create keys per scope (`read` / `deposit` / `withdraw`) and bind an IP allowlist |
| Webhook URL + webhook secret | We sign every event we push to your URL with the webhook secret; verify it on your side |

Base URL: `https://api.dtpg.net`

## 2. Your first request

List supported chains. Every request carries 4 signature headers — see [Authentication](./authentication); ready-made code is in [Code examples](./examples).

```bash
# 1. Your credentials
API_KEY="your-api-key"
API_SECRET="your-api-secret"

# 2. This request
METHOD="GET"
URI_PATH="/v1/chains"
QUERY=""                                # canonical query string; empty if none
BODY=""                                 # request body; empty for GET
TIMESTAMP=$(( $(date +%s) * 1000 ))     # now, Unix milliseconds
NONCE=$(openssl rand -hex 16)           # 32-char random string

# 3. String to sign: 6 parts joined by newlines
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 | awk '{print $NF}')
STRING_TO_SIGN=$(printf '%s\n%s\n%s\n%s\n%s\n%s' \
  "$METHOD" "$URI_PATH" "$QUERY" "$TIMESTAMP" "$NONCE" "$BODY_HASH")

# 4. Signature = hex(HMAC-SHA256(API secret, string to sign))
SIGNATURE=$(printf '%s' "$STRING_TO_SIGN" | openssl dgst -sha256 -hmac "$API_SECRET" | awk '{print $NF}')

# 5. Send it
curl "https://api.dtpg.net${URI_PATH}" \
  -H "X-Api-Key: $API_KEY" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Nonce: $NONCE" \
  -H "X-Signature: $SIGNATURE"
```

```json
{ "chains": [{ "code": "TRON", "name": "TRON" }] }
```

## 3. Typical integration

1. **Assign a deposit address**: `POST /v1/wallets/{user_id}/addresses` (idempotent — safe to call before every display).
2. **Wait for the `deposit.confirmed` webhook**: dedupe by `event_id`, then credit the user. Missed one? Backfill with `GET /v1/events`.
3. **Create a withdrawal**: `POST /v1/withdraws` with your own order number as `biz_id` (idempotency key).
4. **Track it**: webhooks `withdraw.broadcasted` → `withdraw.confirmed` (or `withdraw.failed` / `withdraw.rejected`), or poll `GET /v1/withdraws/{withdraw_id}`.

::: tip For AI / coding assistants
Give [`/llms-full.txt`](/llms-full.txt) or [`/openapi.yaml`](/openapi.yaml) to your AI assistant and it can write the integration for you. Every page also has a "Copy as Markdown" button under its title.
:::
