openapi: 3.1.0
info:
  title: Payments API
  version: v2
servers:
  - url: https://apis.spotnana.com
    description: Staging URL
security:
  - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
  responses:
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The specified resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    AgentContact:
      type: object
      title: AgentContact
      description: Details of agent contact event.
      required:
        - contactType
        - contactId
        - contactOp
        - billable
      properties:
        contactType:
          description: Mode of agent contact.
          $ref: '#/components/schemas/AgentContactType'
          example: PHONE
        contactId:
          type: string
          description: Unique ID for agent contact.
          example: '1234567890'
        contactOp:
          description: Operation that the agent performed.
          $ref: '#/components/schemas/AgentContactOp'
          example: AGENT_BOOKING
        agentId:
          $ref: '#/components/schemas/UserId'
          description: User ID of agent.
        billable:
          type: boolean
          description: Is the agent contact event billable?
          example: true
        pnrId:
          type: string
          description: PNR ID (if applicable).
          example: '1234567890'
        travelType:
          description: Travel type.
          $ref: '#/components/schemas/TravelType'
          example: AIR
        notes:
          type: string
          description: Agent notes.
          example: Requested by customer
        nonBillableReason:
          $ref: '#/components/schemas/NonBillableReason'
          description: Reason for non-billable agent contact
    AgentContactOp:
      type: string
      title: AgentContactOp
      description: Agent contact operation.
      enum:
        - AGENT_BOOKING
        - AGENT_MODIFY
        - AGENT_CANCEL
        - AGENT_OTHER
        - AGENT_EXCHANGE
        - ANCILLARY_PURCHASE
        - SHELL_PNR_CREATE
        - SHELL_PNR_MODIFY
        - SHELL_PNR_CANCEL
        - SHELL_PNR_EXCHANGE
        - MANUAL_FORM_CREATE
        - MANUAL_FORM_MODIFY
        - MANUAL_FORM_CANCEL
        - MANUAL_FORM_EXCHANGE
        - UNUSED_TICKET_MANAGEMENT
    AgentContactType:
      type: string
      title: Agent contact type
      description: Agent contact type
      enum:
        - PHONE
        - CHAT
        - EMAIL
    BookingDetails:
      type: object
      title: BookingDetails
      description: Booking information
      properties:
        pnrId:
          type: string
          description: PNR Id
        pnrVersion:
          type: integer
          format: int32
          description: Version number associated with the PNR
        tripUsageType:
          type: string
          description: Trip Usage Type
          enum:
            - TRIP_USAGE_TYPE_UNKNOWN
            - STANDARD
            - EVENT
    Card:
      type: object
      title: Card
      description: User card info
      required:
        - number
      properties:
        id:
          type: string
          description: Unique identifier for this card
          format: uuid
          example: 34d536b6-f8ff-11eb-9a61-0242ac180002
        type:
          type: string
          enum:
            - UNKNOWN
            - CREDIT
            - DEBIT
          description: Type of card
          example: CREDIT
        company:
          $ref: '#/components/schemas/CardCompany'
        name:
          description: Name on card
          type: string
          example: Harrison Schwartz
        address:
          description: Billing address
          $ref: '#/components/schemas/PostalAddress'
        number:
          type: string
          description: Card number
          example: '4111111111111111'
        expiryMonth:
          type: integer
          format: int32
          minimum: 1
          maximum: 12
          description: Expiry month
          example: 1
          deprecated: true
        expiryYear:
          type: integer
          format: int32
          description: Expiry year
          minimum: 2000
          example: 2010
          deprecated: true
        cvv:
          type: string
          description: Card cvv number
          example: '012'
        label:
          type: string
          description: Card Label
          example: Label amex
        currency:
          type: string
          description: Native currency of the card.
          example: USD
        externalId:
          type: string
          description: Spotnana partner card id.
          example: bxt_RNGsNfzgJDaTstKIKqK4xEuhGYAnMdYK8T40
        vaultId:
          type: string
          description: ID of the vault used for creating the card.
          format: uuid
          example: 34d536b6-f8ff-11eb-9a61-0242ac180002
        expiry:
          description: Card Expiry.
          $ref: '#/components/schemas/CardExpiry'
        ownershipLabel:
          type: string
          enum:
            - CORPORATE
            - PERSONAL
            - CENTRAL
          description: >-
            Ownership label of the card whether it is personal, corporate or
            central.
          example: CENTRAL
    CardAccessEntity:
      title: CardAccessEntity
      type: object
      description: Contains the central access level and entity id.
      required:
        - entityId
        - centralCardAccessLevel
      properties:
        entityId:
          type: string
          description: >-
            Holds the id for for the user who can access the card or
            organization id or legal entity
        centralCardAccessLevel:
          $ref: '#/components/schemas/CentralCardAccessLevel'
    CardCompany:
      type: string
      enum:
        - NONE
        - VISA
        - MASTERCARD
        - AMEX
        - DISCOVER
        - AIR_TRAVEL_UATP
        - CARTE_BLANCHE
        - DINERS_CLUB
        - JCB
        - BREX
        - UNION_PAY
        - EURO_CARD
        - ACCESS_CARD
        - ELO_CARD
      description: The issuing company of card
      example: VISA
    CardExpiry:
      title: CardExpiry
      type: object
      description: Contains the expiry of a Card.
      oneOf:
        - $ref: '#/components/schemas/TokenizedExpiryWrapper'
        - $ref: '#/components/schemas/ExpiryWrapper'
    CardMetadata2:
      type: object
      title: CardMetadata
      description: Metadata for Card payment source.
      properties:
        card:
          $ref: '#/components/schemas/Card'
        accessType:
          $ref: '#/components/schemas/CreditCardAccess'
        isLodgeCard:
          type: boolean
          description: Whether the payment is made using a lodge card
          example: false
        bta:
          type: string
          description: >-
            Whether this is a BTA card. Possible values are 'Y' or 'N'. Relevant
            only for lodge cards.
          example: 'Y'
    CentralCardAccessLevel:
      title: CentralCardAccessLevel
      type: string
      description: >-
        Identifies at which level central card is applicable, for example
        organization or legal entity.
      enum:
        - UNKNOWN
        - ORGANIZATION
        - LEGAL_ENTITY
        - TMC
    CompanyId:
      type: object
      title: CompanyId
      description: Company ID
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          example: f49d00fe-1eda-4304-ba79-a980f565281d
    CompanyRef:
      type: object
      description: Basic information about a company.
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/CompanyId'
        name:
          type: string
        logo:
          $ref: '#/components/schemas/Image'
          description: Company logo
    ConfermaInfo:
      type: object
      title: ConfermaInfo
      description: Details of conferma - one of virtual card vendors.
      required:
        - deploymentId
      properties:
        deploymentId:
          type: integer
          format: int32
          description: >-
            Unique identifier assigned to the virtual card deployment at the
            point of creation.
          example: 68793680
    CreditCardAccess:
      type: object
      title: CreditCardAccess
      description: >-
        Access type for cards to check who in the organization has permission to
        use it
      required:
        - accessType
        - entityIds
      properties:
        accessType:
          $ref: '#/components/schemas/CreditCardAccessType'
        entityIds:
          type: array
          items:
            type: string
          description: >-
            Holds the ids for for all users who can access the card or
            organization id
        entities:
          type: array
          description: >-
            A list of cardAccessEntity consisting of central card access level
            if present and entity id.
          items:
            $ref: '#/components/schemas/CardAccessEntity'
    CreditCardAccessType:
      title: CreditCardAccessType
      type: string
      description: >-
        Identifies the different ways the card can be used across an
        organization
      enum:
        - UNKNOWN_TYPE
        - CENTRALISED
        - INDIVIDUAL
        - PERSONAL
        - TMC
        - APPLICATION
        - ITINERARY
        - EVENTS
    DateRange:
      type: object
      description: Date range within which the virtual card can be charged.
      required:
        - startDate
        - endDate
      properties:
        startDate:
          $ref: '#/components/schemas/DateTimeLocal'
        endDate:
          $ref: '#/components/schemas/DateTimeLocal'
    DateTimeLocal:
      title: DateTimeLocal
      description: Local date and time represented in the ISO 8601 standard.
      type: object
      required:
        - iso8601
      properties:
        iso8601:
          type: string
          pattern: >-
            ^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9])(:([0-5][0-9]))?$
          example: 2017-07-21T17:32
    DateTimeOffset:
      title: DateTimeOffset
      description: ISO8601 UTC Date Time
      type: object
      required:
        - iso8601
      properties:
        iso8601:
          type: string
          pattern: >-
            ^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9])(:([0-5][0-9]))?(Z|([+-](0[0-9]|1[0-4]):([0-5][0-9])))$
          example: 2017-07-21T17:32Z
    Dimensions:
      type: object
      title: Dimensions
      description: Image dimensions ie width and height.
      properties:
        height:
          type: integer
          format: int32
          example: 120
        width:
          type: integer
          format: int32
          example: 240
    DirectBilling2:
      title: DirectBilling
      type: object
      description: Metadata for Direct Billing
      required:
        - vendorId
      properties:
        vendorId:
          type: string
          description: Unique vendor id/code
          example: ZI
        directBillingCode:
          type: string
          description: Direct billing code provided by the vendor
          example: '123456'
    DirectBillingWrapper2:
      type: object
      title: DirectBillingWrapper
      description: Wrapper for DirectBilling metadata
      required:
        - directBilling
      properties:
        directBilling:
          $ref: '#/components/schemas/DirectBilling2'
    ErrorParameter:
      type: object
      title: ErrorParameter
      description: Error parameter
      properties:
        name:
          type: string
          description: Parameter name
        value:
          type: string
          description: Parameter value
    ErrorResponse:
      type: object
      properties:
        debugIdentifier:
          type: string
          description: Link to debug the error internally.
        errorMessages:
          type: array
          items:
            type: object
            properties:
              errorCode:
                type: string
                description: Error code to identify the specific errors.
              message:
                type: string
                description: Message containing details of error.
              errorParameters:
                type: array
                description: Error message parameters.
                items:
                  $ref: '#/components/schemas/ErrorParameter'
              errorDetail:
                type: string
                description: More details about the error.
    Expiry:
      title: Expiry
      type: object
      description: Contains the expiry of a Card.
      required:
        - expiryMonth
        - expiryYear
      properties:
        expiryMonth:
          type: integer
          format: int32
          minimum: 1
          maximum: 12
          description: Expiry month
          example: 1
        expiryYear:
          type: integer
          format: int32
          description: Expiry year
          minimum: 2000
          example: 2010
    ExpiryWrapper:
      type: object
      title: ExpiryWrapper
      properties:
        expiry:
          $ref: '#/components/schemas/Expiry'
    FailureDetails:
      type: object
      title: FailureDetails
      description: Failure details
      properties:
        failureCode:
          type: string
          description: failure code
          enum:
            - FAILURE_CODE_UNKNOWN
            - PAYMENT_METHOD_MISSING
            - PAYMENT_GATEWAY_FAILURE
        failureMessage:
          type: string
          description: failure message
    FormOfPayment:
      title: Form of Payment
      description: Information about form of payment to be used to charge customer
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - UNKNOWN
            - CARD
            - CASH
            - TFPAY
            - CHEQUE
            - BREX_POINTS
            - QANTAS_POINTS
          title: PaymentType
          description: Type of payment used
          example: CARD
          deprecated: true
        card:
          description: >-
            The payment card to be used to charge customer. This is only set if
            the payment type is 'CARD'
          $ref: '#/components/schemas/Card'
        additionalInfo:
          type: string
          description: Additional info to be added if payment type is 'UNKNOWN'.
        accessType:
          $ref: '#/components/schemas/CreditCardAccess'
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
          description: Payment method used to pay for this transaction
        paymentMetadata:
          $ref: '#/components/schemas/PaymentMetadata'
        paymentSourceType:
          $ref: '#/components/schemas/PaymentSourceType'
    GatewayIdentifier:
      type: object
      properties:
        gatewayId:
          type: string
          description: Gateway Id for which the payment method should be verified.
        gatewayType:
          type: string
          description: Gateway Type for of the verification gateway.
          enum:
            - PAYMENT_GATEWAY_UNKNOWN
            - STRIPE
            - BREX
            - RAZORPAY
    Image:
      type: object
      title: Image
      description: >-
        An image with meta data. Either the `data` or `url` property must be
        supplied to load the image.
      properties:
        data:
          type: string
          format: byte
          example: 6935813e12584abda0e43d71cd2ea260
        dimensions:
          $ref: '#/components/schemas/Dimensions'
        url:
          type: string
          example: >-
            https://static.wixstatic.com/media/73f2e2_6935813e12584abda0e43d71cd2ea260~mv2.png/v1/fill/w_630,h_94,al_c,q_85,usm_0.66_1.00_0.01/Spotnana%403x.webp
    Latlng:
      title: Latlng
      description: Latitude and Longitude for a Location
      type: object
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          description: Latitude of the Location
          format: double
          example: 77.1025
        longitude:
          type: number
          description: Longitude of the Location
          format: double
          example: 28.7041
    ListServiceChargesRequest:
      type: object
      title: ListServiceChargesRequest
      description: Request for list service charges.
      properties:
        serviceType:
          $ref: '#/components/schemas/ServiceType'
          description: Type of service charge (Optional).
    ListServiceChargesResponse:
      type: object
      title: ListServiceChargesResponse
      description: Response for list service charges.
      properties:
        serviceCharges:
          type: array
          description: List of service charges.
          items:
            $ref: '#/components/schemas/ServiceChargeRecord'
    Money:
      type: object
      title: Money
      description: >
        Money object containing details such as the amount, the currency code,
        and the converted amount.
      required:
        - amount
        - currencyCode
      properties:
        amount:
          type: number
          format: double
          description: The numeric value for the amount of money.
          example: 510
        currencyCode:
          type: string
          description: >-
            The 3-letter currency code for the money amount (defined using ISO
            4217 standard).
          example: GBP
        convertedAmount:
          type: number
          format: double
          description: >
            The converted currency and amount that has been converted (if a
            currency conversion has been requested).

            For example, if the call requests that money be sent in a specified
            currency (because the frontend requested

            the backend to send money in the user's preferred currency).
          example: 715.42
        convertedCurrency:
          type: string
          description: >-
            The 3-letter currency code for the converted currency (defined using
            ISO 4217 standard).
          example: USD
        otherCoinage:
          type: array
          title: OtherCoinage
          description: >-
            List of the dollar amount in other coinage systems like reward
            points, cryptocurrency etc.
          items:
            type: object
            properties:
              coinageCode:
                $ref: '#/components/schemas/PaymentMethod'
                description: Payment method
              amount:
                type: number
                format: double
                example: 1000
              conversionRate:
                type: number
                format: double
                description: 1 coin in this system equals to how many currency value
                example: 0.01
              preferredCurrencyConversionRate:
                type: number
                format: double
                description: 1 coin in this system equals to how many currency value
                example: 0.01
    NonBillableReason:
      type: object
      title: NonBillableReason
      description: Reason for non-billable agent contact.
      required:
        - reasonCode
      properties:
        reasonCode:
          $ref: '#/components/schemas/NonBillableReasonCode'
          description: Reason code for non-billable agent contact.
          example: MINOR_REQUEST
        notes:
          type: string
          description: Notes for non-billable agent contact.
          example: Waived off
    NonBillableReasonCode:
      type: string
      title: NonBillableReasonCode
      description: Reason code for non-billable agent contact.
      enum:
        - PRODUCT_ISSUE
        - ALREADY_CHARGED
        - CUSTOMER_GOODWILL
        - MINOR_REQUEST
        - NON_BILLABLE_REASON_OTHER
    OrganizationAgencyId:
      type: object
      title: OrganizationAgencyId
      description: Agency id for the organization.
      deprecated: true
      required:
        - id
      properties:
        id:
          type: string
    OrganizationId:
      type: object
      title: OrganizationId
      description: Organization id for traveler.
      required:
        - id
      properties:
        id:
          type: string
    PaymentMetadata:
      title: PaymentMetadata
      description: Payment metadata related to form of payment
      type: object
      properties:
        customPaymentMethodMetadata:
          type: object
          description: Metadata related to custom payment method
          properties:
            brexBudgetMetadata:
              type: object
              description: Metadata for Brex Budget
              properties:
                budgetName:
                  type: string
                  description: Name of the budget
                  example: Travel budget
                paidByPersonalCard:
                  type: boolean
                  description: Whether it was paid by budget card or personal card
                  example: false
        vendorProgramPaymentMetadata:
          $ref: '#/components/schemas/VendorProgramPaymentMetadata2'
        virtualCardMetadata:
          $ref: '#/components/schemas/VirtualCardPaymentMetadata'
        cardMetadata:
          $ref: '#/components/schemas/CardMetadata2'
    PaymentMethod:
      type: string
      description: Payment method
      enum:
        - PAYMENT_METHOD_UNKNOWN
        - CREDIT_CARD
        - BREX_POINTS
        - CASH
        - QANTAS_POINTS
        - VENDOR_PROGRAM_PAYMENT
        - DELAYED_INVOICING
        - FLIGHT_CREDITS
        - QANTAS_TRAVEL_FUND
      example: BREX_POINTS
    PaymentSourceType:
      type: string
      description: Type of Payment Source
      enum:
        - CARD
        - VIRTUAL_CARD
        - REWARDS_PROGRAM
        - DELAYED_INVOICING
        - CUSTOM_PAYMENT_METHOD
        - VENDOR_PROGRAM_PAYMENT
        - UNUSED_CREDIT
        - CASH
    PaymentStatus:
      type: string
      title: PaymentStatus
      description: Payment status.
      enum:
        - SUCCESS
        - DELAYED_INVOICE
        - MANUAL
        - NO_CHARGE
    PaymentTransaction:
      type: object
      title: PaymentTransaction
      description: Payment Transaction
      properties:
        gatewayIdentifier:
          description: Gateway Identifier
          $ref: '#/components/schemas/GatewayIdentifier'
        paymentReference:
          type: string
          description: payment reference
        networkTransactionId:
          type: string
          description: Network Transaction Id
    PostalAddress:
      title: PostalAddress
      description: Postal Address Details
      type: object
      required:
        - addressLines
        - regionCode
      properties:
        addressLines:
          description: Address lines
          type: array
          items:
            type: string
            example: Golden Gate Bridge
        administrativeArea:
          type: string
          description: >
            Code of administrative area. For example: DL for Delhi, India.

            Highest administrative subdivision which is used for postal

            addresses of a country or region.

            For example, this can be a state, a province, an oblast, or a
            prefecture.

            Specifically, for Spain this is the province and not the autonomous

            community (e.g. "Barcelona" and not "Catalonia").

            Many countries don't use an administrative area in postal addresses.
            E.g.

            in Switzerland this should be left unpopulated.
          example: CA
        administrativeAreaName:
          type: string
          description: >
            Name of administrative area. This is full name corresponding to
            administrativeArea. 

            Like Delhi for DL area code. For some places, code and name maybe
            same as well like Tokyo.
          example: California
        description:
          description: Address description
          type: string
          example: San Francisco Home
        isDefault:
          description: >-
            Whether this address is default address in case multiple addresses
            are specified.
          type: boolean
          example: true
        languageCode:
          description: >
            BCP-47 language code of the contents of this address (if known).
            This is often the UI 

            language of the input form or is expected to match one of the
            languages used in the 

            address' country/region, or their transliterated equivalents.

            This can affect formatting in certain countries, but is not critical
            to the correctness 

            of the data and will never affect any validation or other
            non-formatting related operations.

            Examples: "zh-Hant", "ja", "ja-Latn", "en".
          type: string
          example: en
        locality:
          description: Generally refers to the city/town portion of the address.
          type: string
          example: San Francisco
        locationCode:
          description: >-
            IATA 3-letter location code. See
            https://www.iata.org/en/services/codes.
          type: string
          example: LAX
        organization:
          description: The name of the organization at the address.
          type: string
          example: Spotnana
        postalCode:
          description: >-
            Postal code of the address. This is a required field when setting
            for a user/legal entity/company etc.
          type: string
          example: '94130'
        continentCode:
          description: 2 letter continent code of the continent this address falls in.
          type: string
          example: AF
        recipients:
          description: The recipient at the address.
          type: array
          items:
            type: string
        regionCode:
          description: Region code of the country/region of the address.
          type: string
          example: US
        regionName:
          description: Region name of the country/region of the address.
          type: string
          example: America
        revision:
          type: integer
          format: int32
          example: 1
        sortingCode:
          description: >
            Additional, country-specific, sorting code. This is not used

            in most regions. Where it is used, the value is either a string like

            "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a
            number

            alone, representing the "sector code" (Jamaica), "delivery area
            indicator"

            (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
          type: string
          example: Jamaica
        sublocality:
          description: >-
            Sublocality of the address. This can be neighborhoods, boroughs,
            districts.
          type: string
        timezone:
          description: Time zone of the address.
          type: string
          example: America/Los_Angeles
        coordinates:
          description: Map coordinates of the address.
          $ref: '#/components/schemas/Latlng'
    PrimaryServiceProviderTmc:
      type: object
      title: PrimaryServiceProviderTmc
      description: Primary service provider TMC info
      required:
        - tmcId
      properties:
        tmcId:
          $ref: '#/components/schemas/CompanyId'
          description: Id of the service provider TMC.
    SecondaryServiceProviderTmc:
      type: object
      title: SecondaryServiceProviderTmc
      description: Secondary service provider TMC info
      required:
        - tmcId
        - supplier
        - travelType
      properties:
        tmcId:
          $ref: '#/components/schemas/CompanyId'
          description: Id of the service provider TMC.
        supplier:
          $ref: '#/components/schemas/SupplierType'
          description: Supplier for which this service provider should be used.
        travelType:
          $ref: '#/components/schemas/TravelType'
          description: Travel type for which this service provider should be used.
    ServiceCharge:
      type: object
      title: ServiceCharge
      description: Service charge.
      required:
        - amount
        - taxes
        - totalAmount
      properties:
        amount:
          $ref: '#/components/schemas/Money'
          description: Service charge amount.
        taxes:
          type: array
          description: Applicable taxes.
          items:
            $ref: '#/components/schemas/TaxAmount'
        totalAmount:
          $ref: '#/components/schemas/Money'
          description: Total amount (including taxes).
        allowedFoP:
          type: array
          deprecated: true
          description: List of allowed payment methods for this charge.
          items:
            $ref: '#/components/schemas/PaymentMethod'
    ServiceChargeEntity:
      type: object
      title: ServiceChargeEntity
      description: Entity for service charge.
      required:
        - entityType
        - entityId
      properties:
        entityType:
          $ref: '#/components/schemas/ServiceChargeEntityType'
          description: Entity type for service charge.
          example: TRIP
        entityId:
          type: string
          description: Entity ID for service charge e.g, trip ID for entityType=TRIP.
          example: '1234567890'
    ServiceChargeEntityType:
      type: string
      title: ServiceChargeEntityType
      description: Entity type for service charge.
      enum:
        - TRIP
        - USER
    ServiceChargeRecord:
      type: object
      title: ServiceChargeRecord
      description: Service charge record.
      required:
        - entity
        - serviceChargeType
        - serviceType
        - charge
        - transactionTime
        - paymentStatus
      properties:
        entity:
          $ref: '#/components/schemas/ServiceChargeEntity'
          description: Entity for service charge.
        tripId:
          type: string
          description: Trip ID (if applicable).
          example: '1234567890'
          deprecated: true
        serviceChargeType:
          $ref: '#/components/schemas/ServiceChargeType'
          description: Type of service charge.
          example: TMC_CHARGE
        serviceType:
          $ref: '#/components/schemas/ServiceType'
          description: Type of service.
          example: AGENT_CONTACT
        agentContact:
          $ref: '#/components/schemas/AgentContact'
          description: Agent contact details if serviceType is AGENT_CONTACT.
        charge:
          $ref: '#/components/schemas/ServiceCharge'
          description: Service charge.
        transactionTime:
          $ref: '#/components/schemas/DateTimeOffset'
          description: Transaction date and time.
        paymentStatus:
          $ref: '#/components/schemas/PaymentStatus'
          description: Payment status.
        userOrgId:
          $ref: '#/components/schemas/UserOrgId'
          description: User org details.
        bookingDetails:
          $ref: '#/components/schemas/BookingDetails'
          description: Booking details.
        fop:
          $ref: '#/components/schemas/FormOfPayment'
          description: Form of payment for the service charge.
        paymentTransaction:
          $ref: '#/components/schemas/PaymentTransaction'
          description: Payment transaction details.
        failureDetails:
          $ref: '#/components/schemas/FailureDetails'
          description: Failure details.
    ServiceChargeType:
      type: string
      title: ServiceChargeType
      description: >
        Type of service charge. TMC_CHARGE: Service charge for a service charged
        by the TMC.
      enum:
        - TMC_CHARGE
    ServiceType:
      type: string
      title: ServiceType
      description: >
        Type of service for service charge. ITINERARY_BOOKING: Service charge
        for travel booking. AGENT_CONTACT: Service charge for agent contact.
      enum:
        - ITINERARY_BOOKING
        - AGENT_CONTACT
    SupplierType:
      type: string
      description: Supplier type like Sabre, TravelFusion etc.
      enum:
        - SABRE
        - AMADEUS
        - TRAVEL_FUSION
        - FARELOGIX_NDC
        - ATPCO_NDC
        - TRAINLINE
        - AVIA
        - QBR
        - BCD
        - QANTAS_HOTELS
        - SOUTHWEST
        - EXPEDIA
        - HOTEL_HUB
        - NDC
        - MARRIOTT
        - CLEARTRIP
        - KYTE
        - GROUNDSPAN
        - SABRE_NDC
      example: SABRE
    TaxAmount:
      type: object
      title: Tax
      description: Tax
      required:
        - amount
        - taxCode
        - description
      properties:
        amount:
          $ref: '#/components/schemas/Money'
        taxCode:
          type: string
          description: Tax code
          example: VAT
        description:
          type: string
          description: Tax code
        percentage:
          type: number
          format: double
          description: Amount
          example: 10
    TmcBasicInfo:
      type: object
      title: TmcBasicInfo
      description: TMC related basic information.
      required:
        - contractingTmc
        - bookingTmc
      properties:
        contractingTmc:
          $ref: '#/components/schemas/CompanyRef'
          description: Contracting TMC is the TMC the user/organization contracted.
        bookingTmc:
          $ref: '#/components/schemas/CompanyRef'
          description: >-
            Booking TMC is the TMC used for the bookings for the
            user/organization.
    TmcInfo:
      type: object
      title: TmcInfo
      description: TMC config information.
      required:
        - id
        - primaryServiceProviderTmc
      properties:
        id:
          $ref: '#/components/schemas/CompanyId'
          description: TMC id.
        primaryServiceProviderTmc:
          $ref: '#/components/schemas/PrimaryServiceProviderTmc'
          description: Primary service provider TMC for the TMC.
        secondaryServiceProviderTmcs:
          type: array
          description: Secondary service provider TMCs for the TMC.
          items:
            $ref: '#/components/schemas/SecondaryServiceProviderTmc'
        partnerTmcId:
          $ref: '#/components/schemas/CompanyId'
          description: Useful to identify the clients onboarded by a PARTNER_TMC
    TokenizedExpiry:
      title: TokenizedExpiry
      type: object
      description: Contains the tokenized expiry of a Card.
      required:
        - expiryMonth
        - expiryYear
      properties:
        expiryMonth:
          type: string
          description: Tokenized Expiry month
          example: KvAuPANQWCpjwRQxcC8EXg==
        expiryYear:
          type: string
          description: Tokenized Expiry year
          example: fPBm0OWrKwPyIrCVcbg4cA==
    TokenizedExpiryWrapper:
      type: object
      title: TokenizedExpiryWrapper
      properties:
        tokenizedExpiry:
          $ref: '#/components/schemas/TokenizedExpiry'
    TravelType:
      type: string
      title: TravelType
      description: Travel Type
      enum:
        - AIR
        - HOTEL
        - CAR
        - RAIL
        - LIMO
        - MISC
        - ALL
      example: AIR
    UAPassPlusMetadataExternal:
      type: object
      title: UAPassPlusMetadata
      description: Details for UAPassPlus Metadata.
      properties:
        uatpInfo:
          type: object
          title: uatpInfo
          description: UATP card information for UAPassPlus
    UAPassPlusMetadataWrapperExternal:
      type: object
      title: UAPassPlusMetadataResponseWrapper
      description: Wrapper for UAPassPlus response metadata
      required:
        - uaPassPlusMetadata
      properties:
        uaPassPlusMetadata:
          $ref: '#/components/schemas/UAPassPlusMetadataExternal'
    UserId:
      type: object
      title: UserId
      description: User identifier
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
    UserOrgId:
      type: object
      title: UserOrgId
      description: User and user's organization information.
      required:
        - userId
        - organizationId
      properties:
        organizationAgencyId:
          $ref: '#/components/schemas/OrganizationAgencyId'
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        userId:
          $ref: '#/components/schemas/UserId'
        tmcInfo:
          $ref: '#/components/schemas/TmcInfo'
          deprecated: true
        tmcBasicInfo:
          $ref: '#/components/schemas/TmcBasicInfo'
    VendorProgramPaymentMetadata2:
      type: object
      title: VendorProgramPaymentMetadata
      description: Metadata related to vendor program payment method
      oneOf:
        - $ref: '#/components/schemas/DirectBillingWrapper2'
        - $ref: '#/components/schemas/UAPassPlusMetadataWrapperExternal'
    VirtualCardInfo:
      type: object
      title: VirtualCardInfo
      description: >-
        Virtual card information like maximum deployment amount, valid date
        range.
      properties:
        amount:
          description: >-
            Virtual card deployment amount. This amount will drive the maximum
            authorisation value permitted on the virtual card.
          $ref: '#/components/schemas/Money'
        dateRange:
          description: Date range within which the virtual card can be charged.
          $ref: '#/components/schemas/DateRange'
    VirtualCardPaymentMetadata:
      title: VirtualCardPaymentMetadata
      type: object
      description: Metadata for Virtual Card.
      required:
        - vendorInfo
      properties:
        vendorInfo:
          $ref: '#/components/schemas/VirtualCardVendorInfo'
        cardInfo:
          $ref: '#/components/schemas/VirtualCardInfo'
        paymentInstructionId:
          type: string
          description: >-
            Payment instruction id set during addition of virtual card payment
            source
          example: 1eb8b778-f0a6-4037-865c-4580982fa36e
        shouldReveal:
          type: boolean
          description: >-
            Identifier for when to reveal virtual cards as they are revealed to
            travellers only 24hrs before check-in.
          example: false
    VirtualCardVendor:
      type: string
      description: Type of Virtual card vendor
      enum:
        - CONFERMA
      example: CONFERMA
    VirtualCardVendorInfo:
      type: object
      title: VirtualCardVendorInfo
      description: >-
        Virtual card related information like vendor, cardId, card-pool id of
        vendor etc.
      required:
        - vendorCardId
        - virtualCardVendorCardPoolId
      properties:
        vendor:
          $ref: '#/components/schemas/VirtualCardVendor'
        vendorCardId:
          type: string
          description: Virtual card id.
          example: '68793680'
        virtualCardVendorCardPoolId:
          type: string
          description: Card pool id of virtual card vendor.
          example: '51907'
        confermaInfo:
          $ref: '#/components/schemas/ConfermaInfo'
tags:
  - name: Payments
    description: APIs related to Payments and Fees.
paths:
  /v2/service-charge/{entityType}/{entityId}/types/{type}/list:
    parameters:
      - name: entityType
        in: path
        description: Entity type for service charge
        required: true
        schema:
          $ref: '#/components/schemas/ServiceChargeEntityType'
          example: TRIP
      - name: entityId
        in: path
        description: Entity ID for service charge e.g. trip ID for entityType = TRIP
        required: true
        schema:
          type: string
          example: '1234567890'
      - name: type
        in: path
        description: Service charge type.
        required: true
        schema:
          $ref: '#/components/schemas/ServiceChargeType'
          example: TMC_CHARGE
    post:
      tags:
        - Service Charge
      summary: List service charges
      description: List service charges for a given entity
      operationId: listServiceCharges
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListServiceChargesRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListServiceChargesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
