openapi: 3.0.0
info:
  title: Ticket API
  version: '1.0'
  description: Allow to add airline tickets to approved airline session.
servers:
  - url: https://test.placetopay.com/rest
paths:
  /ticket/search:
    post:
      summary: Search
      operationId: post-ticket-search
      responses:
        '200':
          description: Ticket search success response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                  data:
                    description: List of ticket.
                    type: array
                    items:
                      type: object
                      description: Ticket struct.
                      properties:
                        internalReference:
                          type: number
                          description: Internal itentificator for a given ticket.
                        ticket:
                          type: string
                          description: Ticket code.
                        issuedAt:
                          type: string
                          description: Ticket reservation date, The reservation date of the ticket must be equal to or maximum two weeks after the date of the transaction.
                        createdAt:
                          type: string
                          description: Ticket creation date.
                        updatedAt:
                          type: string
                          description: Ticket update date
                      required:
                        - internalReference
                        - ticket
                        - issuedAt
                        - createdAt
                        - updatedAt
                required:
                  - status
              examples:
                Success response:
                  value:
                    status:
                      status: OK
                      reason: '00'
                      message: The request has been successfully processed
                      date: '2020-09-03T19:17:55-05:00'
                    data:
                      - internalReference: 3034
                        ticket: '1235617070772'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3035
                        ticket: '1232324712332'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3036
                        ticket: '1233360112990'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3037
                        ticket: '1235224463546'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3038
                        ticket: '1236649339572'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3039
                        ticket: '1239864816982'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3040
                        ticket: '1238581495691'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3041
                        ticket: '1235076633680'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3042
                        ticket: '1235711376026'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
                      - internalReference: 3043
                        ticket: '1236404928190'
                        issuedAt: '2020-09-03'
                        createdAt: '2020-09-03 19:17:55'
                        updatedAt: '2020-09-03 19:17:55'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                required:
                  - status
              examples:
                Authentication fail:
                  value:
                    status:
                      status: FAILED
                      reason: 401
                      message: The authentication does not contains all the required parameters (login, tranKey, seed, nonce)
                      date: '2020-09-03T19:27:27-05:00'
                Bad request:
                  value:
                    status:
                      status: FAILED
                      reason: BR
                      message: You have provided a invalid internal reference
                      date: '2020-09-03T20:05:36-05:00'
      description: Get the list of tickets for a given approved session.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  $ref: '#/components/schemas/Auth'
                internalReference:
                  type: number
                  description: Internal session itentificator for a given transaction.
              required:
                - auth
                - internalReference
            examples:
              Success request:
                value:
                  auth:
                    login: aabbccdd1234567890aabbccdd123456
                    tranKey: ABC123example456trankey+789abc012def3456ABC=
                    nonce: NWY1MTg4ODhjMzFmOQ==
                    seed: '2020-09-03T19:21:28-05:00'
                  internalReference: 3557
          application/xml:
            schema:
              type: object
              properties: {}
          multipart/form-data:
            schema:
              type: object
              properties: {}
        description: Ticket search request
      parameters: []
    parameters: []
  /ticket/create:
    post:
      summary: ''
      operationId: post-ticket-create
      responses:
        '200':
          description: Tickets create success response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                  count:
                    type: number
                    description: Register create number.
                required:
                  - status
              examples:
                Success response:
                  value:
                    status:
                      status: OK
                      reason: '00'
                      message: The request has been successfully processed
                      date: '2020-09-03T20:00:53-05:00'
                    count: 3
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                required:
                  - status
              examples:
                Authentication fail:
                  value:
                    status:
                      status: FAILED
                      reason: 401
                      message: The authentication does not contains all the required parameters (login, tranKey, seed, nonce)
                      date: '2020-09-03T19:27:27-05:00'
                Bad request:
                  value:
                    status:
                      status: FAILED
                      reason: BR
                      message: You have provided a invalid internal reference
                      date: '2020-09-03T20:05:36-05:00'
      description: Allow add tickets for a given approved session.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  $ref: '#/components/schemas/Auth'
                tickets:
                  type: array
                  description: List of ticket.
                  items:
                    type: object
                    properties:
                      ticket:
                        type: string
                        description: Ticket code. the three first character for the ticket must be equal with the IATA prefix of the airline transaction.
                      issuedAt:
                        type: string
                        description: Ticket reservation date in format Y-m-d, The reservation date of the ticket must be equal to or maximum two weeks after the date of the transaction
                    required:
                      - ticket
                      - issuedAt
              required:
                - auth
                - tickets
            examples:
              Success request:
                value:
                  auth:
                    login: aabbccdd1234567890aabbccdd123456
                    tranKey: ABC123example456trankey+789abc012def3456ABC=
                    nonce: NWY1MTkxMTQ2YmI3Yw==
                    seed: '2020-09-03T19:57:56-05:00'
                  internalReference: 3563
                  tickets:
                    - ticket: '1234567890115'
                      issuedAt: '2020-09-03'
                    - ticket: '1234567890114'
                      issuedAt: '2020-09-03'
                    - ticket: '1234567890118'
                      issuedAt: '2020-09-03'
        description: Ticket create request
  /ticket/remove:
    post:
      summary: ''
      operationId: post-ticket-remove
      responses:
        '200':
          description: Tickets remove success response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                  count:
                    type: number
                required:
                  - status
              examples:
                Success Response:
                  value:
                    status:
                      status: OK
                      reason: '00'
                      message: The request has been successfully processed
                      date: '2020-09-03T20:46:30-05:00'
                    count: 10
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
              examples:
                Authentication fail:
                  value:
                    status:
                      status: FAILED
                      reason: 401
                      message: The authentication does not contains all the required parameters (login, tranKey, seed, nonce)
                      date: '2020-09-03T19:27:27-05:00'
                Bad Request:
                  value:
                    status:
                      status: FAILED
                      reason: BR
                      message: You have provided a invalid internal reference
                      date: '2020-09-03T20:05:36-05:00'
      description: Allow remove tickets for a given approved session.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth:
                  $ref: '#/components/schemas/Auth'
                tickets:
                  type: array
                  description: Array of ticket code.
                  items:
                    type: string
              required:
                - auth
                - tickets
            examples:
              Success request:
                value:
                  auth:
                    login: aabbccdd1234567890aabbccdd123456
                    tranKey: ABC123example456trankey+789abc012def3456ABC=
                    nonce: NWY1MTk5YmY3OTUwNQ==
                    seed: '2020-09-03T20:34:55-05:00'
                  internalReference: 3571
                  tickets:
                    - '1236819792095'
                    - '1234272229799'
                    - '1234760251968'
                    - '1232675218228'
                    - '1232459118609'
                    - '1232569662668'
                    - '1236367572980'
                    - '1238315951241'
                    - '1233389977785'
                    - '1236568039458'
components:
  schemas:
    Auth:
      title: Auth
      type: object
      description: |-
        Authentication struct following Web Services Security
        UsernameToken Profile 1.1

        https://www.oasis-open.org/committees/download.php/13392/wss-v1.1-spec-pr-UsernameTokenProfile-01.htm
      properties:
        login:
          type: string
          description: Site identificator.
        tranKey:
          type: string
          description: 'Transactional key with the given format: Base64(SHA-254(nonce + seed + trankey )).'
        nonce:
          type: string
          description: Random value generate for each request.
        seed:
          type: string
          description: 'Structure generation date in format: ISO 8601.'
      required:
        - login
        - tranKey
        - nonce
        - seed
    Status:
      title: Status
      type: object
      description: Operation status struct, indicate the current state of the operacion.
      properties:
        status:
          type: string
          description: Operation status.
        reason:
          type:
            - string
            - number
          description: Operaction reason status code.
        message:
          type: string
          description: Operation reason message.
        date:
          type: string
          description: Operation date.
      required:
        - status
        - reason
        - message
        - date
  securitySchemes: {}
tags: []
