m openmage

OpenMage LTS Developer Documentation

Balance Set Amount

Edit this page on GitHub

Module: Customer Balance Quote API

enterprise_customerbalance_quote

Aliases: storecredit_quote
Method:

Allows you to set amount from the customer store credit to the shopping cart.

Arguments:

Type Name Description
string sessionId Session ID
string quoteId Shopping cart ID (quote ID)
string store Store view code or ID (optional)

Return:

Type Description
float Customer balance amount used in the shopping cart (quote)

Faults:

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.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$quoteId = 2;
$store = 'default';

$balanceAmountUsedInQuote = $proxy->call($sessionId, 'storecredit_quote.setAmount', array($quoteId, $store));
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->shoppingCartCustomerbalanceSetAmount($sessionId, '15');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 
 
$result = $proxy->shoppingCartCustomerbalanceSetAmount((object)array('sessionId' => $sessionId->result, 'quoteId' => '15', 'store' => null));   
var_dump($result->result);