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

# Extend Warranty

> This endpoint extends a warranty period.

### Body

<ParamField body="warranty_id" type="string">
  The ID provided in the data tab may be used to identify the warranty
</ParamField>

<ParamField body="extension_period" type="number">
  The number of days to extend the warranty
</ParamField>

<ParamField body="new_expiry_date" type="string">
  The new expiry date for the warranty
</ParamField>

### Response

<ResponseField name="id" type="string">
  The ID provided in the data tab may be used to identify the warranty
</ResponseField>

<ResponseField name="object" type="string">
  The object type
</ResponseField>

<ResponseField name="original_expiry_date" type="string">
  The original expiry date of the warranty
</ResponseField>

<ResponseField name="new_expiry_date" type="string">
  The new expiry date of the warranty
</ResponseField>

<ResponseField name="success" type="number">
  Indicates whether the call was successful. true if successful, false if not.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/warranty/:id/extend' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "e0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
      "extension_period": 365,
      "new_expiry_date": "2025-12-31"
  }'
  ```

  ```graphQL GraphQL theme={null}
        mutation warrantyExtendMutation {
          warrantyExtend(id: "${warrantyId}", extensionPeriod: ${extensionPeriod}, newExpiryDate: "${newExpiryDate}") {
            warranty {
              id,
              original_expiry_date,
              new_expiry_date
            }
            userErrors {
              field
              message
            }
          }
        }
      `;
  ```

  ```js Node.js theme={null}
  const warranties = await stateset.warranties.extend({
    id: '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    extension_period: 365,
    new_expiry_date: '2025-12-31'
  });
  ```

  ```python Python theme={null}
  warranties = stateset.warranties.extend({
    'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    'extension_period': 365,
    'new_expiry_date': '2025-12-31'
  })
  ```

  ```ruby Ruby theme={null}
  warranties = Stateset::Warranty.extend({
    id: '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    extension_period: 365,
    new_expiry_date: '2025-12-31'
  })
  ```

  ```go Go theme={null}
  warranties, err := stateset.Warranties.extend({
    ID: '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    ExtensionPeriod: 365,
    NewExpiryDate: '2025-12-31'
  })
  ```

  ```java Java theme={null}
  Warranty warranties = stateset.Warranties.extend({
    id: '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    extensionPeriod: 365,
    newExpiryDate: '2025-12-31'
  });
  ```

  ```php PHP theme={null}
  $warranties = $stateset->warranties->extend([
    'id' => '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    'extension_period' => 365,
    'new_expiry_date' => '2025-12-31'
  ]);
  ```

  ```csharp C# theme={null}
  var warranties = await stateset.Warranties.Extend(new {
    Id = '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    ExtensionPeriod = 365,
    NewExpiryDate = '2025-12-31'
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "e0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "warranty",
    "extended": true,
    "original_expiry_date": "2024-12-31",
    "new_expiry_date": "2025-12-31",
    "extension_period": 365
  }
  ```
</ResponseExample>
