> ## Documentation Index
> Fetch the complete documentation index at: https://fastpay-mintlify-983ed565.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a product

> Creates a product in the merchant's catalog. Products are reusable
across one or more Payment Links and can be physical or digital.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/products
openapi: 3.0.0
info:
  title: FastPay API
  version: 1.0.0
  description: >-
    API for creating and managing payment charges.


    ## Authentication


    This API uses **Basic Authentication** for direct API access, such as
    creating charges.

    Use your API key as the username and an empty string as password.

    The header should be formatted as:


    `Authorization: Basic {base64(apiKey:)}`.


    For example:


    ```

    Authorization: Basic YWxleG91dG9uOiIi

    ```


    ## Webhooks


    FastPay sends webhooks to notify your application about charge status
    changes in real-time.

    Webhooks are sent via HTTP POST requests to your configured webhook
    endpoints.


    ### Webhook Events


    The following webhook events are available for charges:


    - `charge.created` - Sent when a new charge is created

    - `charge.pending` - Sent when a charge is pending payment

    - `charge.paid` - Sent when a charge is successfully paid

    - `charge.updated` - Sent when a charge is updated


    ### Webhook Payload Structure


    All webhook payloads follow this structure:


    ```json

    {
      "id": "webhook_event_id",
      "event": "charge.paid",
      "data": {
        // Complete charge object
      }
    }

    ```


    ### Webhook Delivery


    - Webhooks are sent via HTTP POST requests

    - Content-Type: `application/json`

    - Retry logic is implemented for failed deliveries

    - Webhook events are stored in the database for audit purposes

    - Delivery logs are maintained for debugging and monitoring


    ### Webhook Security


    - Webhooks are sent to pre-configured endpoints

    - Endpoints can be enabled/disabled per merchant

    - Event filtering is supported (only receive specific events)

    - Failed deliveries are retried with exponential backoff
servers:
  - url: https://api-global.fastpaybrasil.com
    description: Produção e Sandbox (diferenciados pela API key)
security: []
paths:
  /v1/products:
    post:
      tags:
        - Products
      summary: Create a product
      description: |-
        Creates a product in the merchant's catalog. Products are reusable
        across one or more Payment Links and can be physical or digital.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewProduct'
      responses:
        '201':
          description: The product has been successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '401':
          description: Unauthorized - invalid credentials
        '403':
          description: Forbidden - insufficient permissions
        '422':
          description: Unprocessable Entity
      security:
        - basic: []
components:
  schemas:
    NewProduct:
      type: object
      required:
        - merchantId
        - name
        - price
        - currency
        - productType
      properties:
        merchantId:
          type: string
          description: ID of the merchant that owns the product.
          example: 2RhQg9M7ZCg3X3nMb9W1kX8Q
        name:
          type: string
          maxLength: 255
          description: Product name shown on the checkout.
          example: Camiseta Preta P
        description:
          type: string
          description: Free-form product description.
          example: Algodão 100%, gola careca.
        productLink:
          type: string
          description: Access URL (digital products) delivered to the buyer.
          example: https://meusite.com/area-do-aluno
        price:
          type: number
          minimum: 0
          description: Price in the currency unit (e.g., `89.90`).
          example: 89.9
        currency:
          type: string
          description: ISO 4217 currency code.
          example: BRL
        productType:
          type: string
          enum:
            - physical
            - digital
          description: Product type.
        sku:
          type: string
          maxLength: 64
          description: Internal code used in search and identification.
          example: CAM-PT-P
        trackStock:
          type: boolean
          description: Enable stock tracking (physical only).
          example: true
        stock:
          type: integer
          minimum: 0
          description: Available quantity.
          example: 120
        weight:
          type: number
          minimum: 0
          description: Weight in kilograms, used for freight quoting.
          example: 0.25
        heightCm:
          type: number
          minimum: 0
          description: Height in centimeters.
          example: 2
        widthCm:
          type: number
          minimum: 0
          description: Width in centimeters.
          example: 30
        lengthCm:
          type: number
          minimum: 0
          description: Length in centimeters.
          example: 40
        status:
          type: string
          enum:
            - active
            - inactive
          description: >-
            Defaults to `active`. Use `PATCH /v1/products/{id}/status` to
            archive/reactivate later.
    Product:
      type: object
      properties:
        id:
          type: string
          example: 2RhQg9M7ZCg3X3nMb9W1kX8Q
        merchantId:
          type: string
          example: 2RhQg9M7ZCg3X3nMb9W1kX8Q
        name:
          type: string
          example: Camiseta Preta P
        description:
          type: string
          nullable: true
        productLink:
          type: string
          nullable: true
        price:
          type: number
          example: 89.9
        currency:
          type: string
          example: BRL
        productType:
          type: string
          enum:
            - physical
            - digital
        sku:
          type: string
          nullable: true
        trackStock:
          type: boolean
        stock:
          type: integer
          nullable: true
        weight:
          type: number
          nullable: true
        heightCm:
          type: number
          nullable: true
        widthCm:
          type: number
          nullable: true
        lengthCm:
          type: number
          nullable: true
        status:
          type: string
          enum:
            - active
            - inactive
        imageUrl:
          type: string
          nullable: true
          description: |-
            Signed, short-lived URL for the product image. `null` when no
            image was uploaded.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    basic:
      type: http
      scheme: basic
      description: |-
        HTTP Basic authentication. Use your secret key as the
        username and an empty string as password. The API key
        should be base64 encoded in the format 'username:' when
        sending the Authorization header.

````