Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Mage_Checkout

Module: Shopping Cart API

Resource: cart

Method:
  • cart.info (SOAP V1)
  • shoppingCartInfo (SOAP V2)

Allows you to retrieve full information about the shopping cart (quote).

Arguments:

TypeNameDescription
stringsessionIdSession ID
intquoteIdShopping cart ID (quote ID)
stringstoreStore view ID or code (optional)

Return:

TypeNameDescription
arrayresultArray of shoppingCartInfoEntity

The shoppingCartInfoEntity content is as follows:

TypeNameDescription
stringstore_idStore ID
stringcreated_atDate of creation
stringupdated_atDate of updating
stringconverted_atDate of conversion
intquote_idQuote ID
intis_activeActive flag
intis_virtualDefines whether the product is a virtual one
intis_multi_shippingDefines whether multi shipping is available
doubleitems_countItems quantity
doubleitems_qtyTotal items quantity
stringorig_order_idOriginal order ID
stringstore_to_base_rateStore to base rate
stringstore_to_quote_rateStore to quote rate
stringbase_currency_codeBase currency code
stringstore_currency_codeStore currency code
stringquote_currency_codeQuote currency code
stringgrand_totalGrand total
stringbase_grand_totalBase grand total
stringcheckout_methodCheckout method
stringcustomer_idCustomer ID
stringcustomer_tax_class_idCustomer tax class ID
intcustomer_group_idCustomer group ID
stringcustomer_emailCustomer email address
stringcustomer_prefixCustomer prefix
stringcustomer_firstnameCustomer first name
stringcustomer_middlenameCustomer middle name
stringcustomer_lastnameCustomer last name
stringcustomer_suffixCustomer suffix
stringcustomer_noteCustomer note
stringcustomer_note_notifyCustomer notification flag
stringcustomer_is_guestDefines whether the customer is a guest
stringapplied_rule_idsApplied rule IDs
stringreserved_order_idReserved order ID
stringpassword_hashPassword hash
stringcoupon_codeCoupon code
stringglobal_currency_codeGlobal currency code
doublebase_to_global_rateBase to global rate
doublebase_to_quote_rateBase to quote rate
stringcustomer_taxvatCustomer taxvat value
stringcustomer_genderCustomer gender
doublesubtotalSubtotal
doublebase_subtotalBase subtotal
doublesubtotal_with_discountSubtotal with discount
doublebase_subtotal_with_discountBase subtotal with discount
stringext_shipping_info 
stringgift_message_idGift message ID
stringgift_messageGift message
doublecustomer_balance_amount_usedUsed customer balance amount
doublebase_customer_balance_amount_usedUsed base customer balance amount
stringuse_customer_balanceDefines whether to use the customer balance
stringgift_cards_amountGift cards amount
stringbase_gift_cards_amountBase gift cards amount
stringgift_cards_amount_usedUsed gift cards amount
stringuse_reward_pointsDefines whether to use reward points
stringreward_points_balanceReward points balance
stringbase_reward_currency_amountBase reward currency amount
stringreward_currency_amountReward currency amount
arrayshipping_addressArray of shoppingCartAddressEntity
arraybilling_addressArray of shoppingCartAddressEntity
arrayitemsArray of shoppingCartItemEntity
arraypaymentArray of shoppingCartPaymentEntity

The shoppingCartAddressEntity content is as follows:

TypeNameDescription
stringaddress_idShopping cart address ID
stringcreated_atDate of creation
stringupdated_atDate of updating
stringcustomer_idCustomer ID
intsave_in_address_bookDefines whether to save the address in the address book
stringcustomer_address_idCustomer address ID
stringaddress_typeAddress type
stringemailEmail address
stringprefixCustomer prefix
stringfirstnameCustomer first name
stringmiddlenameCustomer middle name
stringlastnameCustomer last name
stringsuffixCustomer suffix
stringcompanyCompany name
stringstreetStreet
stringcityCity
stringregionRegion
stringregion_idRegion ID
stringpostcodePostcode
stringcountry_idCountry ID
stringtelephoneTelephone number
stringfaxFax
intsame_as_billingDefines whether the address is the same as the billing one
intfree_shippingDefines whether free shipping is used
stringshipping_methodShipping method
stringshipping_descriptionShipping description
doubleweightWeight

The shoppingCartItemEntity content is as follows:

TypeNameDescription
stringitem_idCart item ID
stringcreated_atDate of creation
stringupdated_atDate of updating
stringproduct_idProduct ID
stringstore_idStore ID
stringparent_item_idParent item ID
intis_virtualDefines whether the product is a virtual one
stringskuProduct SKU
stringnameProduct name
stringdescriptionDescription
stringapplied_rule_idsApplied rule IDs
stringadditional_dataAdditional data
stringfree_shippingFree shipping
stringis_qty_decimalDefines whether the quantity is decimal
stringno_discountDefines whether no discount is applied
doubleweightWeight
doubleqtyQuantity
doublepricePrice
doublebase_priceBase price
doublecustom_priceCustom price
doublediscount_percentDiscount percent
doublediscount_amountDiscount amount
doublebase_discount_amountBase discount amount
doubletax_percentTax percent
doubletax_amountTax amount
doublebase_tax_amountBase tax amount
doublerow_totalRow total
doublebase_row_totalBase row total
doublerow_total_with_discountRow total with discount
doublerow_weightRow weight
stringproduct_typeProduct type
doublebase_tax_before_discountBase tax before discount
doubletax_before_discountTax before discount
doubleoriginal_custom_priceOriginal custom price
doublebase_costBase cost
doubleprice_incl_taxPrice including tax
doublebase_price_incl_taxBase price including tax
doublerow_total_incl_taxRow total including tax
doublebase_row_total_incl_taxBase row total including tax
stringgift_message_idGift message ID
stringgift_messageGift message
stringgift_message_availableDefines whether the gift message is available
doubleweee_tax_appliedApplied fix product tax
doubleweee_tax_applied_amountApplied fix product tax amount
doubleweee_tax_applied_row_amountApplied fix product tax row amount
doublebase_weee_tax_applied_amountApplied fix product tax amount (in base currency)
doublebase_weee_tax_applied_row_amountApplied fix product tax row amount (in base currency)
doubleweee_tax_dispositionFixed product tax disposition
doubleweee_tax_row_dispositionFixed product tax row disposition
doublebase_weee_tax_dispositionFixed product tax disposition (in base currency)
doublebase_weee_tax_row_dispositionFixed product tax row disposition (in base currency)
stringtax_class_idTax class ID

The shoppingCartPaymentEntity content is as follows:

TypeNameDescription
stringpayment_idPayment ID
stringcreated_atDate of creation
stringupdated_atDate of updating
stringmethodPayment method
stringcc_typeCredit card type
stringcc_number_encCredit card number
stringcc_last4Last four digits on the credit card
stringcc_cid_encCredit card CID
stringcc_ownerCredit card owner
stringcc_exp_monthCredit card expiration month
stringcc_exp_yearCredit card expiration year
stringcc_ss_ownerCredit card owner (Switch/Solo)
stringcc_ss_start_monthCredit card start month (Switch/Solo)
stringcc_ss_start_yearCredit card start year (Switch/Solo)
stringcc_ss_issueCredit card issue number (Switch/Solo)
stringpo_numberPurchase order number
stringadditional_dataAdditional data
stringadditional_informationAdditional information

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'cart.info', '15');
var_dump ($result);
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->shoppingCartInfo($sessionId, '15');
var_dump($result);

Mage_Checkout

Module: Shopping Cart API

Resource: cart

Method:
  • cart.license (SOAP V1)
  • shoppingCartLicense (SOAP V2)
Aliases: cart.license

Allows you to retrieve the website license agreement for the quote according to the website (store).

Arguments:

TypeNameDescription
stringsessionIdSession ID
intquoteIdShopping cart ID (quote identifier)
stringstoreStore view ID or code (optional)

Return:

TypeNameDescription
arrayresultArray of shoppingCartLicenseEntity

The shoppingCartLicenseEntity content is as follows:

TypeNameDescription
stringagreement_idLicense agreement ID
stringnameLicense name
stringcontentLicense content
intis_activeDefines whether the license is active
intis_htmlDefines whether the license is HTML

Faults:

Examples

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

$result = $client->call($session, 'cart.license', '15');
var_dump ($result);
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->shoppingCartLicense($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->shoppingCartLicense((object)array('sessionId' => $sessionId->result, 'quoteId' => 15));   
var_dump($result->result);
Response Example SOAP V1
array
  0 =>
    array
      'agreement_id' => string '1' (length=1)
      'name' => string 'license' (length=4)
      'content' => string 'terms and conditions' (length=20)
      'content_height' => null
      'checkbox_text' => string 'terms' (length=5)
      'is_active' => string '1' (length=1)
      'is_html' => string '0' (length=1)
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->shoppingCartInfo((object)array('sessionId' => $sessionId->result, 'quoteId' => '15'));   

var_dump($result->result);