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

# Extend Reward

> A `POST` to the `/rewards/extend` endpoint allows your application to extend the expiry date of a Reward.

Extending a reward modifies the expiry date according to the specified parameters in the payload.
The Extend Reward endpoint allows developers to specify either an `extend_days` or `extend_date`

Provide an array of ID's and search the specified profile\_id for eligible rewards.
Each eligible reward will be extended according to either the `extend_days` or `extend_date`

| Attribute                 | Description                                                                                                                                                           |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `profile_id` `STRING`     | The profile ID containing the rewards to extend                                                                                                                       |
| `ids` `ARRAY`             | An array of reward id's. Each reward id specified will be extended.                                                                                                   |
| `extend_days` `INTEGER`   | The amount of days to extend. This will be added to the existing `expires_at` date to calculate the new expiry **Cannot be specified if an`extend_date` is provided** |
| `extend_date` `DATE-TIME` | This date-time string will replace the existing `expires_at` value \*\*Cannot be specified if`extend_days` is provided \*\*                                           |

<Warning>
  **Eligible Rewards for extension**

  Rewards can only be extended **once**
  This means the `extended_at` field must be null to be eligible for an extension
</Warning>


## OpenAPI

````yaml post /v3/rewards/extend
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/rewards/extend:
    post:
      tags:
        - Reward
      summary: Extend Reward
      description: >-
        A `POST` to the `/rewards/extend` endpoint allows your application to
        extend the expiry date of a Reward.
      operationId: reward.extend
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtendReward'
      responses:
        '200':
          description: Array of `Reward`
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Reward'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ExtendReward:
      type: object
      properties:
        profile_id:
          type: string
        extend_days:
          type:
            - integer
            - 'null'
        extend_date:
          type:
            - string
            - 'null'
          format: date-time
        ids:
          type: array
          items:
            type: integer
          minItems: 1
      required:
        - profile_id
        - ids
      title: ExtendReward
    Reward:
      type: object
      properties:
        id:
          type: integer
        profile_id:
          type: string
        timezone:
          type:
            - string
            - 'null'
        value_initial:
          type: string
        value_remaining:
          type: string
        has_notified_issue:
          type:
            - boolean
            - 'null'
        has_notified_expiry:
          type:
            - boolean
            - 'null'
        has_notified_extend:
          type:
            - boolean
            - 'null'
        expires_at:
          type: string
        issued_at:
          type: string
        is_expired:
          type: string
        is_active:
          type: string
        issued_local_at:
          type: string
        expires_local_at:
          type: string
        notify_issue_at:
          type: string
        notify_expiry_at:
          type: string
        extended_at:
          type: string
        definition:
          $ref: '#/components/schemas/RewardDefinition'
        meta:
          type:
            - array
            - 'null'
          items: {}
        created_at:
          type: string
        updated_at:
          type: string
        source_id:
          type:
            - integer
            - 'null'
        source_type:
          type:
            - string
            - 'null'
      required:
        - id
        - profile_id
        - timezone
        - value_initial
        - value_remaining
        - has_notified_issue
        - has_notified_expiry
        - has_notified_extend
        - expires_at
        - issued_at
        - is_expired
        - is_active
        - issued_local_at
        - expires_local_at
        - notify_issue_at
        - notify_expiry_at
        - extended_at
        - definition
        - meta
        - created_at
        - updated_at
        - source_id
        - source_type
      title: Reward
    RewardDefinition:
      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
        currency:
          type:
            - string
            - 'null'
        period:
          type:
            - integer
            - 'null'
        period_type:
          type:
            - string
            - 'null'
        absolute_expiry:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        long_description:
          type:
            - string
            - 'null'
        terms_conditions:
          type:
            - string
            - 'null'
        earn_instructions:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        issue_target_id:
          type:
            - integer
            - 'null'
        expiry_target_id:
          type:
            - integer
            - 'null'
        extend_target_id:
          type:
            - integer
            - 'null'
        notify_issue_offset:
          type:
            - integer
            - 'null'
        notify_expiry_offset:
          type:
            - integer
            - 'null'
        notify_schedule_offset:
          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'
        notify_extend_offset_days:
          type:
            - integer
            - 'null'
        notify_extend_offset_hour:
          type:
            - integer
            - 'null'
        internal_notes:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        value:
          type: number
        max_value:
          type:
            - number
            - 'null'
        is_extendable:
          type: boolean
        is_assignable:
          type: boolean
        is_reassignable:
          type: boolean
        is_published:
          type: boolean
        extend_days:
          type:
            - integer
            - 'null'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - handle
        - region_id
        - region
        - currency
        - period
        - period_type
        - absolute_expiry
        - description
        - short_description
        - long_description
        - terms_conditions
        - earn_instructions
        - icon
        - image_url
        - issue_target_id
        - expiry_target_id
        - extend_target_id
        - notify_issue_offset
        - notify_expiry_offset
        - notify_schedule_offset
        - notify_issue_offset_days
        - notify_issue_offset_hour
        - notify_remind_offset_days
        - notify_remind_offset_hour
        - notify_extend_offset_days
        - notify_extend_offset_hour
        - internal_notes
        - type
        - value
        - max_value
        - is_extendable
        - is_assignable
        - is_reassignable
        - is_published
        - extend_days
        - tags
        - created_at
        - updated_at
      title: RewardDefinition
    Tag:
      type: string
      title: Tag
  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
    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

````