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

# Update Bonus

> Update an existing bonus.



## OpenAPI

````yaml PUT /v1/bonuses/{bonusId}
openapi: 3.1.0
info:
  title: PriceOS Public API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/bonuses/{bonusId}:
    put:
      summary: Update bonus
      description: Update an existing bonus.
      parameters:
        - schema:
            type: string
            format: uuid
            description: Bonus ID.
          required: true
          description: Bonus ID.
          name: bonusId
          in: path
        - schema:
            type: string
            description: API key from your PriceOS dashboard.
          required: true
          description: API key from your PriceOS dashboard.
          name: x-api-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  exclusiveMinimum: 0
                  description: Optional updated bonus amount.
                expiresAt:
                  type:
                    - integer
                    - 'null'
                  description: >-
                    Optional Unix timestamp (ms) when the bonus expires. Use
                    null to clear.
                reason:
                  type:
                    - string
                    - 'null'
                  description: Optional reason for the bonus. Use null to clear.
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties:
                    type: string
                  description: >-
                    Optional metadata for the bonus (string key/value pairs).
                    Use null to clear.
      responses:
        '200':
          description: Bonus updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  bonus:
                    type: object
                    properties:
                      bonusId:
                        type: string
                        format: uuid
                        description: Bonus ID.
                      featureKey:
                        type: string
                        description: Feature key.
                      amount:
                        type: number
                        description: Bonus amount.
                      remainingAmount:
                        type: number
                        description: Remaining bonus amount.
                      expiresAt:
                        type:
                          - integer
                          - 'null'
                        description: Unix timestamp (ms) when the bonus expires.
                      reason:
                        type:
                          - string
                          - 'null'
                        description: Bonus reason.
                      metadata:
                        type: object
                        additionalProperties:
                          type: string
                        description: Bonus metadata.
                      createdAt:
                        type: integer
                        description: Unix timestamp (ms) when the bonus was created.
                      updatedAt:
                        type: integer
                        description: Unix timestamp (ms) when the bonus was last updated.
                    required:
                      - bonusId
                      - featureKey
                      - amount
                      - remainingAmount
                      - createdAt
                      - updatedAt
                    description: Updated bonus.
                  counterRemaining:
                    type: number
                    description: Total remaining bonus amount for this customer + feature.
                required:
                  - bonus
                  - counterRemaining
                description: Bonus update result.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
      x-codeSamples:
        - lang: typescript
          label: Node.js
          source: >-
            import { PriceOS } from "priceos";

            import type { MyFeatures } from "./priceos.types";


            const priceos = new
            PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);


            const bonus = await priceos.bonuses.update({
              bonusId: "bonus_123",
              amount: 150,
              reason: "manual_adjustment",
            });
        - lang: bash
          label: cURL
          source: |-
            curl -X PUT "https://api.priceos.com/v1/bonuses/bonus_123" \
              -H "x-api-key: PRICEOS_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "amount": 150,
                "reason": "manual_adjustment"
              }'

````