YM REST Services

<back to all web services

FinanceBatches

Requires Authentication
Requires any of the roles:admin, oauthadmin
The following routes are available for this service:
GET/Ams/{ClientID}/FinanceBatchesReturn a chronological list of Financial Batches.Uses either a specific batch (recommended) or timestamp as a starting point. This method would typically be used in conjunction with subsequent calls to Sa.Export.Finance.Batch for each BatchID returned for the purposes of importing financial data into a 3rd-party accounting sytem. Server time information is also returned, specifically the current date/time ServerTime and GMT bias ServerGmtBias.
POST/Ams/{ClientID}/FinanceBatchesStarts an export of all invoice items in the specified batch and returns the ExportID.To query the status of an export, call Sa.Export.Status until receiving either a COMPLETE or FAILURE status code. Upon receiving a COMPLETE status code, the download location of your export file will be returned by Sa.Export.Status as ExportURI.
FinanceBatches Parameters:
NameParameterData TypeRequiredDescription
CommerceTypebodystringNo
ClosingDatebodyDateTimeNo
ClosedOnlybodyboolNo
TimestampbodyDateTime?No
StartBatchIDbodystringNo
PageSizebodyintNo
PageNumberbodyintNo
BaseDto Parameters:
NameParameterData TypeRequiredDescription
UsingRedisformboolNo
AppInitTimeformDateTimeNo
ServerIDformstringNo
BaseSharedDto Parameters:
NameParameterData TypeRequiredDescription
ClientIDformintNo
ResponseStatusformResponseStatusNo
BypassCacheformboolNo
DateCachedformDateTimeNo
DeviceformDeviceNo
FinanceBatchesResponse Parameters:
NameParameterData TypeRequiredDescription
BatchIDformstringNo
ItemCountformint?No
FinanceBatchListformList<FinanceBatch>No
FinanceBatch Parameters:
NameParameterData TypeRequiredDescription
BatchIDformstringNo
CommerceTypeformstringNo
ItemCountformintNo
ClosedDateformDateTimeNo
CreateDateTimeformDateTimeNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /Ams/{ClientID}/FinanceBatches HTTP/1.1 
Host: ws.yourmembership.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FinanceBatches xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/YM.Web.Services.Ams">
  <BypassCache xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">false</BypassCache>
  <ClientID xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">0</ClientID>
  <Device xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">Desktop</Device>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types" xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <ClosedOnly>false</ClosedOnly>
  <ClosingDate>0001-01-01T00:00:00</ClosingDate>
  <CommerceType>String</CommerceType>
  <PageNumber>0</PageNumber>
  <PageSize>0</PageSize>
  <StartBatchID>String</StartBatchID>
  <Timestamp>0001-01-01T00:00:00</Timestamp>
</FinanceBatches>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FinanceBatchesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/YM.Web.Services.Ams">
  <BypassCache xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">false</BypassCache>
  <ClientID xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">0</ClientID>
  <Device xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">Desktop</Device>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types" xmlns="http://schemas.datacontract.org/2004/07/YM.Toolkit">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <ClosedOnly>false</ClosedOnly>
  <ClosingDate>0001-01-01T00:00:00</ClosingDate>
  <CommerceType>String</CommerceType>
  <PageNumber>0</PageNumber>
  <PageSize>0</PageSize>
  <StartBatchID>String</StartBatchID>
  <Timestamp>0001-01-01T00:00:00</Timestamp>
  <BatchID>String</BatchID>
  <FinanceBatchList>
    <FinanceBatch>
      <BatchID>String</BatchID>
      <ClosedDate>0001-01-01T00:00:00</ClosedDate>
      <CommerceType>String</CommerceType>
      <CreateDateTime>0001-01-01T00:00:00</CreateDateTime>
      <ItemCount>0</ItemCount>
    </FinanceBatch>
  </FinanceBatchList>
  <ItemCount>0</ItemCount>
</FinanceBatchesResponse>