Soap API v1.3


Post a new batch of transactions to the gateway for processing.


This method implements the same batch upload functionality as the Batch Upload screens in the merchant console. Batches uploaded via this method will be visible in the Upload Manager screen.

Once a batch has been sent to the gateway for processing, it is possible to pause the batch using the pauseBatchUpload method, and resume the upload later using the runBatchUpload method.

The following fields are available for upload:

  • command
  • source
  • invoice
  • cardholder
  • ccnum
  • ccexp
  • avsstreet
  • avszip
  • cvc
  • amount
  • tax
  • description
  • ponum
  • orderid
  • custid
  • billing_company
  • billing_fname
  • billing_lname
  • billing_street
  • billing_street2
  • billing_city
  • billing_state
  • billing_country
  • billing_zip
  • billing_phone
  • shipping_company
  • shipping_fname
  • shipping_lname
  • shipping_street
  • shipping_street2
  • shipping_city
  • shipping_state
  • shipping_zip
  • shipping_country
  • shipping_phone
  • email
  • checknum
  • vcrouting
  • vcaccount
  • vcssn
  • vcdl
  • vcdlstate

See also pauseBatchUpload, getBatchUploadStatus, runBatchUpload


BatchUploadStatus createBatchUpload ( ueSecurityToken Token, string FileName, boolean AutoStart, string Format, string Encoding, string Fields, string Data, boolean OverrideDuplicates )


Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
string FileName Name of upload file. Can also be used to store a reference ID.
boolean AutoStart If true, the batch will start running automatically. Otherwise the batch must be started manually, either using the runBatchUpload method or via the Merchant Console.
string Format The format of the data upload. Currently supported data formats are: csv, tab and xml.
string Encoding Data encoding method used. Supported methods include: 7bit, base64 and uuencode.
string Fields Fields being uploaded. These fields must be listed in the same order they appear in the data
string Data Transaction data being uploaded.
boolean OverrideDuplicates By default, a batch will be rejected if a certain percentage of the transactions have been uploaded before. Setting this option to true will override the duplicate check.

Return Value

BatchUploadStatus Returns the result of the batch upload.



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

try { 
  $filename=date("ymd") . ".csv"; 
  $fields=array('invoice','cardholder','avsstreet','avszip','ccnum', "ccexp", "amount"); 
  print_r($client->createBatchUpload($token,$filename,$autostart, $format, $encoding,$fields, $data, $dupes)); 
catch(SoapFault $e) { 
  echo $e->getMessage(); 
  echo "\n\nRequest: " . $tran->__getLastRequest(); 
  echo "\n\nResponse: " . $tran->__getLastResponse(); 

This example is using Me.getSecurityToken() to build the token object. The source for this function can be found on the ueSecurityToken page.

Dim service As usaepay.usaepayService = _ 
   New usaepay.usaepayService 
Dim uploaddata As String 
uploaddata = "1234,4444555566667779,0909,1.56,tester joens" & _ 
   vbLf & "1235,4444555566667779,0909,2.22,bob hope" 
Dim res As usaepay.BatchUploadStatus = New usaepay.BatchUploadStatus 
res = service.createBatchUpload(Me.getSecurityToken(), _ 
   "test.csv", _ 
   True, _ 
   "csv", _ 
   "base64", _ 
   "invoice,ccnum,ccexp,amount,cardholder", _ 
   Convert.ToBase64String(Encoding.Default.GetBytes(uploaddata)), _ 
MsgBox("New Batch #" & res.UploadRefNum & "  trans: " & res.Remaining) 


<?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">093edf9686a2ce4a7105b93610eed9d870520c36</HashValue> 
<Seed xsi:type="xsd:string">1193776851129041913</Seed> 
<Type xsi:type="xsd:string">sha1</Type> 
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> 
<FileName xsi:type="xsd:string">071030.csv</FileName> 
<AutoStart xsi:type="xsd:boolean">true</AutoStart> 
<Format xsi:type="xsd:string">csv</Format> 
<Encoding xsi:type="xsd:string">base64</Encoding> 
<Fields SOAP-ENC:arrayType="xsd:string[7]" xsi:type="ns1:stringArray"> 
<item xsi:type="xsd:string">invoice</item> 
<item xsi:type="xsd:string">cardholder</item> 
<item xsi:type="xsd:string">avsstreet</item> 
<item xsi:type="xsd:string">avszip</item> 
<item xsi:type="xsd:string">ccnum</item> 
<item xsi:type="xsd:string">ccexp</item> 
<item xsi:type="xsd:string">amount</item> 
<Data xsi:type="xsd:string">MjEwOTUsR3JlZyBBZGFtcywxODU5IEVsbSBTdCw3NjQwNyw0MzY1MzI3Mz
<OverrideDuplicates xsi:nil="true"/></ns1:createBatchUpload> 


This example uses the USAePay Java library. For directions on how to install the library and create the token/client objects, go to either the Java JAX-RPC Howto or the Java JAX-WS Howto.

try {
	// Create request object
	String FileName = "ExampleFile.csv";
	String Format = "csv";
	String Encoding = "base64";
	StringArray Fields = new StringArray();
	String RawData = "12345,John Doe,1234 Test St,54321,4000100011112224,1012,1.23\n54321,Joe Test,4321 Example St,12345,4000100111112223,0313,12.34";
	BASE64Encoder encoder = new BASE64Encoder();
	String Data = encoder.encodeBuffer(RawData.getBytes());    
	boolean AutoStart = true;
	boolean OverrideDuplicates = true;
	// Create response object
	BatchUploadStatus response;
response = client.createBatchUpload(token, FileName,AutoStart,Format,Encoding,Fields,Data,OverrideDuplicates);
	} catch (Exception e) {
	    System.out.println("Soap Exception: " + e.getMessage());
developer/soap-1.3/methods/createbatchupload.txt · Last modified: 2010/06/01 16:31 by hmcgowan

Page Tools