Start
Sandbox: test without money
Build and check your whole integration with a test key (hz_test_…). It never touches real money, real publishers or reports.
What a test key does
| Request | Answer with a test key |
|---|---|
GET /me | As live, with "mode": "test" |
GET /reports/… | Same shape, no rows, zero totals, "sandbox": true — no number is made up |
GET /reports, GET /earnings | Same shape, all zeros |
GET /payouts | An empty list ("items": []) |
POST /campaigns, /launch, /pause, /resume, /end | The same checks as a live key; the campaign is a test campaign, its budget is test money (never your wallet) and goes back to the test wallet at the end |
POST /campaigns/{id}/creatives | A HalalAdz person reviews it, as for live (pending → approved / rejected) |
Test campaigns
- A campaign made with a test key shows in your dashboard as a test campaign and goes to the same review queue as a real one — the reviewer sees it is an API test. You cannot approve it yourself through the API.
- The budget is HalalAdz test money, never from your wallet; no daily limit, but at most 1,000,000 BDT in open test campaigns at once (more →
422 test_money_cap). - Once approved, the ads show only on your own sites or apps that have "Test ads" on — never to real publishers, and nothing is earned or charged.
- A test key sees and changes only test campaigns; a live key only real ones.
A test key may send 60 requests a minute (a live key 120), and every key at most 1,000 an hour. See limits.
Test webhooks
In Settings → Webhooks, add an address that gets "test events only". Every event of your test campaigns (campaign.approved, campaign.rejected, campaign.paused, creative.approved …) goes there. "Send a test message" sends test.ping. With an advertiser test key you can also fire a low-balance event:
POST /sandbox/low-balance
curl -X POST https://api.halaladz.com/api/v1/sandbox/low-balance \
-H "Authorization: Bearer $HALALADZ_TEST_KEY" \
-H "Idempotency-Key: $(uuidgen)"await fetch("https://api.halaladz.com/api/v1/sandbox/low-balance", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.HALALADZ_TEST_KEY}`, "Idempotency-Key": crypto.randomUUID() },
});<?php
$ch = curl_init('https://api.halaladz.com/api/v1/sandbox/low-balance');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HALALADZ_TEST_KEY'), 'Idempotency-Key: ' . bin2hex(random_bytes(16))], CURLOPT_RETURNTRANSFER => true]);
print_r(json_decode(curl_exec($ch), true));import os, uuid
import requests
requests.post(
"https://api.halaladz.com/api/v1/sandbox/low-balance",
headers={"Authorization": f"Bearer {os.environ['HALALADZ_TEST_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
timeout=30,
)The answer has webhooksQueued: how many messages were queued (they go out within a minute). Test events carry "livemode": false. A live key gets 403 sandbox_only.
POST /sandbox/campaigns/{id}/goal-reached sends a test campaign.goal_reached event for a test campaign (nothing changes). A review decision cannot be faked: POST /sandbox/creatives/{id}/review now answers 410 review_by_halaladz — a HalalAdz person reviews test ads too.
Testing ad code (publishers)
To check your code before the site or app is approved, turn on "Test ads" in the dashboard: test ads show and nothing is earned or charged. It turns off by itself when the property is approved, and in any case 24 hours after it was turned on.