DX STF Client API

<back to all web services

GetInvoiceByType

Invoice Requests

Invoice

Requires Authentication
The following routes are available for this service:
GET/api/invoice/type/{Type}Get paged invoice response by type
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')


# @Api(Description="Invoice")
# @ApiResponse(Description="Paged invoice response by type", IsDefaultResponse=true, StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetInvoiceByType:
    """
    Invoice
    """

    # @ApiMember(Description="Not used")
    search_term: Optional[str] = None
    """
    Not used
    """


    # @ApiMember(Description="Requested page number, starting at 1")
    requested_page: int = 0
    """
    Requested page number, starting at 1
    """


    # @ApiMember(Description="Number of records to return on a page")
    number_of_records_per_page: int = 0
    """
    Number of records to return on a page
    """


    # @ApiMember(Description="Invoice type to be returned", ExcludeInSchema=true, ParameterType="path")
    type: Optional[str] = None
    """
    Invoice type to be returned
    """


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)

Python GetInvoiceByType 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.

GET /api/invoice/type/{Type} HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

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