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

# Cancel offer

> Cancels an offer. The offer must not already be in a resolved status (canceled, buyout accepted, order placed, or expired).



## OpenAPI

````yaml https://api.sibipro.com/offers/openapi.json post /{id}/cancel
openapi: 3.0.0
info:
  title: Offers API
  version: 1.0.0
  description: RESTful API for managing offers
servers:
  - url: https://api.sibipro.com/prod/offers
    description: API endpoint
security: []
paths:
  /{id}/cancel:
    post:
      summary: Cancel offer
      description: >-
        Cancels an offer. The offer must not already be in a resolved status
        (canceled, buyout accepted, order placed, or expired).
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the offer to cancel
      responses:
        '200':
          description: Offer canceled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOfferResponse'
        '400':
          description: Bad request - Offer is not in a cancelable state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                cancellationError:
                  value:
                    code: OFFER_CANCELLATION_ERROR
                    message: >-
                      Offer cannot be canceled because it is in "canceled"
                      status
        '401':
          description: Unauthorized - Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    code: UNAUTHORIZED
                    message: Missing authentication token
        '403':
          description: >-
            Forbidden - Caller can view this offer but is not allowed to cancel
            it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                permissionDenied:
                  value:
                    code: FORBIDDEN
                    message: User does not have permission to cancel this offer
        '404':
          description: Not found - Offer does not exist or caller is not allowed to view it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    code: OFFER_NOT_FOUND
                    message: Offer not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                serverError:
                  value:
                    code: INTERNAL_SERVER_ERROR
                    message: An unexpected error occurred
components:
  schemas:
    CancelOfferResponse:
      type: object
      properties:
        offerId:
          type: string
          description: Unique identifier for the canceled offer
          example: offer-123
        status:
          type: string
          description: Status of the offer after cancellation
          example: CANCELED
        canceledAt:
          type: string
          format: date-time
          description: Timestamp when the offer was canceled
          example: '2024-01-20T12:00:00Z'
      required:
        - offerId
        - status
        - canceledAt
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code indicating the type of error
        message:
          type: string
          description: Human-readable error message explaining what went wrong
          example: The request contains invalid parameters
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              error:
                type: string
            required:
              - field
              - error
          description: Detailed validation errors when applicable
          example:
            - field: customer.email
              error: Invalid email
            - field: address.postalCode
              error: Invalid
      required:
        - code
        - message

````