EmailReceipt
Description
The EmailReceipt method emails a new receipt for an existing transaction.
Syntax
EmailReceiptResponse EmailReceipt(SecurityToken securityToken, string transactionRefNum, string receiptRefNum, string receiptName, string emailAddress)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
string | transactionRefNum | R | Identifies the transaction to send the receipt for. |
string | receiptRefNum | R | Receipt template number. Note: This value can be retrieved from GetReceiptsList or use a |
string | receiptName | O | Name of the receipt. |
string | emailAddress | R | Email address of the customer or merchant. Note: Only one email can be sent at a time. |
Return Object
| Type | Description |
|---|---|
| EmailReceiptResponse | Returns whether the email was successfully sent to the customer or merchant. |
Examples
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header/>
<soapenv:Body>
<ebiz:EmailReceipt>
<ebiz:securityToken>
<ebiz:SecurityId>**************4bf0-91cd32**************</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:transactionRefNum>***********</ebiz:transactionRefNum>
<ebiz:receiptRefNum>3</ebiz:receiptRefNum>
<ebiz:receiptName/>
<ebiz:emailAddress>[email protected]</ebiz:emailAddress>
</ebiz:EmailReceipt>
</soapenv:Body>
</soapenv:Envelope>private static void EmailReceipt()
{
IeBizService apiClient = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken()
{
SecurityId = "*************-4970-ba92-************",
UserId = "",
Password = ""
};
string transactionRefNum = "*****1609";
string receiptRefNum = "";
string receiptName = "Full receipt test";
string emailAddress = "[email protected]";
try
{
var emailResult = apiClient.EmailReceipt(securityToken, transactionRefNum, receiptRefNum, receiptName, emailAddress);
Console.WriteLine($"Status: {emailResult.Status}");
Console.WriteLine($"Error: {emailResult.Error}");
Console.WriteLine($"ErrorCode: {emailResult.ErrorCode}");
}
catch (Exception ex)
{
Console.WriteLine("An error occurred");
Console.WriteLine($"Error message: {ex.Message}");
}
}function emailReceipt(){
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-********',
'UserId' => '',
'Password' => ''
);
$emailReceipt = array(
'securityToken' => $securityToken,
'transactionRefNum' => '**********',
'receiptRefNum' => '12',
'receiptName' => '',
'emailAddress' => '[email protected]',
);
$emailReceiptResponse = $client->EmailReceipt($emailReceipt);
$emailReceiptResponseResult = $emailReceiptResponse->EmailReceiptResponseResult;
}Example Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<EmailReceiptResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<EmailReceiptResult>
<Status>Success</Status>
<StatusCode>1</StatusCode>
<Error/>
<ErrorCode>0</ErrorCode>
</EmailReceiptResult>
</EmailReceiptResponse>
</s:Body>
</s:Envelope><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<EmailReceiptResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<EmailReceiptResult>
<Status>Failed</Status>
<StatusCode>0</StatusCode>
<Error>Transaction not found</Error>
<ErrorCode>1</ErrorCode>
</EmailReceiptResult>
</EmailReceiptResponse>
</s:Body>
</s:Envelope>Updated 5 months ago
