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.addComment (SOAP V1)
  • salesOrderCreditmemoAddComment (SOAP V2)

Allows you to add a new comment to an existing credit memo. Email notification can be sent to the user email.

Arguments:

TypeNameDescription
stringsessionIdSession ID
stringcreditmemoIncrementIdCredit memo increment ID
stringcommentComment text (optional)
intnotifyCustomerNotify customer by email flag (optional)
intincludeCommentInclude comment text into the email notification (optional)

Return:

TypeDescription
boolean\intTrue (1) if the comment is added to the credit memo

Faults:

Fault CodeFault Message
100Requested credit memo does not exist.
102Invalid data given. Details in error message.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$creditmemoIncrementId = '200000001'; //increment id of existing credit memo
$commentText = "Credit memo comment successfully added";

$isCommentAdded = $proxy->call($sessionId, 'order_creditmemo.addComment', array($creditmemoIncrementId, $commentText, true));
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->salesOrderCreditmemoAddComment($sessionId, '200000001');
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->salesOrderCreditmemoAddComment((object)array('sessionId' => $sessionId->result, 'creditmemoIncrementId' => '200000001', 'comment' => 'credit memo comment', 'notifyCustomer' => 1, 'includeComment' => 1));   
var_dump($result->result);