> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devmob.app.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview Promotion

> Previews a promotion before checkout.



## OpenAPI

````yaml /api-reference/customer/openapi.json post /api/v1/customer/promotions/preview
openapi: 3.0.0
info:
  title: DEVMOB Customer API
  description: DEVMOB API
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: Address
    description: Customer addresses
  - name: Auth
    description: Authentication and token lifecycle
  - name: Benefit Program
    description: Fare benefit programs
  - name: Benefit Request
    description: Fare benefit requests and documents
  - name: Checkout
    description: Checkout creation and retrieval
  - name: Credit Grant
    description: Customer credits
  - name: Invite
    description: Invitation preview and acceptance
  - name: Notification
    description: Customer inbox notifications
  - name: Offering
    description: Trip offerings and seat maps
  - name: Order
    description: Customer orders
  - name: OTP
    description: One-time password flows
  - name: Payment
    description: Payments
  - name: Payment Method
    description: Saved payment methods
  - name: Point
    description: Point lookup
  - name: Profile
    description: Authenticated customer profile
  - name: Promotion
    description: Promotions
  - name: Routing
    description: Routing helpers
  - name: Session
    description: Authenticated sessions
  - name: Storage
    description: Storage uploads
  - name: Support
    description: Support cases
  - name: Ticket
    description: Customer tickets
  - name: Trip
    description: Customer trip access
  - name: Trip Review
    description: Trip reviews
paths:
  /api/v1/customer/promotions/preview:
    post:
      tags:
        - Promotion
      summary: Preview Promotion
      description: Previews a promotion before checkout.
      operationId: previewCustomerPromotion
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewPromotionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromotionPreview'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearer: []
        - bearer: []
components:
  schemas:
    PreviewPromotionRequest:
      type: object
      properties:
        promotionalId:
          type: string
          format: uuid
          nullable: true
          description: Promotion identifier
        promotionalCode:
          type: string
          nullable: true
          description: Promotion code
          example: PROMO-ROTA-10
        tickets:
          type: array
          items:
            $ref: '#/components/schemas/PromotionPreviewTicketInput'
          description: Tickets to evaluate
      required:
        - tickets
      description: Promotion preview payload. Provide promotionalId or promotionalCode.
    PromotionPreview:
      type: object
      properties:
        promotionalId:
          type: string
          format: uuid
          description: Promotion identifier
          example: 0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a
        code:
          type: string
          description: Promotion code
          example: PROMO-ROTA-10
        eligible:
          type: boolean
          description: Whether the promotion can be applied
        rejectionReason:
          type: string
          nullable: true
          description: Reason when the promotion is not eligible
        originalAmount:
          type: integer
          description: Original amount in cents
          example: 12000
        discountAmount:
          type: integer
          description: Discount amount in cents
          example: 1200
        finalAmount:
          type: integer
          description: Final amount in cents
          example: 10800
      required:
        - promotionalId
        - code
        - eligible
        - rejectionReason
        - originalAmount
        - discountAmount
        - finalAmount
      description: Promotion preview result.
    PromotionPreviewTicketInput:
      type: object
      properties:
        tripId:
          type: string
          format: uuid
          description: Trip identifier
          example: 0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a
        tripItineraryId:
          type: string
          format: uuid
          description: Trip itinerary identifier
          example: 0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a
        seatTypeId:
          type: string
          format: uuid
          description: Seat type identifier
          example: 0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a
        passengerId:
          type: string
          format: uuid
          nullable: true
          description: Passenger identifier
        price:
          type: integer
          description: Ticket price in cents
          example: 12000
      required:
        - tripId
        - tripItineraryId
        - seatTypeId
        - passengerId
        - price
      description: Ticket candidate used to preview a promotion.
    ValidationError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
          example: 400
        message:
          type: string
          description: Error message.
          example: Bad Request Error
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Validation code.
                example: invalid_type
              message:
                type: string
                description: Validation message.
                example: Required
              path:
                type: string
                description: Invalid field path.
                example: name
            required:
              - code
              - message
              - path
      required:
        - statusCode
        - message
        - errors
      description: Validation error response.
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
          example: 404
        error:
          type: string
          description: HTTP error name.
          example: Not Found
        message:
          type: string
          description: Machine-readable error code.
          example: resource.not_found
      required:
        - statusCode
        - error
        - message
      description: Domain error response.
  responses:
    BadRequestError:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    UnauthorizedError:
      description: Authentication required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFoundError:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ConflictError:
      description: State conflict.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````