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

# Update Warranty

> This endpoint updates an existing warranty.

### Body

<ParamField body="warranty_id" type="string">
  This is the id of the warranty.
</ParamField>

<ParamField body="warranty" type="object">
  The warranty object
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the id of the warranty.
</ResponseField>

<ResponseField name="action_needed" type="boolean">
  Indicates whether any action is needed for the warranty.
</ResponseField>

<ResponseField name="advanced_replacement" type="boolean">
  Indicates if advanced replacement is available for the warranty.
</ResponseField>

<ResponseField name="amount" type="decimal">
  The monetary amount associated with the warranty.
</ResponseField>

<ResponseField name="condition" type="string">
  Describes the condition of the item or situation.
</ResponseField>

<ResponseField name="condition_date" type="datetime">
  Date and time when the condition was recorded or observed.
</ResponseField>

<ResponseField name="country" type="string">
  Country associated with the warranty entry.
</ResponseField>

<ResponseField name="created_date" type="datetime">
  Date and time when the warranty entry was created.
</ResponseField>

<ResponseField name="customerEmail" type="string">
  Email address of the customer associated with the warranty.
</ResponseField>

<ResponseField name="customer_id" type="integer">
  Unique identifier for the customer associated with the warranty.
</ResponseField>

<ResponseField name="description" type="string">
  Brief description or additional details about the warranty.
</ResponseField>

<ResponseField name="enteredBy" type="string">
  Name or identifier of the person who entered the warranty.
</ResponseField>

<ResponseField name="issue" type="string">
  Issue or problem associated with the warranty.
</ResponseField>

<ResponseField name="match" type="boolean">
  Indicates whether the warranty matches the specified conditions.
</ResponseField>

<ResponseField name="order_date" type="datetime">
  Date and time when the order associated with the warranty was placed.
</ResponseField>

<ResponseField name="order_id" type="integer">
  Unique identifier for the order associated with the warranty.
</ResponseField>

<ResponseField name="reason_category" type="string">
  Category or reason associated with the warranty.
</ResponseField>

<ResponseField name="replacement_color" type="string">
  Color of the replacement item for the warranty.
</ResponseField>

<ResponseField name="model" type="string">
  Model of the replacement item for the warranty.
</ResponseField>

<ResponseField name="replacement_order_created" type="boolean">
  Indicates if a replacement order has been created for the warranty.
</ResponseField>

<ResponseField name="reported_condition" type="string">
  Condition as reported by the customer or user.
</ResponseField>

<ResponseField name="requested_date" type="datetime">
  Date and time when a specific request was made for the warranty.
</ResponseField>

<ResponseField name="rma" type="string">
  Return Merchandise Authorization (RMA) number for the warranty.
</ResponseField>

<ResponseField name="scanned_serial_number" type="string">
  Serial number obtained through scanning for the warranty.
</ResponseField>

<ResponseField name="serial_number" type="string">
  Unique serial number associated with the item in the warranty.
</ResponseField>

<ResponseField name="shipstation_order_id" type="string">
  ShipStation order ID associated with the warranty.
</ResponseField>

<ResponseField name="shipped_date" type="datetime">
  Date and time when the item was shipped or dispatched.
</ResponseField>

<ResponseField name="sso_id" type="string">
  Single Sign-On (SSO) ID associated with the warranty.
</ResponseField>

<ResponseField name="status" type="string">
  Current status or state of the warranty.
</ResponseField>

<ResponseField name="stripe_invoice_id" type="string">
  Stripe invoice ID associated with the warranty.
</ResponseField>

<ResponseField name="tax_refunded" type="decimal">
  The amount of tax refunded for the warranty.
</ResponseField>

<ResponseField name="total_refunded" type="decimal">
  The total amount refunded for the warranty.
</ResponseField>

<ResponseField name="tracking_number" type="string">
  Tracking number associated with the shipment for the warranty.
</ResponseField>

<ResponseField name="warehouse_received_date" type="datetime">
  Date and time when the item was received in the warehouse.
</ResponseField>

<ResponseField name="warranty_line_items" type="object">
  This is an array of warranty line items.

  <Expandable title="Show child attributes">
    <ResponseField name="amount" type="decimal">
      The monetary amount associated with the warranty line item.
    </ResponseField>

    <ResponseField name="condition" type="string">
      Describes the condition of the replaced item.
    </ResponseField>

    <ResponseField name="flat_rate_shipping" type="boolean">
      Indicates whether the shipping rate is a flat rate.
    </ResponseField>

    <ResponseField name="id" type="integer">
      Unique identifier for the warranty line item.
    </ResponseField>

    <ResponseField name="name" type="string">
      Name or description of the warranty line item.
    </ResponseField>

    <ResponseField name="price" type="decimal">
      The price of the warranty line item.
    </ResponseField>

    <ResponseField name="warranty_id" type="integer">
      Unique identifier for the warranty associated with the line item.
    </ResponseField>

    <ResponseField name="serial_number" type="string">
      Unique serial number associated with the warranty item.
    </ResponseField>

    <ResponseField name="sales_order_sku" type="string">
      Stock Keeping Unit (SKU) of the replaced item.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/warranty' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "user_group_id": "example_1",
      "name": "Example 1",
      "mapping": {"40": "213", "134": "386"},
      "properties": {"filterValue": "value"}
  }'
  ```

  ```graphQL GraphQL theme={null}

     mutation UpdateWarranty(
       $ticket_id: String
       $warranty: warranties_set_input!
     ) {
       update_warranties (
       where: { id : { _eq: $ticket_id }}
       _set: $warranty
       ) {
         returning {
          id
          order_id
          serial_number
          customer_id
          description
          status
          tracking_number
          zendesk_number
          action_needed
          issue
          shipped_date
          requested_date
          enteredBy
          customerEmail
          rma
          country
         }
       }
      };
  ```

  ```js Node.js theme={null}

  const warranties = await stateset.warranties.update({
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  });

  ```

  ```python Python theme={null}

  warranties = stateset.Warranty.modify(
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )

  ```

  ```ruby Ruby theme={null}

  warranties = Stateset::Warranties.update(
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )

  ```

  ```go Go theme={null}

  warranties, err := stateset.Warranties.Update(
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )

  ```

  ```java Java theme={null}

  Warranties warranties = stateset.warranties.update(
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  );

  ```

  ```php PHP theme={null}
  $warranties = $stateset->warranties->update(
    '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  );

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "warranties": [
          {
              "id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
              "created_date": "2023-06-28T19:34:59.189838+00:00",
              "amount": null,
              "action_needed": null,
              "condition": null,
              "customerEmail": "customer@gmail.com",
              "customer_id": null,
              "description": null,
              "enteredBy": null,
              "flat_rate_shipping": null,
              "order_date": null,
              "order_id": "524213310335630636",
              "reason_category": null,
              "reported_condition": null,
              "requested_date": null,
              "rma": "#1014-R5",
              "serial_number": null,
              "shipped_date": null,
              "status": "RCV",
              "tax_refunded": null,
              "total_refunded": null,
              "tracking_number": null,
              "warranty_line_items": []
          },
      ]
  } 
  ```
</ResponseExample>
