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

# Create offer



## OpenAPI

````yaml https://api.sibipro.com/offers/openapi.json post /
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:
  /:
    post:
      summary: Create offer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfferRequest'
      responses:
        '201':
          description: Offer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfferResponse'
        '400':
          description: Bad request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validationError:
                  value:
                    code: VALIDATION_ERROR
                    message: Invalid input parameters
                    details:
                      - field: customer.email
                        error: Invalid email
                      - field: address.postalCode
                        error: Invalid
                invalidAddress:
                  value:
                    code: ADDRESS_PROCESSING_ERROR
                    message: The provided address is invalid or could not be found
                invalidSubBrandId:
                  value:
                    code: INVALID_SUB_BRAND_ID
                    message: The provided sub-brand ID is invalid or not found
        '401':
          description: Unauthorized - Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    code: UNAUTHORIZED
                    message: Missing authentication token
        '409':
          description: >-
            Conflict - an active offer already exists for the provided
            externalJobID. Retry with allowExistingOffer: true to confirm the
            duplicate is intentional.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateActiveOfferResponse'
              examples:
                duplicateActiveOffer:
                  value:
                    code: DUPLICATE_ACTIVE_OFFER
                    message: An active offer already exists for this job
                    existingOfferIds:
                      - _0hVkXc6QX8OzW6kBnoNg
        '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:
    CreateOfferRequest:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
        address:
          type: object
          properties:
            line1:
              type: string
              minLength: 1
              maxLength: 100
            line2:
              type: string
              minLength: 1
              maxLength: 100
            city:
              type: string
              minLength: 1
              maxLength: 100
            stateOrProvince:
              type: string
              minLength: 2
              maxLength: 2
            postalCode:
              type: string
              pattern: ^\d{5}(-\d{4})?$
          required:
            - line1
            - city
            - stateOrProvince
            - postalCode
          description: Delivery address details
          example:
            line1: 123 Main St
            line2: Apt 101
            city: Springfield
            stateOrProvince: IL
            postalCode: '62701'
        product:
          type: object
          properties:
            sku:
              type: string
              description: Product SKU
              example: GDF511PGRBB
            addons:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The id of an aggregate add-on group (e.g. Install,
                      Disposal). Use the parent group id from the `addOns` array
                      returned by GET /products/{sku}.
                  sku:
                    type: string
                    description: >-
                      The sku of an individual add-on product or recommended
                      part. Use the sku from the `recommendedParts` array
                      returned by GET /products/{sku}.
                  quantity:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                required:
                  - quantity
              description: >-
                Optional add-ons for the product. Each entry must specify at
                least one of id or sku. Use `id` for aggregate add-on groups
                (like Install or Disposal) and `sku` for individual recommended
                parts or add-on products.
              example:
                - id: install-aggregate-id
                  quantity: 1
                - sku: M007
                  quantity: 1
          required:
            - sku
          description: Replacement product and add-ons covered by warranty
          example:
            sku: GDF511PGRBB
            addons:
              - id: install-aggregate-id
                quantity: 1
              - sku: M007
                quantity: 1
              - sku: M021
                quantity: 1
        sendOfferImmediately:
          type: boolean
          default: true
          description: Whether to send the offer email immediately after creation
          example: true
        allowCommonCarrier:
          type: boolean
          default: true
          description: Whether to allow offers for common carrier delivery properties
          example: true
        externalJobID:
          type: string
        buyoutAmount:
          type: number
          minimum: 0
          description: >-
            Buyout amount in cents (e.g., 50000 = $500.00). Customer can opt to
            receive this amount instead of a replacement product.
          example: 50000
        includeUpsells:
          type: boolean
          default: true
          description: Whether to include upsells in the offer
          example: true
        allowExistingOffer:
          type: boolean
          default: false
          description: >-
            Creating an offer for an externalJobID that already has an active
            (pending or awaiting-customer) offer is rejected with
            DUPLICATE_ACTIVE_OFFER unless this is true, confirming the duplicate
            is intentional.
          example: false
        subBrandId:
          type: string
          description: >-
            The ID of the sub-brand used to determine customer-facing branding
            for the offer
      required:
        - customer
        - address
        - product
        - subBrandId
    OfferResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the offer
          example: testofferid
        address:
          type: object
          properties:
            line1:
              type: string
              minLength: 1
              maxLength: 100
            line2:
              type: string
              minLength: 1
              maxLength: 100
            city:
              type: string
              minLength: 1
              maxLength: 100
            stateOrProvince:
              type: string
              minLength: 2
              maxLength: 2
            postalCode:
              type: string
              pattern: ^\d{5}(-\d{4})?$
            country:
              type: string
              description: Country of the property address
              example: USA
          required:
            - line1
            - city
            - stateOrProvince
            - postalCode
            - country
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the offer was created
          example: '2024-01-20T12:00:00Z'
        customerOfferLink:
          type: string
          description: Link to allow the customer to authenticate and view the offer
        warnings:
          type: array
          items:
            type: string
          description: Warnings for the offer
          example:
            - >-
              This product is only available via common carrier delivery for the
              selected address.
      required:
        - id
        - address
        - createdAt
        - customerOfferLink
    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
    DuplicateActiveOfferResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - DUPLICATE_ACTIVE_OFFER
          description: An active offer already exists for the provided externalJobID
        message:
          type: string
          example: An active offer already exists for this job
        existingOfferIds:
          type: array
          items:
            type: string
          description: >-
            IDs of the active offers already associated with the externalJobID,
            most recent first
          example:
            - _0hVkXc6QX8OzW6kBnoNg
      required:
        - code
        - message
        - existingOfferIds
    Customer:
      type: object
      properties:
        firstName:
          type: string
          minLength: 1
          maxLength: 100
          description: First name of the customer
          example: John
        lastName:
          type: string
          minLength: 1
          maxLength: 100
          description: Last name of the customer
          example: Doe
        email:
          type: string
          format: email
          description: Valid email address of the customer
          example: john@example.com
        phone:
          type: string
          pattern: ^\+?[\d\s-()]{10,}$
          description: Customer contact phone number in international format
          example: +1 (123) 456-7890
      required:
        - firstName
        - lastName
        - email
        - phone

````