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

# Get refund rules for a booking

> Returns refund rules for each partner-owned order within a booking. Authenticated via the api-key header; data scoped to the caller's partner. Returns 404 when the booking does not exist or does not belong to the actor's partner. Fixes legacy defect 3 (IDOR) and defect 4 (500 on unknown ID).



## OpenAPI

````yaml /docs/openapi/openapi.json get /v2/bookings/{id}/refund-rules
openapi: 3.1.0
info:
  title: PREXSELL REST v2
  version: 5.97.1
  description: REST API for the PREXSELL bus booking management platform.
servers:
  - url: https://staging.api.prexsell.com
    description: Staging
  - url: https://api.prexsell.com
    description: Production
security: []
paths:
  /v2/bookings/{id}/refund-rules:
    get:
      tags:
        - Bookings
      summary: Get refund rules for a booking
      description: >-
        Returns refund rules for each partner-owned order within a booking.
        Authenticated via the api-key header; data scoped to the caller's
        partner. Returns 404 when the booking does not exist or does not belong
        to the actor's partner. Fixes legacy defect 3 (IDOR) and defect 4 (500
        on unknown ID).
      operationId: getBookingRefundRules
      parameters:
        - schema:
            type: string
            description: Booking identifier.
            example: bkg_1
          required: true
          description: Booking identifier.
          name: id
          in: path
      responses:
        '200':
          description: Refund rules for a booking.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      refundRules:
                        type: array
                        items:
                          type: object
                          properties:
                            orderId:
                              type: string
                              description: Order identifier.
                              example: ord_abc
                            rules:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  hours:
                                    description: >-
                                      Hours before departure at which this rule
                                      activates (Decimal → number). ADR recon
                                      area2 §5 — hours is Decimal, needs
                                      decimalToNumber like amount.
                                    example: 24
                                  amount:
                                    description: >-
                                      Refund amount for this rule (Decimal →
                                      number).
                                    example: 800
                                required:
                                  - id
                                description: A single refund rule.
                              description: >-
                                Refund rules for this order, ordered by hours
                                asc. Empty when no rules exist.
                          required:
                            - orderId
                            - rules
                          description: Refund rules for one order within the booking.
                        description: Per-order refund rules.
                    required:
                      - refundRules
                    description: Booking refund rules result.
                required:
                  - data
                example:
                  data:
                    refundRules:
                      - orderId: ord_abc
                        rules:
                          - id: rule_1
                            hours: 24
                            amount: 800
                          - id: rule_2
                            hours: 6
                            amount: 400
                      - orderId: ord_def
                        rules:
                          - id: rule_3
                            hours: 24
                            amount: 800
        '401':
          description: Standard error response body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          example: AUTH_INVALID_CREDENTIALS
                        errorCode:
                          type: string
                          example: UNAUTHORIZED
                        details: {}
                      required:
                        - message
                required:
                  - errors
                example:
                  errors:
                    - message: AUTH_INVALID_CREDENTIALS
                      errorCode: UNAUTHORIZED
        '404':
          description: Standard error response body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          example: AUTH_INVALID_CREDENTIALS
                        errorCode:
                          type: string
                          example: UNAUTHORIZED
                        details: {}
                      required:
                        - message
                required:
                  - errors
                example:
                  errors:
                    - message: RESOURCE_NOT_FOUND
                      errorCode: NOT_FOUND
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Partner API key, sent in the `x-api-key` request header. Required for
        bookable offer search and all booking operations. To obtain a key,
        register as a PREXSELL partner in the backoffice
        (backoffice.prexsell.com, or staging.backoffice.prexsell.com for
        staging) and contact support if you need help.

````