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

# Reply to AWB Stock Request

> Airline replies to an AWB stock request with approval/rejection and allocation details

Airline replies to an AWB stock request with approval/rejection and allocation details.

<ParamField status="200" type="AWBStockReplyResponse">
  <ParamField name="requestId" type="string">
    Unique request identifier
  </ParamField>

  <ParamField name="status" type="string">
    Updated request status after reply
  </ParamField>

  <ParamField name="allocatedStock" type="integer">
    Number of AWB stock units allocated
  </ParamField>

  <ParamField name="startNumber" type="string">
    Starting AWB number in allocated range
  </ParamField>

  <ParamField name="endNumber" type="string">
    Ending AWB number in allocated range
  </ParamField>

  <ParamField name="validFrom" type="string" format="date">
    Validity start date for allocated stock
  </ParamField>

  <ParamField name="validTo" type="string" format="date">
    Validity end date for allocated stock
  </ParamField>

  <ParamField name="repliedAt" type="string" format="date-time">
    Timestamp when the reply was submitted
  </ParamField>

  <ParamField name="notes" type="string">
    Additional notes from the airline
  </ParamField>
</ParamField>

<ParamField status="400" type="AWBStockReplyErrorResponse">
  <ParamField name="error" type="string">
    Error code indicating validation failure
  </ParamField>

  <ParamField name="errorDescription" type="string">
    Human-readable error description
  </ParamField>

  <ParamField name="errorUri" type="string">
    Link to error documentation
  </ParamField>

  <ParamField name="validationErrors" type="array">
    Array of specific validation errors

    <ParamField name="field" type="string">
      Field name that failed validation
    </ParamField>

    <ParamField name="message" type="string">
      Validation error message
    </ParamField>

    <ParamField name="code" type="string">
      Error code for the validation failure
    </ParamField>
  </ParamField>
</ParamField>

<ParamField status="401" type="OAuthErrorResponse">
  <ParamField name="error" type="string">
    Error code (e.g., 'invalid\_client', 'invalid\_grant')
  </ParamField>

  <ParamField name="errorDescription" type="string">
    Human-readable error description
  </ParamField>

  <ParamField name="errorUri" type="string">
    Link to error documentation
  </ParamField>
</ParamField>

### Reference Documentation

<Info>
  For more information on AWB stock assignment and management, please refer to:

  * Pages 13, 32-33 of "Functional\_Requirements\_V18 FINAL": [https://belli.sg/4nxxCDR](https://belli.sg/4nxxCDR)
</Info>


## OpenAPI

````yaml PUT /api/awb-stock/reply/{requestId}
openapi: 3.0.3
info:
  title: Mock API
  version: 1.0.0
  description: >-
    Mock OpenAPI spec for QR API Service. All endpoints require API key
    authentication via 'Authorization: Bearer <token>' or 'x-api-key: <token>'
    headers.
servers:
  - url: https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io
    description: Production server
security:
  - ApiKeyAuth: []
  - ApiKeyHeader: []
tags:
  - name: auth-v1
    description: Authentication and user management
  - name: reference-data-v1
    description: Reference data and master data
  - name: flights-v1
    description: Flight schedules and capacity
  - name: quotes-v1
    description: Quotation and pricing
  - name: awb-stock-v1
    description: AWB Stock Management
  - name: bookings-v1
    description: Booking management
  - name: shipments-v1
    description: Shipment documents and tracking
  - name: compliance-v1
    description: Compliance and safety declarations
  - name: operations-v1
    description: Operational events and manifests
  - name: webhooks-v1
    description: Webhook management
  - name: admin-v1
    description: Administrative and audit functions
  - name: qr-exp-cgo-ext-availability-v1
    description: Legacy availability service
  - name: qr-exp-cgo-ext-booking-v1
    description: Legacy booking service
  - name: qr-exp-cgo-ext-flight-schedules-v1
    description: Legacy flight schedules service
  - name: qr-exp-cgo-shipments-v1
    description: Legacy shipments service
  - name: qr-exp-cgo-stock-v1
    description: Legacy stock service
  - name: qr-exp-cgo-tables-v1
    description: Legacy table data service
paths:
  /api/awb-stock/reply/{requestId}:
    put:
      tags:
        - awb-stock-v1
      summary: Reply to AWB stock request
      description: >-
        Airline replies to an AWB stock request with approval/rejection and
        allocation details
      parameters:
        - name: requestId
          in: path
          required: true
          schema:
            type: string
          description: Unique request identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AWBStockReplyRequest'
      responses:
        '200':
          description: Reply submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AWBStockReplyResponse'
        '400':
          description: Invalid reply data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AWBStockReplyErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorResponse'
components:
  schemas:
    AWBStockReplyRequest:
      type: object
      properties:
        status:
          type: string
          enum:
            - approved
            - rejected
            - partially_approved
          example: approved
          description: Reply status for the AWB stock request
        allocatedStock:
          type: integer
          example: 100
          description: Number of AWB stock units allocated (0 if rejected)
        startNumber:
          type: string
          example: '157000001'
          description: Starting AWB number in allocated range (if approved)
        endNumber:
          type: string
          example: '157000100'
          description: Ending AWB number in allocated range (if approved)
        validFrom:
          type: string
          format: date
          example: '2024-01-15'
          description: Validity start date for allocated stock
        validTo:
          type: string
          format: date
          example: '2025-01-15'
          description: Validity end date for allocated stock
        notes:
          type: string
          example: Stock allocated as requested. Please ensure proper usage compliance.
          description: Additional notes from the airline
        rejectionReason:
          type: string
          example: Insufficient stock availability
          description: Reason for rejection (if status is rejected)
      required:
        - status
        - allocatedStock
        - validFrom
        - validTo
    AWBStockReplyResponse:
      type: object
      properties:
        requestId:
          type: string
          example: req-123456789
          description: Unique request identifier
        status:
          type: string
          enum:
            - approved
            - rejected
            - partially_approved
          example: approved
          description: Updated request status after reply
        allocatedStock:
          type: integer
          example: 100
          description: Number of AWB stock units allocated
        startNumber:
          type: string
          example: '157000001'
          description: Starting AWB number in allocated range
        endNumber:
          type: string
          example: '157000100'
          description: Ending AWB number in allocated range
        validFrom:
          type: string
          format: date
          example: '2024-01-15'
          description: Validity start date for allocated stock
        validTo:
          type: string
          format: date
          example: '2025-01-15'
          description: Validity end date for allocated stock
        repliedAt:
          type: string
          format: date-time
          example: '2024-01-15T14:30:00Z'
          description: Timestamp when the reply was submitted
        notes:
          type: string
          example: Stock allocated as requested. Please ensure proper usage compliance.
          description: Additional notes from the airline
      required:
        - requestId
        - status
        - allocatedStock
        - repliedAt
    AWBStockReplyErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        errorDescription:
          type: string
          example: Invalid AWB stock reply parameters
        errorUri:
          type: string
          example: https://docs.example.com/awb-stock/reply-errors
        validationErrors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: allocatedStock
              message:
                type: string
                example: Allocated stock must be between 0 and requested amount
              code:
                type: string
                example: INVALID_ALLOCATION
          example:
            - field: allocatedStock
              message: Allocated stock must be between 0 and requested amount
              code: INVALID_ALLOCATION
            - field: status
              message: 'Status must be one of: approved, rejected, partially_approved'
              code: INVALID_STATUS
    OAuthErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: invalid_grant
        errorDescription:
          type: string
          example: Invalid client credentials provided
        errorUri:
          type: string
          example: https://docs.example.com/oauth/errors
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````