DX STF Client API

<back to all web services

SearchCustomerMaster

Customer Master Requests

Customer Master

Requires Authentication
The following routes are available for this service:
POST/api/customerMaster/search/ownerSearch customer master based on search parameters
import Foundation
import ServiceStack

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

    required public init(){}
}

public class SearchCustomerMasterQuery : ISearchCustomerMaster, Codable
{
    public var continuationToken:String
    public var payByEntityIdentification: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 SearchCustomerMaster DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /api/customerMaster/search/owner HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: application/json
Content-Type: application/json
Content-Length: length

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

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