'true', //must be set to the string 'true' to be activated 'realm' => $realm, 'profile' => $profile, 'cloud_id' => $cloud_id, 'token' => $token, //To create a batch these are needed (leave out for single voucher creation) 'quantity' => 10, 'batch' => 'api_batch_one' ]; $json_payload = json_encode($payload); $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_payload); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $response = curl_exec($ch); curl_close($ch); echo "Added single voucher: $response\n"; ?>