asyncapi: 2.0.0
info:
  title: Buyer Question Notifications
  version: 1.0.0
  description: 'This contract defines the eBay notification for the BUYER_QUESTION topic. This notification is sent when a buyer asks a question about an active listing.'
channels:
  BUYER_QUESTION:
    subscribe:
      message:
        $ref: '#/components/messages/message'
      bindings:
        http:
          type: request
          method: POST
          headers:
            type: object
            properties:
              Content-Type:
                type: string
                enum: ['application/json']
components:
  messages:
    message:
      headers:
        type: object
        properties:
          X-EBAY-SIGNATURE:
            description: 'The ECC message signature. This signature is used to process and validate the message payload.'
            type: string
      payload:
        type: object
        properties:
          metadata:
            $ref: '#/components/schemas/MetaData'
          notification:
            $ref: '#/components/schemas/Notification'

  schemas:
    MetaData:
      type: object
      properties:
        topic:
          type: string
          description: 'The notification topic to which the user or application is subscribed.'
          example: 'BUYER_QUESTION'
        schemaVersion:
          type: string
          description: 'The schema version for the notification topic.'
        deprecated:
          type: boolean
          description: 'An indication regarding whether the schema version or topic is deprecated.'
          default: 'false'

    Notification:
      type: object
      properties:
        notificationId:
          type: string
          description: 'The unique identifier of the the actual notification sent.'
        eventDate:
          type: string
          description: 'The event date associated with the notification. This date is returned as a UTC-formatted timestamp.'
        publishDate:
          type: string
          description: 'The publish date for the notification message. This date is returned as a UTC-formatted timestamp.'
        publishAttemptCount:
          type: integer
          description: 'The number of attempts that have been made to publish this notification message.'
        data:
          $ref: '#/components/schemas/BuyerQuestionData'

    BuyerQuestionData:
      type: object
      description: 'The payload for the BUYER_QUESTION notification.'
      properties:
        messageId:
          type: string
          description: 'The unique identifier of the message.'
          example: '5498562796019'
        conversationId:
          type: string
          description: 'The unique identifier of the conversation.'
          example: '9394020427474'
        messageBody:
          type: string
          description: 'The body text of the message.'
          example: 'Is there a size standard?'
        listingId:
          type: string
          description: 'The unique identifier of the listing associated with the conversation.'
          example: '1234567'
        senderUserName:
          type: string
          description: 'The eBay username of the sender.'
        recipientUserName:
          type: string
          description: 'The eBay username of the recipient.'
        subject:
          type: string
          description: 'The subject of the message.'
        readStatus:
          type: boolean
          description: 'Indicates if the message has been read.'
          default: 'false'
        createdDate:
          type: string
          description: 'The date and time when the message was created, in ISO 8601 format.'
          example: '2025-04-21T08:16:20.000Z'
        messageMedia:
          type: array
          description: 'A list of media attachments associated with a message.'
          items:
            type: object
            properties:
              mediaName:
                type: string
                description: 'The name of the media attached to the message.'
              mediaUrl:
                type: string
                description: 'The URL of the self-hosted media attached to the message.'
              mediaType:
                type: string
                description: 'The type of media attached to the message. Supported values include: IMAGE, PDF, DOC, TXT. Additional values may be introduced in the future.'
                example: IMAGE
            
