Skip Navigation
Expand
Passing Date Fields through SOAP API
Answer ID 6730   |   Last Review Date 12/19/2018

What is the correct format for Date Fields and DateTime fields using SOAP API?

Environment:

SOAP API

Resolution:

For the DATE datatype
You can use the following format:

<ns2:GenericFields dataType="DATE" name="statement_date">
          <ns2:DataValue>
           <ns2:DateValue>2016-05-01</ns2:DateValue>
           </ns2:DataValue>
</ns2:GenericFields>

Also can use it like:

<ns2:GenericFields dataType="DATE" name="statement_date">
         <ns2:DataValue>
         <ns2:DateValue>2016-05-01Z</ns2:DateValue>
         </ns2:DataValue>
</ns2:GenericFields>

For the DATETIME dataType:

<ns2:GenericFields dataType="DATETIME" name="payment_date">
           <ns2:DataValue>
           <ns2:DateTimeValue>2016-05-12T00:00:00Z</ns2:DateTimeValue>
           </ns2:DataValue>
 </ns2:GenericFields>