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

# Update product

> `product_pid` and `type` cannot be changed. Blocked while the product is `pending` review or already `approved` (see `/publish`/`/unpublish`).



## OpenAPI

````yaml /openapi.yaml patch /v1/products/{id}
openapi: 3.1.0
info:
  title: Lojou API
  version: 1.0.0
  description: |
    Official reference for the Lojou `/v1` API — everything a developer needs
    to create products, process orders, manage plans, and receive webhooks
    from a Lojou store.
servers:
  - url: https://api.lojou.app
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
  - name: OAuth
  - name: User
  - name: Products
  - name: Plans
  - name: Orders
  - name: Customers
  - name: Files
  - name: Webhooks
  - name: Discounts
  - name: Affiliates
paths:
  /v1/products/{id}:
    patch:
      tags:
        - Products
      summary: Update product
      description: >-
        `product_pid` and `type` cannot be changed. Blocked while the product is
        `pending` review or already `approved` (see `/publish`/`/unpublish`).
      operationId: patchV1ProductById
      parameters:
        - $ref: '#/components/parameters/ProductIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                status: success
                message: Product updated successfully.
                currency: MZN
                product:
                  id: 272
                  name: Curso de Excel Avançado — Turma 2
                  type: one_time
                  image: https://cdn.lojou.app/lojou/stores/files/954/curso-excel.jpg
                  price: 1000
                  status: approved
                  product_pid: QUyMp
                  category: Educação
                  sub_category: Cursos online
                  mobile_number: '843264388'
                  sale_page: https://minhaloja.example.com/curso-excel
                  affiliate_status: open
                  affiliate_comission: 30
                  created_at: '2026-06-02T10:00:00.000000Z'
                  number_code: '+258'
                  number: '843264388'
                  affiliation:
                    status: open
                    comission: 30
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          description: >-
            Forbidden — write scope missing, or the product is locked for
            changes (pending review / approved), or you tried to change
            `product_pid`/`type`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: error
                message: >-
                  Product cannot be modified while it is pending review or
                  approved.
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    ProductIdParam:
      name: id
      in: path
      required: true
      description: Product identifier (`id` or `product_pid`).
      schema:
        type: string
  schemas:
    UpdateProductRequest:
      type: object
      description: >-
        Partial product update payload — `product_pid` and `type` cannot be
        changed here.
      properties:
        name:
          type: string
          nullable: true
        price:
          type: number
          nullable: true
        category:
          type: string
          nullable: true
        sub_category:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
        sale_page:
          type: string
          format: uri
          nullable: true
        affiliate_status:
          type: string
          nullable: true
        affiliate_comission:
          type: number
          nullable: true
        number:
          type: string
          nullable: true
          description: Contact/support number for the product (mapped to `mobile_number`).
        number_code:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
      additionalProperties: true
    ValidationErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
  responses:
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Unauthorized user.
    NotFoundError:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Resource not found.
    ValidationError:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            status: error
            message: Validation failed.
            errors:
              amount:
                - The amount field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Send an API key or an OAuth access token in the `Authorization` header
        as a Bearer token. See [Authentication](/authentication) for details.

````