DX STF Client API

<back to all web services

SearchSenderInvoice

Invoice Requests

Invoice

Requires Authentication
The following routes are available for this service:
POST/api/invoice/search/senderSearch invoice based on search parameters
import Foundation
import ServiceStack

/**
* Invoice
*/
// @Api(Description="Invoice")
// @ApiResponse(Description="Paged Purchase data", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
public class SearchSenderInvoice : Codable
{
    /**
    * Search query
    */
    // @ApiMember(Description="Search query", ParameterType="model")
    public var query:SearchInvoiceByDateFilter

    required public init(){}
}

public class SearchInvoiceByDateFilter : ISearchInvoiceByDateFilter, Codable
{
    public var fromDate:Date
    public var toDate:Date
    public var continuationToken:String
    public var requestedPage:Int
    public var numberOfRecordsPerPage:Int
    public var orderBy:String
    public var order:ORDER

    required public init(){}
}

public enum ORDER : String, Codable
{
    case ASC
    case DESC
}

public class PagedQueryResponseWithToken<T : Codable> : PagedQueryResult<ResultItem<InvoiceMessage>>
{
    public var continuationToken:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case continuationToken
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        continuationToken = try container.decodeIfPresent(String.self, forKey: .continuationToken)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if continuationToken != nil { try container.encode(continuationToken, forKey: .continuationToken) }
    }
}

public class PagedQueryResult<T : Codable> : Codable
{
    public var startIndex:Int
    public var endIndex:Int
    public var numberOfRecordsReturned:Int
    public var totalNumberOfPages:Int
    public var totalNumberOfRecords:Int
    public var results:[ResultItem<ClaimMessage>] = []

    required public init(){}
}


Swift SearchSenderInvoice DTOs

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

HTTP + JSV

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

POST /api/invoice/search/sender HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	query: 
	{
		continuationToken: String,
		requestedPage: 0,
		numberOfRecordsPerPage: 0,
		orderBy: String,
		order: ASC
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	continuationToken: String,
	startIndex: 0,
	endIndex: 0,
	numberOfRecordsReturned: 0,
	totalNumberOfPages: 0,
	totalNumberOfRecords: 0,
	results: 
	[
		{
			
		}
	]
}