Soap API v1.2


Void a specific transaction.


This function will void a transaction that was previously authorized. Once a transaction has been voided, it will not show up on the customer's credit card statement. Customers who have online banking that allows them to see “Pending” transactions may see the voided transaction for a few days before it disappears.

You can only void a transaction that hasn't been settled yet. A transaction is settled when the batch that it is in has been closed. If the transaction has been settled, you must run a credit instead using the runCredit method. If you run a credit, both the credit and the initial charge will show up on the customer's credit card statement. (See the runCredit method for more details.)

The transaction to be voided must be retrieved using the reference number (RefNum) assigned to the transaction by the gateway. The RefNum is assigned by the gateway and returned when a transaction is processed. To find a missing RefNum, use the searchTransactions method.

See also runTransaction, runQuickSale, runCredit, runSale, runauthOnly, getTransactionStatus


boolean voidTransaction ( ueSecurityToken Token, integer RefNum )


Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
integer RefNum Transaction Reference number assigned by the gateway.

Return Value

boolean Returns confirmation of request only if successful. If request fails, an exception will be thrown.



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

try { 
    'AccountHolder' => 'Tester Jones', 
    'Command' => 'authonly', 
    'Details' => array( 
      'Description' => 'Example Transaction', 
      'Amount' => '4.00', 
      'Invoice' => '44539' 
    'CreditCardData' => array( 
      'CardNumber' => '4444555566667779', 
      'CardExpiration' => '0909', 
      'AvsStreet' => '1234 Main Street', 
      'AvsZip' => '99281', 
      'CardCode' => '999' 
  $temp=$client->runTransaction($token, $Request); 
catch (SoapFault $e) { 
  die("Void Transaction 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
    Dim refnum As String
    Dim void As Boolean
    refnum = "46405580"
    void = True
    Dim result As Boolean
    result = client.voidTransaction(token, refnum)
    If result = True Then
        MsgBox("Transaction Voided")
        MsgBox("An error occured.")
    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">4cbf8b47fcdb97c9964c5693fb1826e791a2d1dc</HashValue> 
<Seed xsi:type="xsd:string">119344400343252774</Seed> 
<Type xsi:type="xsd:string">sha1</Type> 
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> 
<RefNum xsi:type="xsd:integer">1118275</RefNum> 
developer/soap/methods/voidtransaction.txt · Last modified: 2009/07/02 12:08 by epouchak

Page Tools