I have custom API in which I am retrieving customer balance as:
use Magento\CustomerBalance\Model\BalanceFactory;
........................
........................
$model = $this->balanceFactory->create()->setCustomerId($customerId)->loadByCustomer();
$customerBalance = $model->getAmount();
In postman request is send as:
and output is correct logged in customer balance.
But when I test same API in Magento swagger UI, here the Curl appears is:
curl -X POST "http://127.0.0.1/index.php/rest/all/V1/mymodule/request/R1" -H "accept: application/json" -H "Authorization: Bearer nbvkrjkewuiu398hds"
which has extra index.php/rest/all/
and from response the customer balance is shown as 0 always.
What is the reason of different output on testing same API in Default Swagger and then in Postman ?
Any help will be highly appreciated!