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

# Update a product

> Change a product's name or description.

Authenticate with an API key that belongs to the product's organization and has Full access or the `products:products:write` permission (**Products** under **Can create and change** in the dashboard). Only the Owner and Admin roles can grant it.

* `id` is the ID of a product in your organization, whether it was created through the API or in the dashboard.
* The body takes `name` and `description`, both optional. Only the fields you send change.
* The response has the same shape as [Get a product](https://docs.anyway.sh/api-reference/endpoint/get-product.md).
* Unknown fields are rejected with `400`. There is no `Idempotency-Key` for this endpoint.

> [!NOTE]
>
> Card checkout shows the product's name and description, so a change shows up at once on the checkout of every existing payment link. A payment link's own title is shown on the success page after payment; to change it, use [Update a payment link](https://docs.anyway.sh/api-reference/endpoint/update-payment-link.md).

| Status | Code | Meaning |
| - | - | - |
| `400` | | Validation failed: an unknown field, an empty `name`, a `name` over 255 characters, or a `description` over 2000. |
| `401` | | The API key is missing or invalid. |
| `403` | `INSUFFICIENT_SCOPE` | The key lacks `products:products:write`. |
| `404` | | The product doesn't exist or belongs to another organization. |
| `413` | `PAYLOAD_TOO_LARGE` | The request body is larger than 64 KiB. |


## OpenAPI

````yaml api-reference/openapi.json PATCH /v1/product/{id}
openapi: 3.0.3
info:
  description: >-
    Organization-scoped commerce API for merchant backends: create and manage
    checkout sessions, and query commerce records.
  title: Anyway Merchant API
  contact: {}
  version: '1.0'
  x-source: anyway-backend-go
servers:
  - url: https://merchant-api-prod.anyway.sh
security: []
paths:
  /v1/product/{id}:
    patch:
      tags:
        - products
      summary: Update a product
      description: >-
        Changes a product's name or description; only the fields you send
        change. Requires Full access or the `products:products:write`
        permission. The response is the same as `GET /v1/product/{id}`. Renaming
        a product doesn't change its existing payment links; each link keeps its
        own title. Unknown request fields return 400. There is no
        Idempotency-Key.
      parameters:
        - description: Product ID
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: Fields to change
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/product.UpdateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/response.ApiResponse-product_ProductResponse
        '400':
          description: >-
            Bad Request. An unknown field, an empty name, a name over 255
            characters, or a description over 2000.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '403':
          description: >-
            Forbidden. The API key lacks the required permission
            (INSUFFICIENT_SCOPE).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '404':
          description: >-
            Not Found. The product does not exist or belongs to another
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '413':
          description: Request body larger than 64 KiB (`PAYLOAD_TOO_LARGE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
      security:
        - APIKeyAuth: []
components:
  schemas:
    product.UpdateRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          description: New product name
        description:
          type: string
          maxLength: 2000
          description: New product description
    response.ApiResponse-product_ProductResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/product.ProductResponse'
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    response.ApiResponse-any:
      type: object
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    product.ProductResponse:
      type: object
      properties:
        createdAt:
          type: string
        description:
          type: string
        id:
          description: 'Deprecated: use productId.'
          type: string
          deprecated: true
        name:
          type: string
        orgId:
          type: string
        paymentLinks:
          type: array
          items:
            $ref: '#/components/schemas/product.PaymentLinkResponse'
        productId:
          type: string
        status:
          type: string
        updatedAt:
          type: string
    response.ErrorDetail:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    product.PaymentLinkResponse:
      type: object
      properties:
        amount:
          type: number
          nullable: true
        createdAt:
          type: string
        currency:
          type: string
        flexibleAmount:
          type: boolean
        isActive:
          type: boolean
        name:
          type: string
        paymentLinkUrl:
          type: string
        pricingId:
          type: string
        pricingType:
          type: string
        provider:
          type: string
        title:
          type: string
        description:
          type: string
        minAmount:
          type: number
          nullable: true
        maxAmount:
          type: number
          nullable: true
        successUrl:
          type: string
          description: >-
            Where the customer is sent after paying. Empty when the Anyway
            receipt is used.
  securitySchemes:
    APIKeyAuth:
      description: 'Merchant API key (format: ak_BASE64)'
      type: apiKey
      name: X-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.