This is an old revision of the document!

Soap API v1.2


Runs a credit transaction.


This method runs a Credit transaction in order to refund all or part of a previous Sale, or issue an open credit to a customer's credit card.

Use the runCredit method to refund a customer's card once the initial Sale has been settled. If the batch that the Sale is in has not yet been settled, you may want to use the voidTransaction method instead, which will prevent the initial Sale from ever appearing on the customer's credit card statement.

(See the description of the voidTransaction method for more details.)

Using the runCredit method will cause both the initial charge and the credit to appear on the customer's credit card statement.

See also runSale, runTransaction, runQuickSale, voidTransaction, runauthOnly



Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
TransactionRequestObject Params Request transaction details from all fields of the transaction form, including reference number, transaction amount, customer ID, currency, authorization code, and any other information entered at the time of the transaction.

Return Value

TransactionResponse Returns a TransactionResponse object containing the results of the transaction and all relevant data.



For directions on how to set up the WSDL link, create “$token” and “$client”, go to SOAP PHP How-to.

try { 
    'AccountHolder' => 'Tester Jones', 
    'Details' => array( 
    'Description' => 'Example Transaction', 
    'Amount' => '4.00', 
    'Invoice' => '44539' 
  'CreditCardData' => array( 
    'CardNumber' => '4444555566667779', 
    'CardExpiration' => '0909', 
    'AvsStreet' => '1234 Main Street', 
    'AvsZip' => '99281', 
    'CardCode' => '999' 
  $res=$client->runCredit($token, $Request); 
catch (SoapFault $e) { 
  echo $client->__getLastRequest(); 
  echo $client->__getLastResponse(); 
  die("QuickSale failed :" .$e->getMessage()); 


Dim client As usaepay.usaepayService = New usaepay.usaepayService
Dim token As usaepay.ueSecurityToken
token = Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "443311")
Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject
transaction.CreditCardData = New usaepay.CreditCardData
transaction.CreditCardData.CardNumber = "4444555566667779"
transaction.CreditCardData.CardExpiration = "1212"
transaction.CreditCardData.CardCode = "999"
transaction.Details = New usaepay.TransactionDetail
transaction.Details.Amount = "1.00"
transaction.Details.AmountSpecified = True
transaction.Details.Invoice = "12345"
transaction.Details.Description = "Sample Credit"
Dim response As usaepay.TransactionResponse = New usaepay.TransactionResponse
response = client.runCredit(token, transaction)
If response.ResultCode = "A" Then
    MsgBox("Transaction Approved, Refnum: " & response.RefNum)
    MsgBox("Transaction Error, Reason: " & response.Error)
End If


<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" 
xmlns:ns1="urn:usaepay" xmlns:xsd="" 
<Token xsi:type="ns1:ueSecurityToken"> 
<ClientIP xsi:type="xsd:string"></ClientIP> 
<PinHash xsi:type="ns1:ueHash"> 
<HashValue xsi:type="xsd:string">3f35b5c3edbda6a2a8c2f91d65bd628dcdea5526</HashValue> 
<Seed xsi:type="xsd:string">119344288117863822</Seed> 
<Type xsi:type="xsd:string">sha1</Type> 
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> 
<Params xsi:type="ns1:TransactionRequestObject"> 
<AccountHolder xsi:type="xsd:string">Tester Jones</AccountHolder> 
<CreditCardData xsi:type="ns1:CreditCardData"> 
<AvsStreet xsi:type="xsd:string">1234 Main Street</AvsStreet> 
<AvsZip xsi:type="xsd:string">99281</AvsZip> 
<CardCode xsi:type="xsd:string">999</CardCode> 
<CardExpiration xsi:type="xsd:string">0909</CardExpiration> 
<CardNumber xsi:type="xsd:string">4444555566667779</CardNumber> 
<Details xsi:type="ns1:TransactionDetail"> 
<Amount xsi:type="xsd:double">4</Amount> 
<Description xsi:type="xsd:string">Example Transaction</Description> 
<Invoice xsi:type="xsd:string">44539</Invoice> 
developer/soap/methods/runcredit.1246558922.txt.gz · Last modified: 2009/07/02 11:22 by epouchak

Page Tools