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

# Update Package

> Update the a single package based on the ID supplied. This API should be used to activate and deactivate the package as well. Any changes that you do to the package will be reflected on all the next invoices (all the existing customers' next invoices will be calculated with the new price as well).



## OpenAPI

````yaml api-reference/openapiFiles/packages/Update/openapi.json put /packages/{_id}
openapi: 3.0.1
info:
  title: YJSG APIS
  description: >-
    A sample api that provides documentation for apis to be used by different
    integration partners.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.yourjobsearchgenius.ai/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /packages/{_id}:
    put:
      description: >-
        Update the a single package based on the ID supplied. This API should be
        used to activate and deactivate the package as well. Any changes that
        you do to the package will be reflected on all the next invoices (all
        the existing customers' next invoices will be calculated with the new
        price as well).
      parameters:
        - name: _id
          in: path
          description: ID of the customer to update (MongoDB ObjectId)
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            example: 507f1f77bcf86cd799439011
      requestBody:
        description: Data to update the package
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - isActive
              allOf:
                - type: object
                  properties:
                    isActive:
                      type: boolean
                      description: >-
                        Set to true to activate the package, set to false to
                        deactivate it.
                - $ref: '#/components/schemas/PackageBody'
              properties:
                name:
                  type: string
                  description: Name of the package
                price:
                  type: number
                  description: Price of the package
                interval:
                  type: string
                  description: Billing interval for the package
                freeTrialDays:
                  type: integer
                  description: Number of free trial days for the package
      responses:
        '200':
          description: Resource updated!
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Duplicate data!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PackageBody:
      type: object
      required:
        - name
        - price
        - interval
        - freeTrialDays
      properties:
        name:
          description: The name of the package.
          type: string
        price:
          description: The price of the package.
          type: integer
          format: int64
        interval:
          description: >-
            The billing interval for the package. Possible values: `Daily,
            Weekly, Bi-Weekly, Monthly, Quarterly, Yearly`.
          type: string
          enum:
            - Daily
            - Weekly
            - Bi-Weekly
            - Monthly
            - Quarterly
            - Yearly
        freeTrialDays:
          description: >-
            The number of free trial days. Send 0 if no free trial days. `Min:0,
            Max:7`.
          type: integer
          format: int64
          maximum: 7
          default: 0
          example: 7
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
          format: s
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````