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

# Create a new active tenant bundle version

> Referencia detallada para PUT /v1/products/{id}/bundle.

## Uso

Usalo para administrar productos del tenant, ofertas, disponibilidad o inventario empresarial asociado al catalogo SimplePay.

## Antes de llamar

| Tema             | Detalle                                                                                |
| ---------------- | -------------------------------------------------------------------------------------- |
| Metodo           | `PUT`                                                                                  |
| Ruta             | `/v1/products/{id}/bundle`                                                             |
| Auth             | Bearer API key del ambiente correcto.                                                  |
| Scope            | `products:write`                                                                       |
| Idempotencia     | Recomendada para cualquier retry. Usa una key deterministica por operacion de negocio. |
| Guia relacionada | [API Reference overview](/api-reference/overview)                                      |

## Patron recomendado

* Ejecuta este endpoint desde backend o job seguro, nunca desde frontend con API keys.
* Manda `Idempotency-Key` cuando el endpoint cree, convierta, reprograme, cancele, capture o reembolse estado.
* Consulta el bloque OpenAPI de esta pagina para el shape exacto de parametros, body y respuestas.

## Ejemplo minimo

```bash terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X PUT "https://api.simplepay.mx/v1/products/id_123/bundle" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: upsert-product-bundle_v1" \
  -d '{ ... }'
```

## Errores a manejar

* `400` indica payload, parametros o estado invalido.
* `401` o `403` indican API key, ambiente o scopes incorrectos.
* `409` suele indicar conflicto de estado, duplicado o idempotencia incompatible.
* `404` significa que el recurso no existe para ese tenant o ambiente.
* `429` y `5xx` se pueden reintentar con backoff; en writes conserva la misma idempotency key.

## Contrato OpenAPI

El playground, parametros, body y respuestas de abajo salen de `/openapi.json`. Si el contrato cambia, actualiza la spec y regenera esta pagina.


## OpenAPI

````yaml openapi.json PUT /v1/products/{id}/bundle
openapi: 3.1.0
info:
  title: SimplePay API
  version: '2026-06-13'
servers:
  - url: https://api.simplepay.mx
security:
  - SimplePayApiKey: []
paths:
  /v1/products/{id}/bundle:
    put:
      summary: Create a new active tenant bundle version
      operationId: upsertProductBundle
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BundleUpsertRequest'
      responses:
        '200':
          description: Create a new active tenant bundle version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BundleVersionResponse'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 255
  schemas:
    BundleUpsertRequest:
      type: object
      required:
        - charge_mode
        - components
      properties:
        charge_mode:
          enum:
            - fixed_price
            - sum_components
        components:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/BundleComponentInput'
        metadata:
          type: object
          additionalProperties: true
    BundleVersionResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        object:
          const: catalog_bundle_version
        product_id:
          type: string
          format: uuid
        charge_mode:
          enum:
            - fixed_price
            - sum_components
        components:
          type: integer
        version_number:
          type: integer
    BundleComponentInput:
      type: object
      required:
        - product_id
      properties:
        product_id:
          type: string
          format: uuid
        price_id:
          type: string
          format: uuid
        quantity:
          type: integer
          minimum: 1
          default: 1
        sort_order:
          type: integer
          default: 0
        public:
          type: boolean
          default: true
        fulfillment_role:
          enum:
            - included
            - credit_grant
            - upsell
            - internal
        metadata:
          type: object
          additionalProperties: true
  securitySchemes:
    SimplePayApiKey:
      type: http
      scheme: bearer

````