Rewards
Rewards belong to a program and carry a cost, a type and optional stock.
Endpoints
GET
/rewards?program_id=Rewards of a program with cost and stock.
Example
curl https://perfito.al/v1/rewards?program_id=4 \
-H "Authorization: Bearer sk_test_…"
$ch = curl_init('https://perfito.al/v1/rewards?program_id=4'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Content-Type: application/json'], ]); $data = json_decode(curl_exec($ch), true);
const res = await fetch('https://perfito.al/v1/rewards?program_id=4', { method: 'GET', headers: { Authorization: `Bearer ${key}`, 'Content-Type': 'application/json' }, }); const data = await res.json();