openapi: 3.1.0
servers:
  - url: https://app.mercately.com
    description: Production server
  - url: https://mercately.shop
    description: Shops API Production server
info:
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
  title: Mercately Retailers API
  termsOfService: https://mercately.com/terms/
  contact:
    email: soporte@mercately.com
    url: http://mercately.com/
  description: >-
    La plataforma para desarrolladores de Mercately, está creada para ayudar a
    todos nuestros clientes y empoderarlos para que crezcan mejor. Nuestras API
    están diseñadas para permitir que los equipos de cualquier forma o tamaño
    construyan integraciones y aprovechar al máximo Mercately.

    Todas las API de Mercately se construyen usando convenciones REST y están
    diseñadas para tener una estructura de URL predecible. U tilizan muchas
    funciones HTTP estándar, incluidos métodos (POST, GET, PUT, DELETE) y
    códigos de respuesta de error.
tags:
  - name: Agents
    description: >-
      En Mercately, los agentes son conocidos como las personas que están en tu
      equipo de trabajo. Los agentes pueden estar atados a varios otros objetos
      como conversaciones, notas, tratos del embudo u órdenes.
  - name: Customers
    description: >-
      En Mercately, todo contacto proveniente de conversaciones, compras o
      creados directamente se clasifica como cliente.
  - name: Deals
    description: >-
      En Mercately, los embudos permiten visualizar el recorrido que sigues a
      tus clientes a traves de las negociaciones.
  - name: Messenger
    description: >-
      En Mercately, una vez vinculado con Messenger, este api permite realizar
      múltiples operaciones para acceder a las conversaciones de Messenger.
  - name: WhatsApp
    description: >-
      En Mercately, una vez vinculado con WhatsApp, este api permite realizar
      múltiples operaciones para acceder a las conversaciones de WhatsApp y
      enviar mensajes.
  - name: Flows
    description: >-
      En Mercately, una vez creado uno o más flows, esta api permite realizar
      múltiples operaciones para obtener todos los flows.
  - name: Orders
    description: Crea, actualiza y elimina órdenes en Mercately
  - name: Products
    description: Crea, actualiza y elimina productos en Mercately
  - name: Categories
    description: Obtén todas las categorías creadas en Mercately
paths:
  /retailers/api/v1/agents:
    get:
      summary: List all agents
      operationId: listAgents
      tags:
        - Agents
      security:
        - api-key: []
      responses:
        '200':
          description: Lista todos los agentes
          content:
            application/json:
              schema:
                type: object
                properties:
                  agents:
                    type: array
                    items:
                      $ref: '#/components/schemas/agents'
        '400':
          description: Unauthorized
  /retailers/api/v1/customers:
    get:
      tags:
        - Customers
      summary: Customers
      description: Obtén los datos de un cliente en especifico
      operationId: customers
      parameters:
        - name: page
          in: query
          description: busca la pagina específica de clientes
          schema:
            type: number
        - name: start_date
          in: query
          description: Fecha inicial de búsqueda en formato YYYY-MM-DD
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: Fecha final de búsqueda en formato YYYY-MM-DD
          schema:
            type: string
            format: date
        - name: id_type
          in: query
          description: especifica el tipo de documento a buscar
          schema:
            enum:
              - cedula
              - pasaporte
              - ruc
              - rut
              - otro
        - name: id_number
          in: query
          description: Número de documento a buscar
          schema:
            type: string
        - name: platform
          in: query
          description: Plataforma de interacción
          schema:
            type: string
            enum:
              - whatsapp
              - messenger
              - instagram
        - name: order_by_last_interaction
          in: query
          description: Ordena los clientes por la última interacción segun la plataforma
          schema:
            type: string
            enum:
              - asc
              - desc
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    results: 1
                    total_pages: 1
                    customers:
                      - id: '28964696735'
                        first_name: Adam
                        last_name: Smith
                        email: adam@smith.com
                        phone: ''
                        meli_customer_id: 'null'
                        meli_nickname: 'null'
                        id_type: 'null'
                        id_number: ''
                        address: Street 1
                        city: City
                        state: State
                        zip_code: '59669'
                        country_id: EC
                        notes: Customer notes
                        whatsapp_opt_in: false
                        whatsapp_name: 'null'
                        tags:
                          - tag: Test tag
                            web_id: 1713untwo79
                        custom_fields:
                          - field_name: rerum
                            'field_content:': Test Field
                        agent: 'null'
                        creation_date: '2024-03-28T11:55:24.426-05:00'
                        last_chat_interaction: '2024-05-28T10:55:24.426-05:00'
        '400':
          description: Unauthorized
    post:
      tags:
        - Customers
      summary: Create Customers
      description: Crea un nuevo cliente
      operationId: createCustomer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer'
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create_customer'
        '400':
          description: Unauthorized
  /retailers/api/v1/customers/:id:
    get:
      tags:
        - Customers
      summary: Customer/:id
      description: Obtén los datos de un cliente en especifico buscado por ID
      operationId: customer/:id
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer'
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:email:
    get:
      tags:
        - Customers
      summary: Customer/:email
      description: Obtén los datos de un cliente en especifico buscado por email
      operationId: customer/email
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_customer'
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:phone:
    get:
      tags:
        - Customers
      summary: Customer/:phone
      description: Obtén los datos de un cliente en especifico buscado por phone
      operationId: customer/phone
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_customer'
        '400':
          description: Unauthorized
        '404':
          description: Not found
    put:
      tags:
        - Customers
      summary: Update Customer by email, id or phone
      description: >-
        Actualiza un nuevo customer buscado por email, id o phone. Puedes
        realizar la busqueda igual que los métodos get
      operationId: updateCustomer/email
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer'
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update_customer'
        '400':
          description: Unauthorized
  /retailers/api/v1/customers/:id/events:
    post:
      tags:
        - Customer events
      summary: Create Customer Event
      description: Crea un nuevo evento para el cliente
      operationId: customer/:id/events
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer_event'
      security:
        - api-key: []
      responses:
        '201':
          description: CREATED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create_customer_event'
        '401':
          description: Unauthorized
  /retailers/api/v1/customers/:id/whatsapp_conversations:
    get:
      tags:
        - Customers
      summary: Customer/:id/whatsapp_conversations
      description: Obtén la conversación de Whatsapp del cliente por ID
      operationId: customer/id/whatsapp_conversations
      parameters:
        - name: page
          in: query
          description: Busca la página específica de conversaciónes
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de mensajes que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  whatsapp_conversations:
                    type: array
                    items:
                      $ref: '#/components/schemas/whatsapp_api_message'
                  total_pages:
                    type: integer
                    example: 1
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:phone/whatsapp_conversations:
    get:
      tags:
        - Customers
      summary: Customer/:phone/whatsapp_conversations
      description: Obtén la conversación de Whatsapp del cliente por número de teléfono
      operationId: customer/phone/whatsapp_conversations
      parameters:
        - name: page
          in: query
          description: Busca la página específica de conversaciónes
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de mensajes que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  whatsapp_conversations:
                    type: array
                    items:
                      $ref: '#/components/schemas/whatsapp_api_message'
                  total_pages:
                    type: integer
                    example: 1
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:id/messenger_conversations:
    get:
      tags:
        - Customers
      summary: Customer/:id/messenger_conversations
      description: Obtén la conversación de Messenger del cliente
      operationId: customer/id/messenger_conversations
      parameters:
        - name: page
          in: query
          description: Busca la página específica de conversaciónes
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de mensajes que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  messenger_conversations:
                    type: array
                    items:
                      $ref: '#/components/schemas/messenger_message'
                  total_pages:
                    type: integer
                    example: 1
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:id/instagram_conversations:
    get:
      tags:
        - Customers
      summary: Customer/:id/instagram_conversations
      description: Obtén la conversación de Instagram del cliente
      operationId: customer/id/instagram_conversations
      parameters:
        - name: page
          in: query
          description: Busca la página específica de conversaciónes
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de mensajes que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  instagram_conversations:
                    type: array
                    items:
                      $ref: '#/components/schemas/messenger_message'
                  total_pages:
                    type: integer
                    example: 1
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/customers/:id/customer_events_history:
    get:
      tags:
        - Customer events
      summary: Get Customer Events
      description: Obtiene los eventos del cliente
      operationId: customers/:id/customer_events
      parameters:
        - name: page
          in: query
          description: Busca la página específica de eventos
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de eventos que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create_customer_event'
        '401':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/deals:
    get:
      summary: Obtener deals
      tags:
        - Deals
      description: Obtén la lista de negociaciones
      operationId: ListDeal
      security:
        - api-key: []
      parameters:
        - name: funnel_name
          in: query
          description: Nombre del embudo
          required: true
          schema:
            type: string
            example: Negociaciones
        - name: stage
          in: query
          description: Nombre de la etapa
          required: true
          schema:
            type: string
            example: Calificado
        - name: page
          in: query
          description: número de pagina
          schema:
            type: integer
            example: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/index'
        '404':
          description: not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: stage not found
    post:
      summary: Create deal
      tags:
        - Deals
      description: Crea una nueva negociación
      operationId: CreateDeal
      security:
        - api-key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                funnel_name:
                  type: string
                  example: Negociaciones
                stage:
                  type: string
                  example: Calificado
                deal:
                  type: object
                  properties:
                    amount:
                      type: string
                      example: '150000'
                    name:
                      type: string
                    customer_id:
                      type: string
                      example: 91989a87
                    agent_id:
                      type: integer
                    lead_status:
                      type: string
                      enum:
                        - cold
                        - warm
                        - hot
                      example: cold
                    opening_date:
                      type: string
                      format: date
                      example: '2024-05-16'
                    expected_close_date:
                      type: string
                      format: date
                      example: '2024-05-23'
              required:
                - funnel_name
                - stage
                - deal
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create'
        '422':
          description: No se pudo procesar el recurso
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
                    example: unprocessable entity
  /retailers/api/v1/deals/{id}:
    get:
      summary: deals/:id
      tags:
        - Deals
      description: Obtén una negociacion
      operationId: GetDeal
      security:
        - api-key: []
      parameters:
        - name: id
          in: path
          required: true
          description: ID de la negociación
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get'
        '404':
          description: La negociación no existe
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: deal not found
    put:
      summary: deals/:id
      tags:
        - Deals
      description: Actualiza una negociación
      operationId: UpdateDeal
      security:
        - api-key: []
      parameters:
        - name: id
          in: path
          required: true
          description: ID de la negociación
          schema:
            type: string
            example: 9c6d04017
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                funnel_name:
                  type: string
                  example: Negociaciones
                stage:
                  type: string
                  example: Calificado
                deal:
                  type: object
                  properties:
                    amount:
                      type: string
                      example: '150000'
                    name:
                      type: string
                      example: Ricardo - pavo
                    customer_id:
                      type: string
                      example: 91989a87
                    lead_status:
                      type: string
                      example: cold
                    opening_date:
                      type: string
                      format: date
                      example: '2024-05-16'
                    expected_close_date:
                      type: string
                      format: date
                      example: '2024-05-23'
                    funnel_name:
                      type: string
                      example: Negociaciones
                    stage:
                      type: string
                      example: Calificado
              required:
                - funnel_name
                - stage
                - deal
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update'
        '404':
          description: La negociación no existe
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: deal not found
        '422':
          description: No se pudo procesar el recurso
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: string
                    example: unprocessable entity
    delete:
      summary: deals/:id
      tags:
        - Deals
      description: Elimina una negociación
      operationId: deleteDeal
      security:
        - api-key: []
      parameters:
        - name: id
          in: path
          required: true
          description: ID de la negociación
          schema:
            type: string
            example: 93390836
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: deal was deleted successfully
        '404':
          description: negociación no existe
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: deal not found
        '422':
          description: Error al procesar el recurso
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error deleting deal
  /retailers/api/v1/messenger_conversations:
    get:
      tags:
        - Messenger
      summary: Messenger conversations
      description: Obtén los clients que te han escrito por messenger
      operationId: messengerClients
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Messenger conversations
              properties:
                page:
                  type: number
                results_per_page:
                  type: number
                unassigned:
                  type: boolean
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: integer
                    example: 155
                  total_pages:
                    type: integer
                    example: 2
                  messenger_conversations:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 621osgzy4696283
                        first_name:
                          type: string
                          example: Claudia
                        last_name:
                          type: string
                          example: Funnel
                        email:
                          type:
                            - string
                            - 'null'
                          example: 'null'
                        message_count:
                          type: integer
                          example: 3
                        last_interaction:
                          type: string
                          example: '2023-04-17T05:08:17.085Z'
                        agent_id:
                          type: integer
                          example: 4637
        '400':
          description: Unauthorized
  /retailers/api/v1/whatsapp_templates:
    get:
      tags:
        - WhatsApp
      summary: WhatsApp Business Api Templates
      description: Obtén los templates/plantillas creadas en WhatsApp Business API
      operationId: whatsappTemplates
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: WhatsApp Business Api templates
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  templates:
                    type: array
                    items:
                      type: object
                      properties:
                        text:
                          type: string
                          example: Hola *! ✋
                        status:
                          type: string
                          example: accepted
                        template_type:
                          type: string
                          example: text
                        internal_id:
                          type: string
                          example: c0c040f6-9809-404a-961c-637b109ef410
        '400':
          description: Unauthorized
  /retailers/api/v1/whatsapp/send_notification_by_id:
    post:
      tags:
        - WhatsApp
      summary: Send WhatsApp Message for WhatsApp Business API
      description: >-
        Para enviar un mensaje de WhatsApp cuando se tiene una conexión oficial
        al API de WhatsApp, sólo se requieren los parámetros phone_number,
        internal_id y template_params; los demás son opcionales. Si se tiene una
        conexión vía QR, por favor revisa la sección de envío de mensajes vía
        QR.
      operationId: sendWhatsAppApi
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/whatsapp_api_message'
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whatsapp_api_message'
        '400':
          description: Unauthorized
  /retailers/api/v1/whatsapp/send_message:
    post:
      tags:
        - WhatsApp
      summary: Send WhatsApp Message for WhatsApp Business QR
      description: >-
        Enviar un mensaje de WhatsApp cuando tienes una conexión oficial por QR.
        Los únicos parametros requeridos son phone_number y message, el resto de
        parámetros son opcionales.
      operationId: sendWhatsAppQr
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/whatsapp_api_message'
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whatsapp_api_message'
        '400':
          description: Unauthorized
  /retailers/api/v1/flows:
    get:
      tags:
        - Flows
      summary: Get all flows
      description: Obtén todos los flows
      operationId: flows
      parameters:
        - name: page
          in: query
          description: Busca la página específica de flows
          schema:
            type: number
        - name: results_per_page
          in: query
          description: Selecciona el número de flows que serán visualizados por página
          schema:
            type: number
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_flows'
        '401':
          description: Unauthorized
        '404':
          description: Not found
  /retailers/api/v1/flow_deactivation:
    post:
      tags:
        - Flows
      summary: Deactivate flows by platform
      description: >-
        Desactiva todos los flows que estén previamente activos por customer y
        plataforma específica
      operationId: flow_deactivation
      security:
        - api-key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  example: d126hhh
                  description: >-
                    Id del customer(Opcional, siempre y cuando se busque por
                    customer_phone)
                customer_phone:
                  type: string
                  example: '+573201548587'
                  description: >-
                    Teléfono del customer(Opcional, siempre y cuando se busque
                    por customer_id)
                platform:
                  type: string
                  example: whatsapp
                  description: >-
                    Plataforma sobre la cual se realizará la búsqueda para
                    pre-activar un flow específico para el customer. Sólo se
                    permiten los valores de 'whatsapp', 'messenger' o
                    'instagram'
              required:
                - customer_id
                - customer_phone
                - platform
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deactivate_flows'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
  /retailers/api/v1/flow_pre_activation:
    post:
      tags:
        - Flows
      summary: Pre-activate flow by platform
      description: >-
        Pre-activa un flow en específico para un customer y plataforma
        específica, siempre y cuando el flow esté activo, tenga un paso inicial
        configurado y la plataforma para dicho flow esté activa. Esta operación
        solo está habilitada para flows con versión 2. Si deseas usar un flow
        con versión 1, debes hacer upgrade del mismo.
      operationId: flow_pre_activation
      security:
        - api-key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  example: d126hhh
                  description: >-
                    Id del customer(Opcional, siempre y cuando se busque por
                    customer_phone)
                customer_phone:
                  type: string
                  example: '+573201548587'
                  description: >-
                    Teléfono del customer(Opcional, siempre y cuando se busque
                    por customer_id)
                flow_id:
                  type: string
                  example: d82ijd8
                  description: Id del flow
                platform:
                  type: string
                  example: whatsapp
                  description: >-
                    Plataforma sobre la cual se realizará la búsqueda para
                    pre-activar un flow específico para el customer. Sólo se
                    permiten los valores de 'whatsapp', 'messenger' o
                    'instagram'
              required:
                - customer_id
                - customer_phone
                - flow_id
                - platform
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pre_activate_flow'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
  /api/v1/orders:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    get:
      tags:
        - Orders
      summary: Orders
      description: Obtén los datos de tus órdenes
      operationId: orders
      parameters:
        - name: created_from
          in: query
          description: busca las órdenes creadas desde una fecha en especifico
          schema:
            type: string
        - name: created_to
          in: query
          description: busca las órdenes creadas hasta una fecha en especifico
          schema:
            type: string
        - name: page
          in: query
          description: busca la pagina específica de órdenes
          schema:
            type: integer
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    orders:
                      - web_id: EzLGaK0YZa
                        status: pending
                        subtotal: '200.0'
                        tax_amount: '0.0'
                        total: '200.0'
                        shipping_value: '0.0'
                        notes: ''
                        sales_channel: null
                        created_at: '2023-05-17T01:42:57.624Z'
                        archived: false
                        customer:
                          first_name: 'Henry '
                          last_name: Tonato
                          email: henry@gmail.com
                          phone: '593995141472'
                          address: ''
                          city: ''
                          state: ''
                          country_id: EC
                          zip_code: ''
                          id_number: ''
                          document_label: null
                          web_id: EleO7OTOer
                        order_items:
                          - id: 58779
                            quantity: 1
                            unit_price: '200.0'
                            total: '200.0'
                            title: Mensajes
                            sku: Col.2556
                            image_url: {}
                    total_pages: 1
        '400':
          description: Unauthorized
    post:
      tags:
        - Orders
      summary: Create Order
      description: >-
        Crea una nueva órden, puedes enviar el número de teléfono o email del
        cliente si ya esta creado en mercately, si no existe, creará el cliente.
      operationId: createOrder
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Order
              properties:
                order:
                  type: object
                  properties:
                    sales_channel:
                      type: string
                    notes:
                      type: string
                    address:
                      type: string
                    city:
                      type: string
                    state:
                      type: string
                    zip_code:
                      type: string
                    delivery_method:
                      type: string
                      enum:
                        - send_order
                        - store_pickup
                    status:
                      type: string
                      enum:
                        - pending
                        - canceled
                        - success
                    shipping_value:
                      type: number
                      format: float
                    customer_attributes:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                        email:
                          type: string
                        phone:
                          type: string
                    order_items_attributes:
                      type: array
                      items:
                        type: object
                        properties:
                          product_id:
                            type: string
                          quantity:
                            type: integer
                          unit_price:
                            type: number
                            format: float
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Órden creada con éxito
                    product:
                      web_id: aAKpT9laN5
                      status: pending
                      subtotal: '400.0'
                      tax_amount: '0.0'
                      total: '405.0'
                      shipping_value: '5.0'
                      sales_channel: 'null'
                      notes: New notes
                      created_at: '2023-06-12T18:26:58.534Z'
                      archived: 'false'
                      customer:
                        first_name: Juan
                        last_name: Campos
                        email: juan@email42.com
                        phone: '593996459124'
                        address: ''
                        city: ''
                        state: ''
                        country_id: EC
                        zip_code: ''
                        id_number: ''
                        document_label: cedula
                        web_id: bReccZpRjO
                      order_items:
                        - quantity: 2
                          unit_price: '200.0'
                          total: '400.0'
                          title: Mensajes
                          sku: Col.2556
                          image_url: {}
        '400':
          description: Unauthorized
  /api/v1/orders/web_id:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    put:
      tags:
        - Orders
      summary: Order
      description: Actualiza una órden buscada su id
      operationId: updateOrder
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Order
              properties:
                order:
                  type: object
                  properties:
                    sales_channel:
                      type: string
                    notes:
                      type: string
                    address:
                      type: string
                    city:
                      type: string
                    state:
                      type: string
                    zip_code:
                      type: string
                    delivery_method:
                      type: string
                      enum:
                        - send_order
                        - store_pickup
                    status:
                      type: string
                      enum:
                        - pending
                        - canceled
                        - success
                    shipping_value:
                      type: number
                      format: float
                    customer_attributes:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                        email:
                          type: string
                        phone:
                          type: string
                          description: >-
                            Must be in international format, including the
                            international dialing code.
                      required:
                        - email
                        - phone
                    order_items_attributes:
                      type: array
                      items:
                        type: object
                        properties:
                          product_id:
                            type: string
                          quantity:
                            type: integer
                          unit_price:
                            type: number
                            format: float
                        required:
                          - product_id
                          - quantity
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Órden actualizada con éxito
                    order:
                      web_id: 4Bs2mKblN3
                      status: success
                      subtotal: '60.0'
                      tax_amount: '0.0'
                      total: '65.0'
                      shipping_value: '5.0'
                      sales_channel: null
                      notes: New notes
                      created_at: '2023-06-13T03:31:06.825Z'
                      archived: false
                      customer:
                        first_name: Henry
                        last_name: Campos
                        email: null
                        phone: null
                        address: null
                        city: null
                        state: null
                        country_id: null
                        zip_code: null
                        id_number: null
                        document_label: null
                        web_id: sVnez19hSa
                      order_items:
                        - quantity: 3
                          unit_price: '20.0'
                          total: '60.0'
                          title: Mensajes
                          sku: Col.2556
                          image_url: {}
        '400':
          description: Unauthorized
        '404':
          description: Not found
    delete:
      tags:
        - Orders
      summary: Orders
      description: Borra una órden
      operationId: deleteOrder
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Órden borrada con éxito
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /api/v1/products:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    get:
      tags:
        - Products
      summary: Products
      description: Obtén los datos de tus productos
      operationId: products
      parameters:
        - name: page
          in: query
          description: busca la pagina específica de productos
          schema:
            type: integer
            default: 1
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    products:
                      - web_id: CRasFSldo7
                        title: Mensajes
                        description: Paquete mensajes Outbound e Inbound Colombia
                        quantity: 13
                        price: '200.0'
                        active: true
                        url: null
                        sku: Col.2556
                        wholesale_price: null
                        images: []
                        subcategory:
                          name: Alámbricos
                          web_id: GETPvRKnBD
                        category:
                          name: Tecnología
                          web_id: ljsJpi0fTR
                    total_pages: 4
        '400':
          description: Unauthorized
    post:
      tags:
        - Products
      summary: Create Product
      description: |
        Crea un nuevo producto.  
        Envía máximo 3 opciones.  

        **Ejemplo de `options`:**
        ```json
        "options": [
          { "name": "Talla", "values": ["SM", "LG", "XL", "MD"] },
          { "name": "Color", "values": ["Red", "Blue"] }
        ]
        ```

        Para las variantes, combina los valores de las opciones.

        **Ejemplo de `variants`:**
        ```json
        "variants": [
          { "price": 12, "wholesale_price": 10, "sku": "VAR-001", "option1": "SM", "option2": "Red" },
          { "price": 14, "wholesale_price": 10, "sku": "VAR-002", "option1": "LG", "option2": "Red" },
          { "price": 25, "wholesale_price": 13, "sku": "VAR-003", "option1": "XL", "option2": "Blue" }
        ]
        ```
      operationId: createProduct
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Vehicle
              properties:
                product:
                  type: object
                  title: Product
                  properties:
                    title:
                      type: string
                    description:
                      type: string
                    sku:
                      type: string
                    quantity:
                      type: integer
                    active:
                      type: boolean
                    price:
                      type: number
                    subcategory_id:
                      type: string
                    image_urls:
                      type: array
                      items:
                        type: string
                    options:
                      type: array
                      title: Options (Máximo 3)
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          values:
                            type: array
                            items:
                              type: string
                    variants:
                      type: array
                      title: Variants
                      items:
                        type: object
                        properties:
                          price:
                            type: number
                          wholesale_price:
                            type: number
                          sku:
                            type: string
                          quantity:
                            type: number
                          image:
                            type: string
                          variant_url:
                            type: string
                          option1:
                            type: string
                          option2:
                            type: string
                          option3:
                            type: string
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Producto creado con éxito
                    product:
                      web_id: FzOWVvUwbC
                      title: Product 001
                      description: Product 001
                      quantity: 20
                      price: '1.5'
                      active: true
                      url: null
                      sku: p004
                      wholesale_price: '0.0'
                      images:
                        - >-
                          https://d3a4wxp51vazl1.cloudfront.net/uploads/506/product_attachment/FzOWVvUwbC/qrewrwYdhfNDCqW3hv4MTiwFq.jpg
                      subcategory:
                        name: Alámbricos
                        web_id: GETPvRKnBD
                      category:
                        name: Tecnología
                        web_id: ljsJpi0fTR
                      product_variants:
                        - name: Talla
                          web_id: AbHj6GqcMF
                          product_variant_options:
                            - name: SM
                              web_id: 3I6zc3DGMY
                            - name: LG
                              web_id: 57gl2i88SZ
                            - name: XL
                              web_id: J7PFMLX9wA
                        - name: Color
                          web_id: vVlmXsA2Bm
                          product_variant_options:
                            - name: Azul
                              web_id: Xe9QkMiD1i
                            - name: Negro
                              web_id: Y8zjQ7BPY4
                      product_variant_combinations:
                        - name: SM/Azul
                          price: '33.0'
                          wholesale_price: null
                          sku: SKU-EX1
                          quantity: 10
                          image: >-
                            https://dc2p3rqc7bvrd.cloudfront.net/uploads/1/product_variant_combination/x0wsCBTIMI/camisa-del-producto_40x403x.webp
                          variant_url: null
                        - name: XL/Azul
                          price: '33.0'
                          wholesale_price: null
                          sku: SKU-EX5
                          quantity: 10
                          image: ''
                          variant_url: null
        '400':
          description: Unauthorized
  /api/v1/products/:id_or_sku:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    get:
      tags:
        - Products
      summary: Product
      description: Obtén los datos de un producto en especifico buscado su id
      operationId: searchProduct
      parameters:
        - name: web_id
          in: query
          description: The web_id of the product
          required: false
          schema:
            type: string
        - name: sku
          in: query
          description: The SKU of the product
          required: false
          schema:
            type: string
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    web_id: CRasFSldo7
                    title: Mensajes
                    description: Paquete de mensajes Outbound
                    quantity: 13
                    price: '200.0'
                    active: true
                    url: null
                    sku: Col.2556
                    wholesale_price: null
                    images: []
                    subcategory:
                      web_id: GETPvRKnBD
                      name: Alámbricos
                      description: ''
                      products_count: 5
                      active_products_count: 2
                    category:
                      web_id: ljsJpi0fTR
                      name: Tecnología
                      description: ''
                      products_count: 11
                      active_products_count: 6
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /api/v1/product/web_id:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    put:
      tags:
        - Products
      summary: Product
      description: >
        Actualiza un producto buscado su id  

        Envía máximo 3 opciones.  


        **Ejemplo de `options`:**

        ```json

        "options": [
          { "name": "Talla", "values": ["SM", "LG", "XL", "MD"] },
          { "name": "Color", "values": ["Red", "Blue"] }
        ]

        ```


        Para las variantes, combina los valores de las opciones.


        **Ejemplo de `variants`:**

        ```json

        "variants": [
          { "price": 12, "wholesale_price": 10, "sku": "VAR-001", "option1": "SM", "option2": "Red" },
          { "price": 14, "wholesale_price": 10, "sku": "VAR-002", "option1": "LG", "option2": "Red" },
          { "price": 25, "wholesale_price": 13, "sku": "VAR-003", "option1": "XL", "option2": "Blue" }
        ]

        ```


        Para eliminar todas las opciones y variantes envía:

        ```json

        "options": [],

        "variants": []

        ```


        Si no deseas hacer cambios en opciones ni variantes, **no envíes los
        keys** `"options"` ni `"variants"`.  

        Si quieres hacer actualizaciones, envía `"options"` y `"variants"` con
        los cambios.
      operationId: updateProduct
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Vehicle
              properties:
                product:
                  type: object
                  title: Product
                  properties:
                    title:
                      type: string
                    description:
                      type: string
                    sku:
                      type: string
                    quantity:
                      type: integer
                    active:
                      type: boolean
                    price:
                      type: number
                    subcategory_id:
                      type: string
                    image_urls:
                      type: array
                      items:
                        type: string
                    options:
                      type: array
                      title: Options (Máximo 3)
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                            title: ejm('Color')
                          values:
                            type: array
                            items:
                              type: string
                              title: ejm('Red')
                    variants:
                      type: array
                      title: Variants
                      items:
                        type: object
                        properties:
                          price:
                            type: number
                          wholesale_price:
                            type: number
                          sku:
                            type: string
                          quantity:
                            type: number
                          image:
                            type: string
                          variant_url:
                            type: string
                          option1:
                            type: string
                            title: Un valor de la options[1] de values ejm('Red')
                          option2:
                            type: string
                            title: Un valor de la options[2] de values ejm('SM')
                          option3:
                            type: string
                            title: Un valor de la options[3] de values ejm('Lino')
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Producto actualizado con éxito
                    product:
                      web_id: FzOWVvUwbC
                      title: Product 001
                      description: Product 001
                      quantity: 20
                      price: '1.5'
                      active: true
                      url: null
                      sku: p004
                      wholesale_price: '0.0'
                      images:
                        - >-
                          https://d3a4wxp51vazl1.cloudfront.net/uploads/506/product_attachment/FzOWVvUwbC/qrGZwYdhfewrW3hv4MTiwFq.jpg
                      subcategory:
                        name: Alámbricos
                        web_id: GETPvRKnBD
                      category:
                        name: Tecnología
                        web_id: ljsJpi0fTR
                      product_variants:
                        - name: Talla
                          web_id: AbHj6GqcMF
                          product_variant_options:
                            - name: SM
                              web_id: 3I6zc3DGMY
                            - name: LG
                              web_id: 57gl2i88SZ
                            - name: XL
                              web_id: J7PFMLX9wA
                        - name: Color
                          web_id: vVlmXsA2Bm
                          product_variant_options:
                            - name: Azul
                              web_id: Xe9QkMiD1i
                            - name: Negro
                              web_id: Y8zjQ7BPY4
                      product_variant_combinations:
                        - name: SM/Azul
                          price: '33.0'
                          wholesale_price: null
                          sku: SKU-EX1
                          quantity: 10
                          image: >-
                            https://dc2p3rqc7bvrd.cloudfront.net/uploads/1/product_variant_combination/x0wsCBTIMI/camisa-del-producto_40x403x.webp
                          variant_url: null
                        - name: XL/Azul
                          price: '33.0'
                          wholesale_price: null
                          sku: SKU-EX5
                          quantity: 10
                          image: ''
                          variant_url: null
        '400':
          description: Unauthorized
        '404':
          description: Not found
    delete:
      tags:
        - Products
      summary: Product
      description: Borra un producto buscado su id
      operationId: deleteProduct
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    message: Producto eliminado con éxito
                    product:
                      web_id: tUCJZrCUs5
                      title: Abrigo borrego
                      description: "Abrigo crema con lana de borrego.\r\nTallas: XS, S, M, L, XL, XXL."
                      quantity: 41
                      price: '8.0'
                      active: true
                      url: null
                      sku: AB.577
                      wholesale_price: '6.0'
                      images:
                        - >-
                          https://d3a4wxp51vazl1.cloudfront.net/uploads/506/product_attachment/tUCJZrCUs5/7-01.jpg
                        - >-
                          https://d3a4wxp51vazl1.cloudfront.net/uploads/506/product_attachment/tUCJZrCUs5/8-01.jpg
                        - >-
                          https://d3a4wxp51vazl1.cloudfront.net/uploads/506/product_attachment/tUCJZrCUs5/9-01.jpg
                      subcategory:
                        name: Abrigos
                        web_id: EM5FJCF7sY
                      category:
                        name: Abrigos y chaquetas
                        web_id: maFDOHylFB
        '400':
          description: Unauthorized
        '404':
          description: Not found
  /api/v1/categories:
    servers:
      - url: https://mercately.shop
        description: Shops API Production server
    get:
      tags:
        - Categories
      summary: Categories
      description: Obtén los datos de tus categorías
      operationId: categories
      parameters:
        - name: page
          in: query
          description: busca la pagina específica de categorías
          schema:
            type: integer
      security:
        - api-key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
              examples:
                response:
                  value:
                    categories:
                      - web_id: ljsJpi0fTR
                        name: Tecnología
                        description: ''
                        products_count: 7
                        subcategories:
                          - web_id: GETPvRKnBD
                            name: Alámbricos
                            description: ''
                            products_count: 3
                          - web_id: 8Kncn44rQD
                            name: 3 en 1
                            description: ''
                            products_count: 4
                    total_pages: 1
        '400':
          description: Unauthorized
components:
  securitySchemes:
    api-key:
      type: apiKey
      name: api-key
      in: header
      description: API Key authentication
  schemas:
    agents:
      type: object
      title: Agent
      properties:
        id:
          type: integer
          example: 9
        first_name:
          type: string
          example: Nicolas
        last_name:
          type: string
          example: Mena Garzon
        email:
          type: string
          example: nicolas@mercately.com
        active:
          type: boolean
          example: true
        agent:
          type: boolean
          example: false
        admin:
          type: boolean
          example: true
        supervisor:
          type: boolean
          example: true
    customer:
      type: object
      title: Customer
      properties:
        id:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        phone:
          type: string
        id_type:
          type: string
          enum:
            - cedula
            - pasaporte
            - ruc
            - rut
            - otro
        id_number:
          type: string
        customer_addresses_attributes:
          type: array
          items:
            type: object
            properties:
              address:
                type: string
              city:
                type: string
              state:
                type: string
              zip_code:
                type: string
              country_id:
                type: integer
              latitude:
                type: string
              longitude:
                type: string
              description:
                type: string
              main:
                type: boolean
        notes:
          type: string
        agent_id:
          type: integer
        tags:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: boolean
        custom_fields:
          type: array
          items:
            type: object
            properties:
              field_name:
                type: string
              field_content:
                type: string
        outbound_status:
          type: string
          enum:
            - error
            - submitted
            - enqueued
            - sent
            - delivered
            - read
        campaign_id:
          type: integer
        campaign_url:
          type: string
        error_message:
          type: string
        creation_date:
          type: string
          format: date
        sent_at:
          type: string
          format: date
        delivered_at:
          type: string
          format: date
        read_at:
          type: string
          format: date
        last_chat_interaction:
          type: string
          format: date
    create_customer:
      type: object
      properties:
        message:
          type: string
          example: Customer created successfully
        customer:
          $ref: '#/components/schemas/customer'
    get_customer:
      type: object
      properties:
        message:
          type: string
          example: Customer found successfully
        customer:
          $ref: '#/components/schemas/customer'
    update_customer:
      type: object
      properties:
        message:
          type: string
          example: Customer updated successfully
        customer:
          $ref: '#/components/schemas/customer'
    customer_event:
      type: object
      title: Customer
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        phone:
          type: string
        id_type:
          type: string
          enum:
            - cedula
            - pasaporte
            - ruc
            - rut
            - otro
        id_number:
          type: string
        customer_addresses_attributes:
          type: array
          items:
            type: object
            properties:
              address:
                type: string
              city:
                type: string
              state:
                type: string
              zip_code:
                type: string
              country_id:
                type: integer
              latitude:
                type: string
              longitude:
                type: string
              description:
                type: string
              main:
                type: boolean
        notes:
          type: string
        agent_id:
          type: integer
        tags:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: boolean
        custom_fields:
          type: array
          items:
            type: object
            properties:
              field_name:
                type: string
              field_content:
                type: string
        outbound_status:
          type: string
          enum:
            - error
            - submitted
            - enqueued
            - sent
            - delivered
            - read
        campaign_id:
          type: integer
        campaign_url:
          type: string
        error_message:
          type: string
        creation_date:
          type: string
          format: date
        sent_at:
          type: string
          format: date
        delivered_at:
          type: string
          format: date
        read_at:
          type: string
          format: date
        last_chat_interaction:
          type: string
          format: date
    create_customer_event:
      type: object
      properties:
        messages:
          type: string
          example: Customer event created successfully
    whatsapp_api_message:
      properties:
        id:
          type: string
          example: false_5219997466670@c.us_3A581ECA7FABCA92B2FE
        status:
          type: string
          example: read
        direction:
          type: string
          example: inbound
        channel:
          type: string
          example: whatsapp
        message_type:
          type: string
          example: conversation
        message_identifier:
          type: string
          example: msg_123456789
        created_time:
          type: string
          example: '2023-06-13T19:59:04.000Z'
        replied_message:
          type: string
          example: Hello, how can I help you?
        filename:
          type: string
          example: image123.jpg
        content_type:
          type: string
          example: media
        content_text:
          type: string
          example: This is a sample text message.
        content_media_url:
          type: string
          example: https://example.com/media/image123.jpg
        content_media_caption:
          type: string
          example: Check out this image!
        content_media_type:
          type: string
          example: sticker
        content_location_longitude:
          type: string
          example: '-99.1332'
        content_location_latitude:
          type: string
          example: '19.4326'
        content_location_label:
          type: string
          example: Zócalo CDMX
        content_location_address:
          type: string
          example: Plaza de la Constitución, Centro, Ciudad de México
        account_uid:
          type: string
          example: false_5219997466670@c.us_3A581ECA7FABCA92B2FE
        contacts_information:
          type: string
          example: '[{"name": "John Doe", "phone": "+5219997466670"}]'
        error_code:
          type: string
          example: ERR_001
        error_message:
          type: string
          example: Invalid media type
    messenger_message:
      type: object
      properties:
        results:
          type: integer
          example: 155
        total_pages:
          type: integer
          example: 2
        messenger_conversations:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: 621osgzy4696283
              first_name:
                type: string
                example: Claudia
              last_name:
                type: string
                example: Funnel
              email:
                type:
                  - string
                  - 'null'
                example: 'null'
              message_count:
                type: integer
                example: 3
              last_interaction:
                type: string
                example: '2023-04-17T05:08:17.085Z'
              agent_id:
                type: integer
                example: 4637
    agent:
      type: object
      title: Agent
      properties:
        id:
          type: integer
          example: 9
        first_name:
          type: string
          example: Nicolas
        last_name:
          type: string
          example: Mena Garzon
        email:
          type: string
          example: nicolas@mercately.com
        active:
          type: boolean
          example: true
        agent:
          type: boolean
          example: false
        admin:
          type: boolean
          example: true
        supervisor:
          type: boolean
          example: true
    customer_lite:
      type: object
      title: CustomerLite
      properties:
        id:
          type: string
          example: 91989a87
        first_name:
          type: string
          example: javier
        last_name:
          type: string
          example: Salinas
        email:
          type: string
          format: email
          example: javier@example.com
        phone:
          type: string
          example: 5933505692996
    deal:
      type: object
      properties:
        id:
          type: string
          example: 9fb882221
        name:
          type: string
          example: Neptu
        amount:
          type: string
          example: '150000.0'
        currency:
          type: string
          example: $
        funnel_name:
          type: string
          example: Negociaciones
        stage:
          type: string
          example: Calificado!
        agent:
          $ref: '#/components/schemas/agent'
        customer:
          $ref: '#/components/schemas/customer_lite'
        channel:
          type:
            - string
            - 'null'
    index:
      type: object
      properties:
        total:
          type: integer
          example: 2
        total_page:
          type: integer
          example: 1
        deals:
          type: array
          items:
            $ref: '#/components/schemas/deal'
    create:
      type: object
      properties:
        message:
          type: string
          example: deal was created successfully
        deal:
          $ref: '#/components/schemas/deal'
    get:
      type: object
      properties:
        message:
          type: string
          example: deal found successfully
        deal:
          $ref: '#/components/schemas/deal'
    update:
      type: object
      properties:
        message:
          type: string
          example: deal was updated successfully
        deal:
          $ref: '#/components/schemas/deal'
    flow:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        version:
          type: integer
          example: 2
        enabled:
          type: boolean
        whatsapp:
          type: boolean
        messenger:
          type: boolean
        instagram:
          type: boolean
    get_flows:
      type: object
      properties:
        results:
          type: integer
          example: 1
        total_pages:
          type: integer
          example: 1
        flows:
          type: array
          items:
            $ref: '#/components/schemas/flow'
    deactivate_flows:
      type: object
      properties:
        message:
          type: string
          example: Flows by platform successfully deactivated
        info:
          type: array
    pre_activate_flow:
      type: object
      properties:
        message:
          type: string
          example: Flow successfully preactivated
        info:
          type: array
