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

# Edit Credit Definition

> A `PUT` to the `/credits/definitions/{definitionId}` endpoint allows your application to edit a specific Credit Definition.



## OpenAPI

````yaml put /v3/credits/definitions/{definition}
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/credits/definitions/{definition}:
    put:
      tags:
        - Credit Definition
      summary: Edit Credit Definition
      description: >-
        A `PUT` to the `/credits/definitions/{definitionId}` endpoint allows
        your application to edit a specific Credit Definition.
      operationId: credits.definitions.update
      parameters:
        - name: definition
          in: path
          required: true
          description: The definition ID
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCreditDefinition'
      responses:
        '200':
          description: '`CreditDefinition`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreditDefinition'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateCreditDefinition:
      type: object
      properties:
        name:
          type: string
        region_id:
          type:
            - integer
            - 'null'
        timezone:
          type: string
        period:
          type: integer
        period_type:
          type: string
          enum:
            - days
            - weeks
            - months
            - years
            - absolute_date
            - absolute_week
            - absolute_month
        absolute_expiry:
          type:
            - string
            - 'null'
        release_period:
          type:
            - integer
            - 'null'
        release_period_type:
          type:
            - string
            - 'null'
          enum:
            - days
            - weeks
            - months
            - years
            - absolute_date
            - absolute_week
            - absolute_month
        release_period_absolute_expiry:
          type:
            - string
            - 'null'
        is_published:
          type: boolean
        is_archived:
          type: boolean
        icon:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
          format: uri
        primary_colour:
          type:
            - string
            - 'null'
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
        secondary_colour:
          type:
            - string
            - 'null'
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
        description:
          type:
            - string
            - 'null'
        internal_notes:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        long_description:
          type:
            - string
            - 'null'
        terms_conditions:
          type:
            - string
            - 'null'
        earn_instructions:
          type:
            - string
            - 'null'
        meta:
          type:
            - array
            - 'null'
          items:
            type: string
        type:
          type: string
          enum:
            - gift_card
            - store_credit
            - refund
            - allowance
            - voucher
            - other
        value:
          type:
            - number
            - 'null'
        max_value:
          type:
            - number
            - 'null'
        currency:
          type:
            - string
            - 'null'
          pattern: ^[A-Z]+$
        require_creator:
          type: boolean
        require_assigned:
          type: boolean
        is_extendable:
          type: boolean
        is_assignable:
          type: boolean
        is_releasable:
          type: boolean
        is_reassignable:
          type: boolean
        require_security_code:
          type: boolean
        extend_days:
          type:
            - integer
            - 'null'
        credit_number_range_type:
          type:
            - string
            - 'null'
          enum:
            - sequential
            - random
            - other
        credit_number_range_start:
          type:
            - string
            - 'null'
          pattern: ^\d+$
        credit_number_range_end:
          type:
            - string
            - 'null'
          pattern: ^\d+$
        credit_number_length:
          type:
            - integer
            - 'null'
          minimum: 1
        security_code_type:
          type:
            - string
            - 'null'
          enum:
            - pin4
            - pin6
            - alnum6
            - other
        use_custom_numbers:
          type: boolean
        notify_schedule_offset:
          type:
            - integer
            - 'null'
        issue_target_id:
          type:
            - integer
            - 'null'
        expiry_target_id:
          type:
            - integer
            - 'null'
        release_target_id:
          type:
            - integer
            - 'null'
        remind_target_id:
          type:
            - integer
            - 'null'
        extend_target_id:
          type:
            - integer
            - 'null'
        notify_issue_offset_days:
          type:
            - integer
            - 'null'
        notify_issue_offset_hour:
          type:
            - integer
            - 'null'
        notify_remind_offset_days:
          type:
            - integer
            - 'null'
        notify_remind_offset_hour:
          type:
            - integer
            - 'null'
        tags:
          type: array
          items:
            type: string
        custom_fields:
          type: array
          items:
            type: object
            properties:
              namespace:
                type: string
              handle:
                type: string
              type:
                type: string
                enum:
                  - string
                  - integer
                  - float
                  - boolean
                  - json
                  - array
              value:
                type: string
            required:
              - namespace
              - handle
              - type
              - value
      title: UpdateCreditDefinition
    CreditDefinition:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        handle:
          type: string
        region_id:
          type:
            - integer
            - 'null'
        region:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
            handle:
              type: string
          required:
            - id
            - name
            - handle
        timezone:
          type:
            - string
            - 'null'
        period:
          type:
            - integer
            - 'null'
        period_type:
          type:
            - string
            - 'null'
        absolute_expiry:
          type:
            - string
            - 'null'
        release_period:
          type:
            - integer
            - 'null'
        release_period_type:
          type:
            - string
            - 'null'
        release_period_absolute_expiry:
          type:
            - string
            - 'null'
        is_published:
          type: boolean
        is_archived:
          type: boolean
        icon:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        primary_colour:
          type:
            - string
            - 'null'
        secondary_colour:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        internal_notes:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        long_description:
          type:
            - string
            - 'null'
        terms_conditions:
          type:
            - string
            - 'null'
        earn_instructions:
          type:
            - string
            - 'null'
        meta:
          type:
            - array
            - 'null'
          items: {}
        type:
          type: string
        value:
          type:
            - number
            - 'null'
        max_value:
          type:
            - number
            - 'null'
        currency_id:
          type:
            - integer
            - 'null'
        currency:
          type:
            - string
            - 'null'
        require_creator:
          type: boolean
        require_assigned:
          type: boolean
        is_extendable:
          type: boolean
        is_assignable:
          type: boolean
        is_releasable:
          type: boolean
        is_reassignable:
          type: boolean
        require_security_code:
          type: boolean
        extend_days:
          type:
            - integer
            - 'null'
        credit_number_range_type:
          type:
            - string
            - 'null'
        credit_number_range_start:
          type:
            - string
            - 'null'
        credit_number_range_end:
          type:
            - string
            - 'null'
        credit_number_length:
          type:
            - integer
            - 'null'
        security_code_type:
          type:
            - string
            - 'null'
        use_custom_numbers:
          type: boolean
        notify_schedule_offset:
          type:
            - integer
            - 'null'
        issue_target_id:
          type:
            - integer
            - 'null'
        expiry_target_id:
          type:
            - integer
            - 'null'
        release_target_id:
          type:
            - integer
            - 'null'
        remind_target_id:
          type:
            - integer
            - 'null'
        extend_target_id:
          type:
            - integer
            - 'null'
        notify_issue_offset_days:
          type:
            - integer
            - 'null'
        notify_issue_offset_hour:
          type:
            - integer
            - 'null'
        notify_remind_offset_days:
          type:
            - integer
            - 'null'
        notify_remind_offset_hour:
          type:
            - integer
            - 'null'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldRaw'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - handle
        - region_id
        - region
        - timezone
        - period
        - period_type
        - absolute_expiry
        - release_period
        - release_period_type
        - release_period_absolute_expiry
        - is_published
        - is_archived
        - icon
        - image_url
        - primary_colour
        - secondary_colour
        - description
        - internal_notes
        - short_description
        - long_description
        - terms_conditions
        - earn_instructions
        - meta
        - type
        - value
        - max_value
        - currency_id
        - currency
        - require_creator
        - require_assigned
        - is_extendable
        - is_assignable
        - is_releasable
        - is_reassignable
        - require_security_code
        - extend_days
        - credit_number_range_type
        - credit_number_range_start
        - credit_number_range_end
        - credit_number_length
        - security_code_type
        - use_custom_numbers
        - notify_schedule_offset
        - issue_target_id
        - expiry_target_id
        - release_target_id
        - remind_target_id
        - extend_target_id
        - notify_issue_offset_days
        - notify_issue_offset_hour
        - notify_remind_offset_days
        - notify_remind_offset_hour
        - tags
        - created_at
        - updated_at
      title: CreditDefinition
    Tag:
      type: string
      title: Tag
    CustomFieldRaw:
      type: object
      properties:
        name:
          type: string
        handle:
          type: string
        namespace:
          type: string
        value:
          type: string
        type:
          type: string
        custom_fieldable_type:
          type: string
        custom_fieldable_id:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        is_index:
          type: string
      required:
        - name
        - handle
        - namespace
        - value
        - type
        - custom_fieldable_type
        - custom_fieldable_id
        - created_at
        - updated_at
        - is_index
      title: CustomFieldRaw
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````