> ## 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 COGS Entry

> This endpoint updates an existing COGS (Cost of Goods Sold) entry.

### Path Parameters

<ParamField path="id" type="integer" required>
  The unique identifier of the COGS entry to update
</ParamField>

### Body

<ParamField body="period" type="string">
  The accounting period for the COGS entry
</ParamField>

<ParamField body="product" type="string">
  The product associated with the COGS entry
</ParamField>

<ParamField body="quantity_sold" type="integer">
  The quantity of the product sold
</ParamField>

<ParamField body="cogs" type="number">
  The Cost of Goods Sold amount
</ParamField>

<ParamField body="average_cost" type="number">
  The average cost per unit
</ParamField>

<ParamField body="ending_inventory_quantity" type="number">
  The quantity of inventory remaining at the end of the period
</ParamField>

<ParamField body="ending_inventory_value" type="number">
  The value of the ending inventory
</ParamField>

<ParamField body="currency" type="string">
  The currency used for the financial calculations
</ParamField>

<ParamField body="exchange_rate_id" type="integer">
  Identifier for the related exchange rate
</ParamField>

<ParamField body="sale_transaction_id" type="integer">
  Identifier for the related sale transaction
</ParamField>

<ParamField body="unit_selling_price" type="number">
  The selling price per unit
</ParamField>

<ParamField body="gross_sales" type="number">
  The total gross sales amount
</ParamField>

<ParamField body="cogs_method" type="string">
  The method used to calculate COGS
</ParamField>

<ParamField body="product_category" type="string">
  The category of the product
</ParamField>

<ParamField body="sales_channel" type="string">
  The channel through which the sale was made
</ParamField>

<ParamField body="customer_segment" type="string">
  The segment of the customer who made the purchase
</ParamField>

<ParamField body="sale_date" type="string">
  The date of the sale
</ParamField>

<ParamField body="is_return" type="boolean">
  Indicates whether this entry is for a return
</ParamField>

<ParamField body="return_reason" type="string">
  The reason for the return, if applicable
</ParamField>

<ParamField body="cost_center" type="string">
  The cost center associated with the COGS entry
</ParamField>

<ParamField body="supplier_id" type="integer">
  Identifier for the related supplier
</ParamField>

### Response

<ResponseField name="id" type="integer">
  The unique identifier of the updated COGS entry
</ResponseField>

<ResponseField name="message" type="string">
  A success message confirming the update of the COGS entry
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/cogs_entries/123' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "quantity_sold": 150,
      "cogs": 7500,
      "average_cost": 50,
      "ending_inventory_quantity": 450,
      "ending_inventory_value": 22500,
      "gross_sales": 11250
  }'

  ```
</RequestExample>
