Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Enterprise Customer Balance

Edit this page on GitHub

Store Credit API

Allows you to operate with customer virtual balance.

Module: Enterprise_CustomerBalance

Resource: enterprise_customerbalance

Aliases: storecredit

Fault Code Fault Message
100 Provided data is invalid.
101 No balance found with requested parameters.
102 No history found with requested parameters.

Resource: enterprise_customerbalance_quote

Aliases: storecredit_quote

Fault Code Fault Message
100 Provided data is invalid.
103 No quote found with requested id.
104 Store credit can not be used for quote created by guest.
105 No store found with requested id or code.
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$customerId = 10002;
$websiteId = 1;
// Get customer balance amount
$balanceAmount = $proxy->call($sessionId, 'storecredit.balance', array($customerId, $websiteId));
echo $balanceAmount . "<br />";
// Get store credit history for specified customer
$balanceHistory = $proxy->call($sessionId, 'storecredit.history', array($customerId));

$quoteId = 2;
$store = 'default';
// Set customer balance use in shopping cart (quote)
$balanceAmountUsedInQuote = $proxy->call($sessionId, 'storecredit_quote.setAmount', array($quoteId, $store));
echo $balanceAmountUsedInQuote . "<br />";
// Unset customer balance use in shopping cart (quote)
$balanceAmountUsedInQuote = $proxy->call($sessionId, 'storecredit_quote.removeAmount', array($quoteId));
echo $balanceAmountUsedInQuote;
Create the Magento file system owner