Back to Home

Documentation

Everything you need to know to get the most out of DiscountFlow. Find guides, tutorials, and API references.

Quick Start
API References
FAQs
API References
/
API Endpoints
/
Update product category

Update product category

Update details of existing product category

updateProductCategory

Updates an existing product category by ID. Only fields included in input are changed.

Method

POST

Path

/graphql

Authentication

Bearer Token

Request Body Schema

Content-type: application/json

Variables

NameTypeRequiredDescription
idIDRequiredThe product category ID to update
input.nameStringOptionalCategory name
input.base_priceFloatOptionalBase price
input.descriptionStringOptionalCategory description
input.custom_fieldsJSONOptionalArbitrary additional data

Example Payload

{
  "query": "mutation ($id: ID!, $input: UpdateProductCategoryInput!) { updateProductCategory(id: $id, input: $input) { id name base_price updated_at } }",
  "variables": {
    "id": "01JNQX4KZB7WNVR3MPXT6A0DYE",
    "input": {
      "name": "Sensors & Actuators",
      "base_price": 55.0
    }
  }
}

Response

Returns the updated ProductCategory object.

Example Response

{
  "data": {
    "updateProductCategory": {
      "id": "01JNQX4KZB7WNVR3MPXT6A0DYE",
      "name": "Sensors & Actuators",
      "base_price": 55.0,
      "updated_at": "2026-06-03 09:30:00"
    }
  }
}

Errors

Example Response

{
  "errors": [
    {
      "message": "Unauthenticated."
    }
  ]
}