————————————————————————————————————-
The following is the XML sent to create a profile Refund transaction successfully.
————————————————————————————————————-
<?xml version=”1.0″ encoding=”utf-8″?>
<createCustomerProfileTransactionRequest xmlns=”AnetApi/xml/v1/schema/AnetApiSchema.xsd”>
<merchantAuthentication>
<name>YourUserLogin</name>
<transactionKey>YourTranKey</transactionKey>
</merchantAuthentication>
<transaction>
<profileTransRefund>
<amount>10.95</amount>
<tax>
<amount>1.00</amount>
<name>WA state sales tax</name>
<description>Washington state sales tax</description>
</tax>
<shipping>
<amount>2.00</amount>
<name>ground based shipping</name>
<description>Ground based 5 to 10 day shipping</description>
</shipping>
<lineItems>
<itemId>ITEM00001</itemId>
<name>name of item sold</name>
<description>Description of item sold</description>
<quantity>1</quantity>
<unitPrice>6.95</unitPrice>
<taxable>true</taxable>
</lineItems>
<lineItems>
<itemId>ITEM00002</itemId>
<name>name of other item sold</name>
<description>Description of other item sold</description>
<quantity>1</quantity>
<unitPrice>1.00</unitPrice>
<taxable>true</taxable>
</lineItems>
<customerProfileId>10000</customerProfileId>
<customerPaymentProfileId>20000</customerPaymentProfileId>
<customerShippingAddressId>30000</customerShippingAddressId>
<creditCardNumberMasked>XXXX1111</creditCardNumberMasked>
<order>
<invoiceNumber>INV000001</invoiceNumber>
<description>description of transaction</description>
<purchaseOrderNumber>PONUM000001</purchaseOrderNumber>
</order>
<transId>40000</transId>
</profileTransRefund>
</transaction>
<extraOptions><![CDATA[]]></extraOptions>
</createCustomerProfileTransactionRequest>
So in C#(asp.net) CreateTransaction function you need to change according to above xml request format Refund
for example
createCustomerProfileTransactionRequest request = new createCustomerProfileTransactionRequest();
XmlAPIUtilities.PopulateMerchantAuthentication((ANetApiRequest)request);
profileTransactionType new_trans = new profileTransactionType();
profileTransRefundType new_item = new profileTransRefundType();
Note:
For Refund Transactions
• If you are submitting a refund against a previous CIM transaction, the following guidelines apply: include customerProfileId, customerPaymentProfileId, and transId.
• customerShippingAddressId is optional.
• creditCardNumberMasked, bankRoutingNumberMasked, and bankAccountNumberMasked do not need to be included, but will be validated if they are included.
For more reference please verify this pdf http://www.authorize.net/support/CIM_XML_guide.pdf