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

# Update offer credit amount

> Updates the credit amount on an offer. The offer must be in "pending" or "awaiting_customer" status.



## OpenAPI

````yaml https://api.sibipro.com/offers/openapi.json post /{id}/credit
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}/credit:
    post:
      summary: Update offer credit amount
      description: >-
        Updates the credit amount 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 update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOfferCreditRequest'
      responses:
        '200':
          description: Offer credit amount updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOfferCreditResponse'
        '400':
          description: Bad request - Offer credit could not be updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                offerCreditNotAllowed:
                  value:
                    code: OFFER_CREDIT_NOT_ALLOWED
                    message: >-
                      Offer credit cannot be updated because it is in "canceled"
                      status
                updateCreditAmountError:
                  value:
                    code: UPDATE_CREDIT_AMOUNT_ERROR
                    message: Failed to update offer credit amount
        '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 update
            it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                permissionDenied:
                  value:
                    code: FORBIDDEN
                    message: User does not have permission to update 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:
    UpdateOfferCreditRequest:
      type: object
      properties:
        creditAmount:
          type: integer
          minimum: 0
          description: >-
            Credit amount in cents (e.g., 10000 = $100.00). Must be a
            non-negative integer.
          example: 10000
      required:
        - creditAmount
    UpdateOfferCreditResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the credit amount was updated successfully
          example: true
        creditAmount:
          type: integer
          minimum: 0
          description: >-
            The credit amount that was persisted, in cents. Callers should
            verify this matches their request.
          example: 10000
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the credit amount was updated
          example: '2024-01-20T12:00:00Z'
      required:
        - success
        - creditAmount
        - updatedAt
    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

````