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

Module: Order Credit Memo API

Resource: sales_order_creditmemo

Aliases: order_creditmemo
Method:
  • order_creditmemo.list (SOAP V1)
  • salesOrderCreditmemoList (SOAP V2)

Allows you to retrieve the list of credit memos by filters.

Arguments:

TypeNameDescription
stringsessionIdSession ID
associative arrayfiltersFilters (optional)

Return:

TypeNameDescription
arrayresultArray of salesOrderCreditmemoEntity

The salesOrderCreditmemoEntity content is as follows:

TypeNameDescription
stringupdated_atDate of updating
stringcreated_atDate of creation
stringincrement_idIncrement ID
stringtransaction_idTransaction ID
stringglobal_currency_codeGlobal currency code
stringbase_currency_codeBase currency code
stringorder_currency_codeOrder currency code
stringstore_currency_codeStore currency code
stringcybersource_tokenCybersource token
stringinvoice_idID of the invoice for which the credit memo was created
stringbilling_address_idBilling address ID
stringshipping_address_idShipping address ID
stringstateState
stringcreditmemo_statusCredit memo status
stringemail_sentDefines whether the email is sent
stringorder_idID of the order for which the credit memo was created
stringtax_amountTax amount
stringshipping_tax_amountShipping tax amount
stringbase_tax_amountBase tax amount
stringbase_adjustment_positiveAdjustment refund amount (using base currency)
stringbase_grand_totalBase grand total
stringadjustmentAdjustment
stringsubtotalSubtotal
stringdiscount_amountDiscount amount
stringbase_subtotalBase subtotal
stringbase_adjustmentBase adjustment
stringbase_to_global_rateBase to global rate
stringstore_to_base_rateStore to base rate
stringbase_shipping_amountBase shipping amount
stringadjustment_negativeAdjustment fee amount
stringsubtotal_incl_taxSubtotal including tax
stringshipping_amountShipping amount
stringbase_subtotal_incl_taxBase subtotal including tax
stringbase_adjustment_negativeAdjustment fee amount (using base currency)
stringgrand_totalGrand total
stringbase_discount_amountBase discount amount
stringbase_to_order_rateBase to order rate
stringstore_to_order_rateStore to order rate
stringbase_shipping_tax_amountBase shipping tax amount
stringadjustment_positiveAdjustment refund amount
stringstore_idStore ID
stringhidden_tax_amountHidden tax amount
stringbase_hidden_tax_amountBase hidden tax amount
stringshipping_hidden_tax_amountShipping hidden tax amount
stringbase_shipping_hidden_tax_amntBase shipping hidden tax amount
stringshipping_incl_taxShipping including tax
stringbase_shipping_incl_taxBase shipping including tax
stringbase_customer_balance_amountBase customer balance amount
stringcustomer_balance_amountCustomer balance amount
stringbs_customer_bal_total_refundedRefunded base customer balance amount
stringcustomer_bal_total_refundedCustomer balance total refunded
stringbase_gift_cards_amountBase gift cards amount
stringgift_cards_amountGift cards amount
stringgw_base_priceGift wrapping price refunded amount (using base currency)
stringgw_priceGift wrapping price refunded amount
stringgw_items_base_priceGift wrapping items base price
stringgw_items_priceGift wrapping items price
stringgw_card_base_priceGift wrapping card base price
stringgw_card_priceGift wrapping card price
stringgw_base_tax_amountGift wrapping tax amount refunded (using base currency)
stringgw_tax_amountGift wrapping tax amount refunded
stringgw_items_base_tax_amountGift wrapping items base tax amount
stringgw_items_tax_amountGift wrapping items tax amount
stringgw_card_base_tax_amountGift wrapping card base tax amount
stringgw_card_tax_amountGift wrapping card tax amount
stringbase_reward_currency_amountBase reward currency amount
stringreward_currency_amountReward currency amount
stringreward_points_balanceReward points balance
stringreward_points_balance_refundReward points balance refund
stringcreditmemo_idCredit memo ID
arrayitemsArray of salesOrderCreditmemoItemEntity
arraycommentsArray of salesOrderCreditmemoCommentEntity

The salesOrderCreditmemoItemEntity content is as follows:

TypeNameDescription
stringitem_idCredit memo item ID
stringparent_idParent ID
stringweee_tax_applied_row_amountApplied fixed product tax row amount
stringbase_priceBase price
stringbase_weee_tax_row_dispositionFixed product tax row disposition (in base currency)
stringtax_amountTax amount
stringbase_weee_tax_applied_amountApplied fixed product tax amount (in base currency)
stringweee_tax_row_dispositionFixed product tax row disposition
stringbase_row_totalBase row total
stringdiscount_amountDiscount amount
stringrow_totalRow total
stringweee_tax_applied_amountApplied fixed product tax amount
stringbase_discount_amountBase discount amount
stringbase_weee_tax_dispositionFixed product tax disposition (in base currency)
stringprice_incl_taxPrice including tax
stringbase_tax_amountBase tax amount
stringweee_tax_dispositionFixed product tax disposition
stringbase_price_incl_taxBase price including tax
stringqtyQuantity
stringbase_costBase cost
stringbase_weee_tax_applied_row_amountApplied fixed product tax row amount (in base currency)
stringpricePrice
stringbase_row_total_incl_taxBase row total including tax
stringrow_total_incl_taxRow total including tax
stringproduct_idProduct ID
stringorder_item_idOrder item ID
stringadditional_dataAdditional data
stringdescriptionDescription
stringweee_tax_appliedApplied fixed product tax
stringskuItem SKU
stringnameName
stringhidden_tax_amountHidden tax amount
stringbase_hidden_tax_amountBase hidden tax amount

The salesOrderCreditmemoCommentEntity content is as follows:

TypeNameDescription
stringparent_idParent ID
stringcreated_atDate of creation
stringcommentComment data
stringis_customer_notifiedDefines whether the customer is notified
stringcomment_idComment ID
stringis_visible_on_frontDefines whether the comment is visible on the frontend

Faults:

Fault CodeFault Description
101Invalid filter given. Details in error message.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$filter = array(
    'order_id' => array(
        'or' => array(
            array(
                'from' => '673',
                'to' => '674',
            ),
            array(
                'from' => '677',
                'to' => NULL,
            )
        )
    ),
    'increment_id' => array(
        'or' => array(
            array(
                'from' => '100000617',
                'to' => '100000619',
            ),
            array(
                'from' => '100000619',
                'to' => NULL,
            )
        )
    )
);
$creditmemoList = $proxy->call($sessionId, 'order_creditmemo.list', array($filter));
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->salesOrderCreditmemoList($sessionId, '200000001');
var_dump($result);
Request Example SOAP V2 (Complex Filter)
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'state',
            'value' => array('key' => 'in', 'value' => '2,3')
        )
    )
);
$result = $client->salesOrderCreditmemoList($session, $complexFilter);

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->salesOrderCreditmemoList((object)array('sessionId' => $sessionId->result));   
var_dump($result->result);
Response Example SOAP V1
array(
    0 => array(
        'store_id' => '1',
        'adjustment_positive' => NULL,
        'base_shipping_tax_amount' => '0.0000',
        'store_to_order_rate' => '1.0000',
        'base_discount_amount' => '0.0000',
        'base_to_order_rate' => '1.0000',
        'grand_total' => '60.0000',
        'base_adjustment_negative' => NULL,
        'base_subtotal_incl_tax' => '55.0000',
        'shipping_amount' => '5.0000',
        'subtotal_incl_tax' => '55.0000',
        'adjustment_negative' => NULL,
        'base_shipping_amount' => '5.0000',
        'store_to_base_rate' => '1.0000',
        'base_to_global_rate' => '1.0000',
        'base_adjustment' => '0.0000',
        'base_subtotal' => '55.0000',
        'discount_amount' => '0.0000',
        'subtotal' => '55.0000',
        'adjustment' => '0.0000',
        'base_grand_total' => '60.0000',
        'base_adjustment_positive' => NULL,
        'base_tax_amount' => '0.0000',
        'shipping_tax_amount' => '0.0000',
        'tax_amount' => '0.0000',
        'order_id' => '674',
        'email_sent' => NULL,
        'creditmemo_status' => NULL,
        'state' => '2',
        'shipping_address_id' => '1348',
        'billing_address_id' => '1347',
        'invoice_id' => NULL,
        'cybersource_token' => NULL,
        'store_currency_code' => 'USD',
        'order_currency_code' => 'USD',
        'base_currency_code' => 'USD',
        'global_currency_code' => 'USD',
        'transaction_id' => NULL,
        'increment_id' => '100000617',
        'created_at' => '2011-05-26 10:49:45',
        'updated_at' => '2011-05-26 10:49:45',
        'hidden_tax_amount' => '0.0000',
        'base_hidden_tax_amount' => '0.0000',
        'shipping_hidden_tax_amount' => NULL,
        'base_shipping_hidden_tax_amnt' => NULL,
        'shipping_incl_tax' => '5.0000',
        'base_shipping_incl_tax' => '5.0000',
        'base_customer_balance_amount' => NULL,
        'customer_balance_amount' => NULL,
        'bs_customer_bal_total_refunded' => '0.0000',
        'customer_bal_total_refunded' => '0.0000',
        'base_gift_cards_amount' => NULL,
        'gift_cards_amount' => NULL,
        'gw_base_price' => NULL,
        'gw_price' => NULL,
        'gw_items_base_price' => NULL,
        'gw_items_price' => NULL,
        'gw_card_base_price' => NULL,
        'gw_card_price' => NULL,
        'gw_base_tax_amount' => NULL,
        'gw_tax_amount' => NULL,
        'gw_items_base_tax_amount' => NULL,
        'gw_items_tax_amount' => NULL,
        'gw_card_base_tax_amount' => NULL,
        'gw_card_tax_amount' => NULL,
        'base_reward_currency_amount' => NULL,
        'reward_currency_amount' => NULL,
        'reward_points_balance' => NULL,
        'reward_points_balance_refund' => NULL,
        'creditmemo_id' => '617',
    ),
    1 => array(
        'store_id' => '1',
        'adjustment_positive' => NULL,
        .......................................
        'creditmemo_id' => '620',
    )
);