DX STF Client API

<back to all web services

SearchClaim

Claim Requests

Claim

Requires Authentication
The following routes are available for this service:
POST/api/claim/searchSearch for claims based on 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')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class _Buyer(IBuyer):
    gln: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class _ClaimNotification(IClaimNotification):
    entity_identification: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class _Invoice(IInvoice):
    entity_identification: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchClaimQuery:
    receiver_gln: Optional[str] = None
    from_date: datetime.datetime = datetime.datetime(1, 1, 1)
    to_date: datetime.datetime = datetime.datetime(1, 1, 1)
    claims_notification_type_code: Optional[str] = None
    claims_notification_identification: Optional[str] = None
    buyer: Optional[_Buyer] = None
    claim_notification: Optional[_ClaimNotification] = None
    invoice: Optional[_Invoice] = None
    exclude_linked_to_credit_note: bool = False
    sender_gln: Optional[str] = None
    partner_gln: List[str] = field(default_factory=list)
    requested_page: int = 0
    number_of_records_per_page: int = 0


# @Api(Description="Claim")
# @ApiResponse(Description="Claim search results", StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchClaim:
    """
    Claim
    """

    # @ApiMember(ParameterType="model")
    query: Optional[SearchClaimQuery] = None


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 SearchClaim 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/claim/search HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	query: 
	{
		receiverGln: String,
		claimsNotificationTypeCode: String,
		claimsNotificationIdentification: String,
		buyer: 
		{
			gln: String
		},
		claimNotification: 
		{
			entityIdentification: String
		},
		invoice: 
		{
			entityIdentification: String
		},
		excludeLinkedToCreditNote: False,
		senderGln: String,
		partnerGln: 
		[
			String
		],
		requestedPage: 0,
		numberOfRecordsPerPage: 0
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

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