You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the AddClient API from WHMCS, which has been working as expected until recently. We encountered an issue where, after the action is executed successfully, the API returns null in the response instead of the expected result.
Code Implementation:
AddClient Action:
class AddClient extends Action implements ActionInterface
{
public function handle($data = [])
{
$params = array_merge([
'action' => 'AddClient',
], $data);
return Whmcs::getClient($params)->json();
}
}
Upon calling the AddClient action, the API returns null in the response, even though the user and client accounts are successfully created in the database. The expected output should be:
{
"result": "success",
"clientid": "1"
}
However, it currently returns null while still saving the client and user data in the system.
Store Method Implementation:
public function store(AddClientRequest $request)
{
$data = AddClient::run($request->validated());
if ($data['result'] === 'error') {
return back()->with('error', $data['message']);
}
// Other logic if success...
}
The text was updated successfully, but these errors were encountered:
lindiarm
changed the title
WHMCS AddClient API Returning Null on Success
WHMCS version 8.10.1 AddClient API Returning Null on Success
Oct 4, 2024
lindiarm
changed the title
WHMCS version 8.10.1 AddClient API Returning Null on Success
WHMCS AddClient API Returning Null on Success
Oct 4, 2024
Issue Description:
We are using the AddClient API from WHMCS, which has been working as expected until recently. We encountered an issue where, after the action is executed successfully, the API returns null in the response instead of the expected result.
Code Implementation:
AddClient Action:
AddClientRequest Validation Rules:
Problem:
Upon calling the AddClient action, the API returns null in the response, even though the user and client accounts are successfully created in the database. The expected output should be:
However, it currently returns null while still saving the client and user data in the system.
Store Method Implementation:
The text was updated successfully, but these errors were encountered: