> ## 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.

# Accept offer buyout

> Accepts the buyout on an offer. The offer must be in "pending" or "awaiting_customer" status.



## OpenAPI

````yaml https://api.sibipro.com/offers/openapi.json post /{id}/accept-buyout
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:
  - bearerAuth: []
paths:
  /{id}/accept-buyout:
    post:
      summary: Accept offer buyout
      description: >-
        Accepts the buyout on an offer. The offer must be in "pending" or
        "awaiting_customer" status.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the offer to accept the buyout for
      responses:
        '200':
          description: Offer buyout accepted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptBuyoutResponse'
        '400':
          description: Bad request - Offer buyout could not be accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                offerBuyoutNotAllowed:
                  value:
                    code: OFFER_BUYOUT_NOT_ALLOWED
                    message: >-
                      Offer buyout cannot be accepted because it is in
                      "canceled" status
                offerBuyoutAcceptanceError:
                  value:
                    code: OFFER_BUYOUT_ACCEPTANCE_ERROR
                    message: Failed to accept offer buyout
        '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 accept
            it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                permissionDenied:
                  value:
                    code: FORBIDDEN
                    message: User does not have permission to accept 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:
    AcceptBuyoutResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the offer buyout was accepted successfully
          example: true
        acceptedAt:
          type: string
          format: date-time
          description: Timestamp when the offer buyout was accepted
          example: '2024-01-20T12:00:00Z'
      required:
        - success
        - acceptedAt
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token from the SIBI developer dashboard (developer.sibipro.com),
        sent as `Authorization: Bearer <token>`.

````