Skip to content
MagnusSolution edited this page Oct 21, 2021 · 5 revisions

Create new refill to user 24320.

<?php
require_once "vendor/autoload.php";

use magnusbilling\api\magnusBilling;

$magnusBilling             = new MagnusBilling('API KEY', 'SECRET KEY');
$magnusBilling->public_url = "http://1.1.1.1/mbilling"; // Your MagnusBilling URL

//get ID for username 24320 
$id_user = $magnusBilling->getId('user', 'username', '24320');

/*
On the create method you can send the data to create the user, all data is optional.
*/

//Send especific data
$result = $magnusBilling->create('refill',[
      'id_user' => $id_user, 
      'credit' => 10, 
      'payment' => 1, 
      'description' => 'Try insert 10 credit to user 24320 from API'
    ]);

//OR
$result = $magnusBilling->create();

print_r($result);
Clone this wiki locally