Agentivity API

<back to all web services

GetTicketCouponsByStatusCode

The following routes are available for this service:
GET/TicketCouponsByStatusCode
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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagingMetadata:
    # @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
    offset: Optional[str] = None
    """
    Starting Record
    """


    # @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
    limit: Optional[str] = None
    """
    Number of records to return (PageSize)
    """


    # @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
    total_records: int = 0
    """
    Total Number of Records in a Full Reponse (if no paging)
    """


    # @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
    response_records: int = 0
    """
    Total Number of Records in this Reponse (on this page)
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompanyLevelRequestBase(PagingMetadata, IMemberUsername, IMemberOwningCompanyCode):
    owning_company_code: Optional[List[str]] = None
    """
    Comma Delimited List of Owning Company Codes
    """

    user_name: Optional[str] = None
    """
    UserName in form of an email address
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomFieldData:
    field_name: Optional[str] = None
    field_value: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomFieldsCollection(List[CustomFieldData]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TicketCouponsByStatusCode(IBookingIdentifier, ICustomFields):
    company_name: Optional[str] = None
    tkt_number: Optional[str] = None
    rn: Optional[str] = None
    air_tkt_seg_id: Optional[str] = None
    vnd_issue_dt: Optional[datetime.datetime] = None
    record_locator: Optional[str] = None
    passenger: Optional[str] = None
    trav_agnt_i_d: Optional[str] = None
    owning_consultant_i_d: Optional[str] = None
    fop_fare: Optional[str] = None
    base_fare: Optional[str] = None
    fop: Optional[str] = None
    total_tax: Optional[str] = None
    tax1_code: Optional[str] = None
    tax1_amt: Optional[str] = None
    tax2_code: Optional[str] = None
    tax2_amt: Optional[str] = None
    tax3_code: Optional[str] = None
    tax3_amt: Optional[str] = None
    tax4_code: Optional[str] = None
    tax4_amt: Optional[str] = None
    tax5_code: Optional[str] = None
    tax5_amt: Optional[str] = None
    account: Optional[str] = None
    exchanged_for_ticket: Optional[str] = None
    coupon_sequence_nbr: Optional[str] = None
    carrier: Optional[str] = None
    board_point: Optional[str] = None
    off_point: Optional[str] = None
    flight_date: Optional[datetime.datetime] = None
    flight_service_class: Optional[str] = None
    fare_basis: Optional[str] = None
    flight_coupon_status: Optional[str] = None
    date_last_checked: Optional[datetime.datetime] = None
    pcc: Optional[str] = None
    airline_code: Optional[str] = None
    owning_company_code: Optional[str] = None
    credit_currency: Optional[str] = None
    credit_value: Optional[Decimal] = None
    flight_service_class_name: Optional[str] = None
    flown_k_m: Optional[int] = None
    bar: Optional[str] = None
    pnr_creation_date: Optional[datetime.datetime] = None
    agentivity_ref: int = 0
    custom_fields: Optional[CustomFieldsCollection] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheMetadata:
    cached_at: datetime.datetime = datetime.datetime(1, 1, 1)
    cache_expires_at: datetime.datetime = datetime.datetime(1, 1, 1)
    is_from_cache: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseMetadata:
    success: bool = False
    has_cache: bool = False
    has_paging: bool = False
    cache_metadata: Optional[CacheMetadata] = None
    paging_metadata: Optional[PagingMetadata] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiRequestPerHour:
    request_date: datetime.datetime = datetime.datetime(1, 1, 1)
    hour0: int = 0
    hour1: int = 0
    hour2: int = 0
    hour3: int = 0
    hour4: int = 0
    hour5: int = 0
    hour6: int = 0
    hour7: int = 0
    hour8: int = 0
    hour9: int = 0
    hour10: int = 0
    hour11: int = 0
    hour12: int = 0
    hour13: int = 0
    hour14: int = 0
    hour15: int = 0
    hour16: int = 0
    hour17: int = 0
    hour18: int = 0
    hour19: int = 0
    hour20: int = 0
    hour21: int = 0
    hour22: int = 0
    hour23: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AgentivityError:
    error_code: Optional[str] = None
    message: Optional[str] = None
    status_code: Optional[str] = None
    verbose_message: Optional[str] = None


TItem = TypeVar('TItem')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CollectionResponse(Generic[TItem]):
    response_metadata: Optional[ResponseMetadata] = None
    response_report: Optional[List[ApiRequestPerHour]] = None
    response_error: Optional[AgentivityError] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TicketCouponsByStatusCodeResponse(CollectionResponse[TicketCouponsByStatusCode]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetTicketCouponsByStatusCode(CompanyLevelRequestBase, IRequestConsultantID):
    date_start: Optional[str] = None
    """
    Date in format YYYYMMDD
    """

    date_end: Optional[str] = None
    """
    Date in format YYYYMMDD
    """

    trav_agnt_i_d: Optional[str] = None
    """
    Travel agent ID
    """

    account: Optional[List[str]] = None
    """
    Comma Delimited List of Accounts
    """

    owning_agency_location_i_d: Optional[List[str]] = None
    """
    Comma Delimited List of PCCs
    """

    coupon_code_group: Optional[str] = None
    """
    Coupon code group ("ALL OPEN") or any Coupon Status eg USED, OPEN
    """

    date_tracker: Optional[str] = None
    """
    Date range type. A single character: I = Issue date, T = Travel date, E = Expiry date
    """

    repeat: bool = False
    """
    Repeat
    """

    no_active_segments: bool = False
    """
    Lists only segments that are not active
    """

    include_partial_matches: bool = False
    """
    Include partial matches
    """

    show_matching_coupons_only: bool = False
    """
    Show Matching Coupons Only
    """

    pax_surname: Optional[str] = None
    """
    Pax surname
    """

    carrier_code: Optional[str] = None
    """
    Two letter code for carrier
    """

    excluded_plating_carrier: Optional[List[str]] = None
    """
    Comma delimited list of 3-character plating carriers
    """

    owning_consultant_i_d: Optional[str] = None
    """
    Id of the owning consultant
    """

    cache_guid: Optional[str] = None
    """
    Cache Guid
    """

    traveller_g_u_i_d: Optional[str] = None
    """
    Agentivity Traveller GUID
    """

    request_consultant_i_d: Optional[str] = None
    """
    Request Consultant ID (sign on)
    """

    crm_code: int = 0
    crmid: Optional[str] = None

Python GetTicketCouponsByStatusCode DTOs

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

HTTP + XML

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

GET /TicketCouponsByStatusCode HTTP/1.1 
Host: api.agentivity.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgentivityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types">
  <ResponseMetadata>
    <Success>false</Success>
    <HasCache>false</HasCache>
    <HasPaging>false</HasPaging>
    <CacheMetadata>
      <IsFromCache>false</IsFromCache>
      <CachedAt>0001-01-01T00:00:00</CachedAt>
      <CacheExpiresAt>0001-01-01T00:00:00</CacheExpiresAt>
    </CacheMetadata>
    <PagingMetadata>
      <Limit>String</Limit>
      <Offset>String</Offset>
      <ResponseRecords>0</ResponseRecords>
      <TotalRecords>0</TotalRecords>
    </PagingMetadata>
  </ResponseMetadata>
  <ResponseReport>
    <TicketCouponsByStatusCode>
      <CompanyName>String</CompanyName>
      <TktNumber>String</TktNumber>
      <RN>String</RN>
      <AirTktSegId>String</AirTktSegId>
      <VndIssueDt>0001-01-01T00:00:00</VndIssueDt>
      <RecordLocator>String</RecordLocator>
      <Passenger>String</Passenger>
      <TravAgntID>String</TravAgntID>
      <OwningConsultantID>String</OwningConsultantID>
      <FOPFare>String</FOPFare>
      <BaseFare>String</BaseFare>
      <FOP>String</FOP>
      <TotalTax>String</TotalTax>
      <Tax1Code>String</Tax1Code>
      <Tax1Amt>String</Tax1Amt>
      <Tax2Code>String</Tax2Code>
      <Tax2Amt>String</Tax2Amt>
      <Tax3Code>String</Tax3Code>
      <Tax3Amt>String</Tax3Amt>
      <Tax4Amt>String</Tax4Amt>
      <Tax4Code>String</Tax4Code>
      <Tax5Code>String</Tax5Code>
      <Tax5Amt>String</Tax5Amt>
      <Account>String</Account>
      <ExchangedForTicket>String</ExchangedForTicket>
      <CouponSequenceNbr>String</CouponSequenceNbr>
      <Carrier>String</Carrier>
      <BoardPoint>String</BoardPoint>
      <OffPoint>String</OffPoint>
      <FlightDate>0001-01-01T00:00:00</FlightDate>
      <FlightServiceClass>String</FlightServiceClass>
      <FareBasis>String</FareBasis>
      <FlightCouponStatus>String</FlightCouponStatus>
      <DateLastChecked>0001-01-01T00:00:00</DateLastChecked>
      <PCC>String</PCC>
      <AirlineCode>String</AirlineCode>
      <OwningCompanyCode>String</OwningCompanyCode>
      <CreditCurrency>String</CreditCurrency>
      <CreditValue>0</CreditValue>
      <FlightServiceClassName>String</FlightServiceClassName>
      <FlownKM>0</FlownKM>
      <BAR>String</BAR>
      <PNRCreationDate>0001-01-01T00:00:00</PNRCreationDate>
      <AgentivityRef>0</AgentivityRef>
      <CustomFields>
        <CustomField>
          <FieldName>String</FieldName>
          <FieldValue>String</FieldValue>
        </CustomField>
      </CustomFields>
    </TicketCouponsByStatusCode>
  </ResponseReport>
  <ResponseError>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StatusCode>String</StatusCode>
    <VerboseMessage>String</VerboseMessage>
  </ResponseError>
</AgentivityResponse>