D
API Reference

Spend Cap & Balance API

Endpoint akun & spend cap dazo-whitelist-api — /api/account/ (single, balance, insight, partner, rename, reset, update, spendcap, topup, withdraw, refund, check, sync). Mutasi spend cap Facebook via Meta Graph.

Endpoints manajemen akun iklan, saldo, dan spend cap. Mayoritas adalah mutasi ke Meta Graph: topup spend cap, withdraw, refund, rename, sync. Semua endpoint di bawah middleware: auth:api, myapi.

POST /api/account — Single data akun

POSThttp://127.0.0.1:8081/api/account
curl --request POST \
  --url http://127.0.0.1:8081/api/account

Ambil data single akun iklan (getSingleData).

Request body

FieldWajibTipe
account_id✅string

POST /api/account/balance — Cek saldo riil

POSThttp://127.0.0.1:8081/api/account/balance
curl --request POST \
  --url http://127.0.0.1:8081/api/account/balance

Cek sisa saldo riil akun iklan langsung dari Meta (bukan cache).

FieldWajibTipe
account_id✅string

Response

json
{
  "status": true,
  "data": {
    "account_id": "act_123",
    "balance": 250000,
    "amount_spent": 750000,
    "spend_cap": 1000000
  }
}

POST /api/account/insight — Insight akun

POSThttp://127.0.0.1:8081/api/account/insight
curl --request POST \
  --url http://127.0.0.1:8081/api/account/insight

Ambil insight performa akun iklan tunggal.

FieldWajibTipe
account_id✅string
date_preset❌string

POST /api/account/partner — Agensi partner akun

POSThttp://127.0.0.1:8081/api/account/partner
curl --request POST \
  --url http://127.0.0.1:8081/api/account/partner

Ambil daftar agensi partner untuk akun.

POST /api/account/rename — Rename akun

POSThttp://127.0.0.1:8081/api/account/rename
curl --request POST \
  --url http://127.0.0.1:8081/api/account/rename

Ubah nama akun iklan di Facebook.

FieldWajibTipe
account_id✅string
name✅string

POST /api/account/reset — Reset nama ke default

POSThttp://127.0.0.1:8081/api/account/reset
curl --request POST \
  --url http://127.0.0.1:8081/api/account/reset

Reset nama akun iklan ke default (updateNameDefault).

POST /api/account/update — Rename + spend cap

POSThttp://127.0.0.1:8081/api/account/update
curl --request POST \
  --url http://127.0.0.1:8081/api/account/update

Rename akun + update spend cap sekaligus (updateNameAndSpendCap).

FieldWajibTipe
account_id✅string
name✅string
spend_cap✅number

POST /api/account/spendcap — Update spend cap

POSThttp://127.0.0.1:8081/api/account/spendcap
curl --request POST \
  --url http://127.0.0.1:8081/api/account/spendcap

Update nilai spend cap akun tanpa rename (updateSpendCap).

FieldWajibTipe
account_id✅string
spend_cap✅number

POST /api/account/topup — Tambah spend cap

POSThttp://127.0.0.1:8081/api/account/topup
curl --request POST \
  --url http://127.0.0.1:8081/api/account/topup

Tambah nilai spend cap Facebook (topupSpendCap). Dipakai setelah pembayaran top-up diverifikasi.

FieldWajibTipeKeterangan
account_id✅stringAkun tujuan
amount✅numberNominal tambahan

Response

json
{
  "status": true,
  "data": {
    "success": true,
    "new_spend_cap": 1500000
  }
}

POST /api/account/withdraw — Kurangi spend cap

POSThttp://127.0.0.1:8081/api/account/withdraw
curl --request POST \
  --url http://127.0.0.1:8081/api/account/withdraw

Tarik nilai spend cap Facebook (withdrawSpendCap). Dipakai saat member withdraw saldo / pengurangan limit.

FieldWajibTipe
account_id✅string
amount✅number

POST /api/account/refund — Refund saldo

POSThttp://127.0.0.1:8081/api/account/refund
curl --request POST \
  --url http://127.0.0.1:8081/api/account/refund

Refund sisa saldo spend cap (refundSpendCap). Dipakai saat akun expired & saldo dikembalikan.

POST /api/account/check — Cek shared

POSThttp://127.0.0.1:8081/api/account/check
curl --request POST \
  --url http://127.0.0.1:8081/api/account/check

Cek apakah akun sudah di-share (checkIfShared).

FieldWajibTipe
account_id✅string

Response

json
{
  "status": true,
  "data": { "is_shared": false }
}

POST /api/account/sync — Sinkronisasi akun

POSThttp://127.0.0.1:8081/api/account/sync
curl --request POST \
  --url http://127.0.0.1:8081/api/account/sync

Sinkronisasi data akun rented (syncRentedAccount) — refresh saldo/spend cap dari Meta.

Transfer via account

Transfer balance sebenarnya memakai grup endpoint /api/transfer-balance — lihat Transfer Balance.

Ringkasan endpoint

MethodEndpointFungsi
POST/api/account/Single data akun
POST/api/account/balanceCek saldo riil
POST/api/account/insightInsight akun
POST/api/account/partnerAgensi partner
POST/api/account/renameRename akun
POST/api/account/resetReset nama default
POST/api/account/updateRename + spend cap
POST/api/account/spendcapUpdate spend cap
POST/api/account/topupTambah spend cap
POST/api/account/withdrawKurangi spend cap
POST/api/account/refundRefund saldo
POST/api/account/checkCek shared
POST/api/account/syncSinkronisasi akun

Error umum

PesanKondisi
Graph returned an error: (#10) ...Permission / akun tidak punya akses
Graph returned an error: (#100) ...Parameter tidak valid
Graph returned an error: (#368) ...Standard error saat akses spend cap
Account is not activeStatus akun inactive

Langkah berikutnya