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 datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')


class ORDER(str, Enum):
    ASC = 'ASC'
    DESC = 'DESC'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchInvoiceByDateFilter(ISearchInvoiceByDateFilter):
    from_date: datetime.datetime = datetime.datetime(1, 1, 1)
    to_date: datetime.datetime = datetime.datetime(1, 1, 1)
    continuation_token: Optional[str] = None
    requested_page: int = 0
    number_of_records_per_page: int = 0
    order_by: Optional[str] = None
    order: Optional[ORDER] = None


# @Api(Description="Invoice")
# @ApiResponse(Description="Paged Purchase data", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchSenderInvoice:
    """
    Invoice
    """

    # @ApiMember(Description="Search query", ParameterType="model")
    query: Optional[SearchInvoiceByDateFilter] = None
    """
    Search query
    """


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedQueryResult(Generic[T]):
    start_index: int = 0
    end_index: int = 0
    number_of_records_returned: int = 0
    total_number_of_pages: int = 0
    total_number_of_records: int = 0
    results: List[ResultItem[ClaimMessage]] = field(default_factory=list)


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedQueryResponseWithToken(Generic[T], PagedQueryResult[ResultItem[InvoiceMessage]]):
    continuation_token: Optional[str] = None

Python SearchSenderInvoice DTOs

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

HTTP + OTHER

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/jsonl
Content-Type: text/jsonl
Content-Length: length

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

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