DX STF Client API

<back to all web services

SearchSenderPurchaseCondition

Purchase Conditions Requests

Purchase Conditions

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

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

    required public init(){}
}

public class SearchPurchaseConditionByDateFilter : ISearchPurchaseConditionByDateFilter, 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 SearchSenderPurchaseCondition DTOs

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

HTTP + CSV

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

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

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

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