openapi: 3.1.0
x-stoplight:
  id: f4qj8zs4y0m1k
info:
  title: Easyflow
  version: '1.0'
  summary: Easyflow API Document
  contact:
    name: ''
    email: ''
    url: ''
  termsOfService: ''
  license:
    name: ''
  description: >
    This is the API documentation and must be used by everyone who wants to
    integrate with the Easyflow platform.

    - [Pixel SDK](https://www.npmjs.com/package/@easyflow/pixel)

    - [Web SDK](https://www.npmjs.com/package/@easyflow/javascript-sdk)
servers:
  - url: https://wz0ppvhzw7.execute-api.sa-east-1.amazonaws.com
    description: Production environment URL
tags:
  - name: Authentication
  - name: Users
  - name: Organizations
  - name: Sales
  - name: Commissions
  - name: Financial
  - name: Subscriptions
paths:
  /identity/sign-in:
    post:
      summary: Sign In
      tags:
        - Authentication
      operationId: identitySignIn
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: User email or username.
                password:
                  type: string
                  format: password
                  description: User password.
              required:
                - username
                - password
      responses:
        '200':
          description: >-
            If the request is successful, the response will include the access
            and refresh tokens along with account data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        description: JWT access token.
                      refreshToken:
                        type: string
                        description: JWT refresh token.
                      authenticationType:
                        type: string
                        description: Type of token returned.
                        example: Bearer
                      account:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: Account unique identifier.
                          username:
                            type: string
                            description: Account username or email.
                          status:
                            type: string
                            description: Account status.
                            example: activated
                          createdAt:
                            type: string
                            format: date-time
                            description: When the account was created.
                          emailHasBeenValidated:
                            type: boolean
                            description: Whether the email has been validated.
                          phoneHasBeenValidated:
                            type: boolean
                            description: Whether the phone has been validated.
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: User unique identifier.
                          name:
                            type: string
                            description: Full name of the user.
                      loggedAt:
                        type: string
                        format: date-time
                        description: Time when the login occurred.
                      observation:
                        type: object
                        description: >-
                          Contains information about authentication constraints
                          or requirements.
                        properties:
                          code:
                            type: integer
                            description: >
                              Observation code. Possible values:

                              - **1** → `ALL_RIGHT` (no additional action
                              required)

                              - **2** → `TWO_FACTOR_VERIFICATION_NEEDED`
                              (two-factor verification is required)

                              - **3** → `DEVICE_RECOGNITION_NEEDED` (device
                              recognition is required)
                            enum:
                              - 1
                              - 2
                              - 3
                            example: 1
                          message:
                            type: string
                            description: >
                              Human-readable message related to the observation
                              code.  

                              Possible values:

                              - `all right`

                              - `two factor verification needed`

                              - `device recognition needed`
                            enum:
                              - all right
                              - two factor verification needed
                              - device recognition needed
                            example: all right
              example:
                statusCode: 200
                data:
                  token: >-
                    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiI1MDU0MGJlMi0xYmRhLTQxYjktYTY2NC0zNDUzMGExYTc1Y2IiLCJ1c2VySWQiOiI1MDU3OGE4Zi1iOTU4LTRlNTgtOTI3Ni05NDMzNzBhZjMyNTciLCJuYW1lIjoiR3VpbGhlcm1lIEdvbmNhbHZlcyBMaXNib2EiLCJhY2Vzc1JvbGVzIjpbImJhc2ljIiwiYWRtaW4iXSwiZW1haWwiOiJndWltZTAxNjJAZ21haWwuY29tIiwiaWF0IjoxNzU3NzA0NjU4LCJleHAiOjE3NTc3NDc4NTh9.mp3k9Wvenqspw_7VLK_lrnj4x4np9clU8yFpGugy9Ic
                  refreshToken: >-
                    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiI1MDU0MGJlMi0xYmRhLTQxYjktYTY2NC0zNDUzMGExYTc1Y2IiLCJ1c2VySWQiOiI1MDU3OGE4Zi1iOTU4LTRlNTgtOTI3Ni05NDMzNzBhZjMyNTciLCJuYW1lIjoiR3VpbGhlcm1lIEdvbmNhbHZlcyBMaXNib2EiLCJhY2Vzc1JvbGVzIjpbImJhc2ljIiwiYWRtaW4iXSwiZW1haWwiOiJndWltZTAxNjJAZ21haWwuY29tIiwiaWF0IjoxNzU3NzA0NjU4LCJleHAiOjE3NTgzMDk0NTh9.BXPxcCPRuikJ-ettzJqNhvimUexlQaCAw-DMbrhkaJY
                  authenticationType: Bearer
                  account:
                    id: 50540be2-1bda-41b9-a664-34530a1a75cb
                    username: joao@gmail.com
                    status: activated
                    createdAt: '2024-09-19T22:00:04.320Z'
                    emailHasBeenValidated: true
                    phoneHasBeenValidated: true
                  user:
                    id: 50578a8f-b958-4e58-9276-943370af3257
                    name: joão santos
                  loggedAt: '2025-09-12T19:17:38.346Z'
                  observation:
                    code: 1
                    message: all right
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /accounts/verify-2fa:
    post:
      summary: Verify 2FA
      tags:
        - Authentication
      operationId: verify2FA
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: The 2FA code sent to the user.
              required:
                - code
      responses:
        '200':
          description: If the 2FA code is valid, returns new access and refresh tokens.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        description: JWT access token.
                      refreshToken:
                        type: string
                        description: JWT refresh token.
                      code:
                        type: string
                        description: The 2FA code provided by the user.
              example:
                statusCode: 200
                data:
                  token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  refreshToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  code: '123456'
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /management/users/{userId}:
    get:
      summary: Get User
      description: Retrieve details of a specific user by their ID.
      tags:
        - Users
      security:
        - bearerAuth: []
      operationId: getUser
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - name: userId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the user.
      responses:
        '200':
          description: Successfully retrieved user data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier for the user.
                      email:
                        type: string
                        format: email
                      name:
                        type: string
                      birthDate:
                        type: string
                        format: date
                        description: User's date of birth (YYYY-MM-DD).
                      address:
                        type: object
                        properties:
                          zipCode:
                            type: string
                          street:
                            type: string
                          number:
                            type: string
                          complement:
                            type: string
                          neighborhood:
                            type: string
                          city:
                            type: string
                          state:
                            type: string
                      nickname:
                        type: string
                      phone:
                        type: object
                        properties:
                          areaCode:
                            type: string
                          ddd:
                            type: string
                          number:
                            type: string
                          isMobile:
                            type: boolean
                      document:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - CPF
                              - CNPJ
                          number:
                            type: string
                      picture:
                        type: object
                        properties:
                          name:
                            type: string
                          path:
                            type: string
                          url:
                            type: string
                            format: uri
                          isPublic:
                            type: boolean
                          extension:
                            type: string
              example:
                statusCode: 200
                data:
                  id: 9edc7869-721e-4c18-ad64-f143975e1255
                  email: eduardorotundaro@gmail.com
                  name: Eduardo Rotundaro
                  birthDate: '1995-12-27'
                  address:
                    zipCode: '02258090'
                    street: Antônio Rodrigues Braga
                    number: sem saida
                    complement: Vila Constança
                    neighborhood: São Paulo
                    city: São Paulo
                    state: '34'
                  nickname: Eduardo Rotundaro
                  phone:
                    areaCode: '+55'
                    ddd: '92'
                    number: '984292191'
                    isMobile: true
                  document:
                    type: CPF
                    number: '01620226626'
                  picture:
                    name: 1740575579059.jpeg
                    path: >-
                      easyflow-public-assets/management/users/9edc7869-721e-4c18-ad64-f143975e1255/profile
                    url: >-
                      https://easyflow-public-assets.s3.sa-east-1.amazonaws.com/management/users/9edc7869-721e-4c18-ad64-f143975e1250/profile/1740575579059.jpeg
                    isPublic: true
                    extension: jpeg
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /management/organizations/{id}:
    get:
      summary: Get Organization
      description: Retrieve details of a specific organization by its ID.
      tags:
        - Organizations
      security:
        - bearerAuth: []
      operationId: getOrganization
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the organization.
      responses:
        '200':
          description: Successfully retrieved organization data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier for the organization.
                      createdAt:
                        type: string
                        format: date-time
                        description: When the organization was created.
                      name:
                        type: string
                        description: Name of the organization.
                      document:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - CPF
                              - CNPJ
                          number:
                            type: string
                      collaborator:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            collaboratorType:
                              type: array
                              items:
                                type: string
                                description: Collaborator roles.
                      billing:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          address:
                            type: object
                            properties:
                              zipCode:
                                type: string
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                type: string
                              neighborhood:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                          contact:
                            type: object
                            properties:
                              email:
                                type: string
                              phone:
                                type: object
                                properties:
                                  areaCode:
                                    type: string
                                  ddd:
                                    type: string
                                  number:
                                    type: string
                                  isMobile:
                                    type: boolean
                              whatsApp:
                                type: object
                                properties:
                                  areaCode:
                                    type: string
                                  ddd:
                                    type: string
                                  number:
                                    type: string
                                  isMobile:
                                    type: boolean
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                          document:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - CPF
                                  - CNPJ
                              number:
                                type: string
                          phone:
                            type: object
                            properties:
                              areaCode:
                                type: string
                              ddd:
                                type: string
                              number:
                                type: string
                              isMobile:
                                type: boolean
                          email:
                            type: string
                          birthDate:
                            type: string
                            format: date
                      company:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          address:
                            type: object
                            properties:
                              zipCode:
                                type: string
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                type: string
                              neighborhood:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                          phone:
                            type: object
                            properties:
                              areaCode:
                                type: string
                              ddd:
                                type: string
                              number:
                                type: string
                              isMobile:
                                type: boolean
                          document:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - CPF
                                  - CNPJ
                              number:
                                type: string
                      forecastIncome:
                        type: object
                        properties:
                          range:
                            type: string
                            description: Expected annual income range.
                            enum:
                              - none
                              - less-than-10000
                              - 10000-to-50000
                              - 50000-to-100000
                              - 100000-to-500000
                              - more-than-500000
              example:
                statusCode: 200
                data:
                  id: e3c76a34-91b2-4b38-9d28-41c531ef1d2a
                  createdAt: '2025-01-10T14:20:00.000Z'
                  name: Tech Innovators Ltda
                  document:
                    type: CNPJ
                    number: '12345678000195'
                  collaborator:
                    - id: a2b1d8c3-12f4-4b76-9e45-11c5f2c82b99
                      collaboratorType:
                        - admin
                  billing:
                    id: b9d1a8f4-6789-4321-a9f3-5a7d6f0a1b2c
                    address:
                      zipCode: '04534011'
                      street: Rua das Flores
                      number: '100'
                      complement: Sala 12
                      neighborhood: Centro
                      city: São Paulo
                      state: SP
                    contact:
                      email: contato@techinnovators.com
                      phone:
                        areaCode: '+55'
                        ddd: '11'
                        number: '912345678'
                        isMobile: true
                      whatsApp:
                        areaCode: '+55'
                        ddd: '11'
                        number: '912345678'
                        isMobile: true
                  user:
                    id: c7e5b0f4-2234-4f98-a2d7-1f84c5b0b123
                    name: Carlos Andrade
                    document:
                      type: CPF
                      number: '98765432100'
                    phone:
                      areaCode: '+55'
                      ddd: '11'
                      number: '998877665'
                      isMobile: true
                    email: carlos.andrade@example.com
                    birthDate: '1990-07-15'
                  company:
                    id: 7b2e3d9f-4567-4f9c-90e1-6a3b9f5a8e99
                    address:
                      zipCode: '37550114'
                      street: Avenida Brasil
                      number: '200'
                      complement: Andar 3
                      neighborhood: Centro
                      city: Pouso Alegre
                      state: MG
                    phone:
                      areaCode: '+55'
                      ddd: '35'
                      number: '998877665'
                      isMobile: true
                    document:
                      type: CNPJ
                      number: '12345678000195'
                  forecastIncome:
                    range: 10000-to-50000
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/sales/list:
    post:
      summary: Filter Sales
      description: Retrieve a paginated list of sales with filtering and ordering options.
      tags:
        - Sales
      security:
        - bearerAuth: []
      operationId: listSales
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                codes:
                  type: array
                  items:
                    type: string
                  description: Filter by one or more coupon codes.
                email:
                  type: string
                  format: email
                  description: Filter by buyer email.
                name:
                  type: string
                  description: Filter by buyer name.
                initialDate:
                  type: string
                  format: date-time
                  description: Filter sales created after this date.
                endDate:
                  type: string
                  format: date-time
                  description: Filter sales created before this date.
                productName:
                  type: string
                  description: Filter by product name.
                status:
                  type: array
                  description: Filter by sale status.
                  items:
                    type: string
                    enum:
                      - pending
                      - paid
                      - partially-paid
                      - canceled
                      - reversed
                      - refunded
                      - charged-back
                      - delayed
                      - failed
                      - charged
                initialValue:
                  type: number
                  format: float
                  description: Minimum transaction value filter.
                endValue:
                  type: number
                  format: float
                  description: Maximum transaction value filter.
                types:
                  type: array
                  items:
                    type: string
                  description: Filter by payment types (credit-card, pix, bank-billet).
                productIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Filter by one or more product IDs.
                field:
                  type: string
                  format: uuid
                  description: >-
                    Field used for text search across multiple sale attributes,
                    such as buyer.name, buyer.email, buyer.document.number,
                    items.name and items.id.
                orderBy:
                  type: object
                  description: Ordering configuration for the sales list.
                  properties:
                    orderByField:
                      type: string
                      enum:
                        - email
                        - product
                        - createdAt
                    orderDirection:
                      type: string
                      enum:
                        - ASC
                        - DESC
            example:
              codes:
                - SALE-12345
              email: john.doe@example.com
              name: John Doe
              cpf: '12345678901'
              initialDate: '2024-09-12T00:00:00.000Z'
              endDate: '2024-09-13T23:00:00.000Z'
              productName: Curso de Programação
              status:
                - paid
                - reversed
              initialValue: 0
              endValue: 5000
              types:
                - credit-card
                - pix
              productIds:
                - e55b40af-935f-4d6a-b520-8820f84b06a7
              field: 76fb9f83-0b48-4fce-9350-1246227728e8
              orderBy:
                orderByField: createdAt
                orderDirection: DESC
      responses:
        '200':
          description: Successfully retrieved list of sales.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      sales:
                        type: object
                        properties:
                          docs:
                            type: array
                            items:
                              type: object
                              properties:
                                buyer:
                                  type: object
                                  properties:
                                    address:
                                      type: object
                                      properties:
                                        zipCode:
                                          type: string
                                        street:
                                          type: string
                                        number:
                                          type: string
                                        complement:
                                          type: string
                                        neighborhood:
                                          type: string
                                        city:
                                          type: string
                                        state:
                                          type: string
                                    customerId:
                                      type: string
                                    deliveryAddress:
                                      type: object
                                      properties:
                                        zipCode:
                                          type: string
                                        street:
                                          type: string
                                        number:
                                          type: string
                                        complement:
                                          type: string
                                        neighborhood:
                                          type: string
                                        city:
                                          type: string
                                        state:
                                          type: string
                                    document:
                                      type: object
                                      properties:
                                        number:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                            - CPF
                                            - CNPJ
                                    email:
                                      type: string
                                    name:
                                      type: string
                                    phone:
                                      type: object
                                      properties:
                                        areaCode:
                                          type: string
                                        ddd:
                                          type: string
                                        number:
                                          type: string
                                        isMobile:
                                          type: boolean
                                    userId:
                                      type: string
                                      format: uuid
                                status:
                                  type: string
                                  enum:
                                    - pending
                                    - paid
                                    - partially-paid
                                    - canceled
                                    - reversed
                                    - refunded
                                    - charged-back
                                    - delayed
                                    - failed
                                    - charged
                                totalValueInCents:
                                  type: integer
                                paymentMethod:
                                  type: array
                                  items:
                                    type: string
                                createdAt:
                                  type: string
                                  format: date-time
                                totalFineValueInCents:
                                  type: integer
                                totalInterestValueInCents:
                                  type: integer
                                targetId:
                                  type: string
                                  format: uuid
                                type:
                                  type: string
                                  enum:
                                    - order
                                    - recurrence
                                description:
                                  type: string
                                items:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      targetId:
                                        type: string
                                        format: uuid
                                      type:
                                        type: string
                                receivers:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      businessId:
                                        type: string
                                        format: uuid
                                      commissionValueInCents:
                                        type: integer
                                      taxValueInCents:
                                        type: integer
                          currentPage:
                            type: integer
                          hasNext:
                            type: boolean
                          limit:
                            type: integer
                          nextPage:
                            type: integer
                          totalDocs:
                            type: integer
                          totalPages:
                            type: integer
                      ticketsCount:
                        type: integer
                      totalTransactionValue:
                        type: integer
                      totalCommissions:
                        type: integer
              example:
                statusCode: 200
                data:
                  sales:
                    docs:
                      - buyer:
                          address:
                            zipCode: 01000-000
                            street: Av. Paulista
                            complement: Apto 101
                            neighborhood: Bela Vista
                            city: São Paulo
                            state: SP
                            number: '1000'
                          customerId: 8d5baf3d-6b8a-41c1-88f4-10c5d8b3e3d2
                          deliveryAddress:
                            zipCode: 01000-000
                            street: Av. Paulista
                            number: '1000'
                            complement: Apto 101
                            neighborhood: Bela Vista
                            city: São Paulo
                            state: SP
                          document:
                            number: '12345678901'
                            type: CPF
                          email: john.doe@example.com
                          name: John Doe
                          phone:
                            areaCode: '+55'
                            ddd: '11'
                            number: '999999999'
                            isMobile: true
                          userId: 8d5baf3d-6b8a-41c1-88f4-10c5d8b3e3d2
                        status: paid
                        totalValueInCents: 15000
                        paymentMethod:
                          - credit-card
                        createdAt: '2025-09-10T18:50:42.205Z'
                        totalFineValueInCents: 0
                        totalInterestValueInCents: 0
                        targetId: d492df00-3118-4804-bacb-3d3a2b91bb6a
                        type: order
                        description: Venda de curso online
                        items:
                          - name: Curso de Programação
                            targetId: c91c86cf-a0a9-44fa-bb18-1976ddba06a3
                            type: unique-purchase
                        receivers:
                          - businessId: db6cf2ed-80df-49b3-a36a-ff5911d61b76
                            commissionValueInCents: 1500
                            taxValueInCents: 500
                    currentPage: 1
                    hasNext: true
                    limit: 1
                    nextPage: 2
                    totalDocs: 16
                    totalPages: 16
                  ticketsCount: 16
                  totalTransactionValue: 240000
                  totalCommissions: 15000
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/orders/{orderId}:
    get:
      tags:
        - Sales
      summary: Get order details
      description: >-
        Retrieve detailed information about a specific order, including buyer,
        items, payments, commissions, and refund information.
      security:
        - bearerAuth: []
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the order to retrieve.
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
      responses:
        '200':
          description: Successful response with order details
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      date:
                        type: string
                        format: date-time
                      paidAt:
                        type: string
                        format: date-time
                      status:
                        type: string
                        enum:
                          - pending
                          - paid
                          - partially-paid
                          - canceled
                          - reversed
                          - refunded
                          - charged-back
                      totalCommissionValueInCents:
                        type: integer
                        description: total business commission
                      orderBuyer:
                        type: object
                        properties:
                          name:
                            type: string
                          email:
                            type: string
                            format: email
                          phone:
                            type: object
                            properties:
                              areaCode:
                                type: string
                              ddd:
                                type: string
                              number:
                                type: string
                              isMobile:
                                type: boolean
                          address:
                            type: object
                            properties:
                              zipCode:
                                type: string
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                type: string
                              neighborhood:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                          document:
                            type: object
                            properties:
                              type:
                                type: string
                              number:
                                type: string
                          deliveryAddress:
                            type: object
                            properties:
                              zipCode:
                                type: string
                              street:
                                type: string
                              number:
                                type: string
                              complement:
                                type: string
                              neighborhood:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                      coupon:
                        type: object
                        properties:
                          code:
                            type: string
                          totalDiscountValueInCents:
                            type: integer
                          percentage:
                            type: integer
                          valueInCents:
                            type: integer
                      refundable:
                        type: boolean
                        description: >-
                          Indicates whether the order is still eligible for
                          refund request.
                      refundableUntil:
                        type: string
                        format: date-time
                        description: Date until which the refund request can be submitted.
                      refundRequest:
                        type: object
                        description: >-
                          Refund request details. This object is only returned
                          if a refund request has been submitted.
                        properties:
                          id:
                            type: string
                          supportEmail:
                            type: string
                          status:
                            type: string
                            enum:
                              - pending
                              - requested
                              - delayed
                              - confirmed
                              - canceled
                              - failed
                          createdAt:
                            type: string
                            format: date-time
                          updatedAt:
                            type: string
                            format: date-time
                          canceledAt:
                            type: string
                            format: date-time
                          executionDueDate:
                            type: string
                            format: date-time
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            commissions:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  grossValueInCents:
                                    type: integer
                                    description: >-
                                      Gross commission value in cents (before
                                      fees).
                                  netValueInCents:
                                    type: integer
                                    description: >-
                                      Net commission value in cents (after
                                      fees).
                                  taxInCents:
                                    type: integer
                                  receiverRole:
                                    type: string
                                  settlementDate:
                                    type: string
                                    format: date
                                  planDetails:
                                    type: object
                                    properties:
                                      description:
                                        type: string
                                      planName:
                                        type: string
                            unitValueInCents:
                              type: integer
                            quantity:
                              type: integer
                            name:
                              type: string
                            description:
                              type: string
                      payments:
                        type: array
                        items:
                          type: object
                          properties:
                            payment:
                              type: object
                              properties:
                                id:
                                  type: string
                                status:
                                  type: string
                                  enum:
                                    - pending
                                    - in-processing
                                    - authorized
                                    - paid
                                    - partially-paid
                                    - refused
                                    - aborted
                                    - canceled
                                    - charged-back
                                    - unpaid
                                    - accepted
                                    - denied
                                    - reversed
                                    - refunded
                                valuePaidInCents:
                                  type: integer
                                externalId:
                                  type: string
                                fineValueInCents:
                                  type: integer
                                installments:
                                  type: integer
                                interestValueInCents:
                                  type: integer
                                paymentMethod:
                                  type: string
                                statusHistory:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      status:
                                        type: string
                                        enum:
                                          - pending
                                          - in-processing
                                          - authorized
                                          - paid
                                          - partially-paid
                                          - refused
                                          - aborted
                                          - canceled
                                          - charged-back
                                          - unpaid
                                          - accepted
                                          - denied
                                          - reversed
                                          - refunded
                                      date:
                                        type: string
                                        format: date-time
                                valueInCents:
                                  type: integer
                                creditCard:
                                  type: object
                                  properties:
                                    nickname:
                                      type: string
                                    last4Numbers:
                                      type: string
                                    holderName:
                                      type: string
                                    expiresAtMonth:
                                      type: integer
                                    expiresAtYear:
                                      type: integer
                                    flag:
                                      type: string
                                      enum:
                                        - visa
                                        - mastercard
                                        - american-express
                                        - diners-club
                                        - discover
                                        - jcb
                                        - unionpay
                                        - unionpay
                                        - mir
                                        - elo
                                        - hiper
                                        - hipercard
                      statusHistory:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            status:
                              type: string
                              enum:
                                - pending
                                - paid
                                - partially-paid
                                - canceled
                                - reversed
                                - refunded
                                - charged-back
                            date:
                              type: string
                              format: date-time
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /management/organizations/list:
    get:
      tags:
        - Organizations
      summary: List user organizations
      description: >-
        Returns a paginated list of organizations associated with the
        authenticated user.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/x-fingerprint-id'
      responses:
        '200':
          description: Successfully retrieved the list of user organizations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      docs:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            document:
                              type: object
                              properties:
                                type:
                                  type: string
                                number:
                                  type: string
                            createdAt:
                              type: string
                              format: date-time
                            name:
                              type: string
                            numberOfCollaborators:
                              type: integer
                            forecastIncome:
                              type: object
                              properties:
                                range:
                                  type: string
                                  enum:
                                    - none
                                    - less-than-10000
                                    - from-10000-to-100000
                                    - from-100000-to-500000
                                    - more-than-500000
                      limit:
                        type: integer
                      currentPage:
                        type: integer
                      nextPage:
                        type: integer
                      totalPages:
                        type: integer
                      totalDocs:
                        type: integer
                      hasNext:
                        type: boolean
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/sales/total-sales:
    post:
      tags:
        - Sales
      summary: Filter total sales
      description: >-
        Retrieve the total number of transactions per payment method based on
        optional filters such as date range, status, or free sales.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                freeSales:
                  type: boolean
                  description: Include or exclude free sales.
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                status:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - paid
                      - partially-paid
                      - canceled
                      - reversed
                      - refunded
                      - charged-back
      responses:
        '200':
          description: Total sales per payment method successfully retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                      pix:
                        type: object
                        properties:
                          count:
                            type: integer
                          percentage:
                            type: number
                      creditCard:
                        type: object
                        properties:
                          count:
                            type: integer
                          percentage:
                            type: number
                      boleto:
                        type: object
                        properties:
                          count:
                            type: integer
                          percentage:
                            type: number
                      free:
                        type: object
                        properties:
                          count:
                            type: integer
                          percentage:
                            type: number
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/commissions/{businessId}:
    post:
      tags:
        - Commissions
      summary: Filter commissions
      description: >-
        Retrieve the total gross and net commissions for the authenticated user,
        optionally filtered by date range and commission status.
      security:
        - bearerAuth: []
      parameters:
        - name: businessId
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the business.
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                status:
                  type: array
                  description: Filter commissions by their current status.
                  items:
                    type: string
                    enum:
                      - pending
                      - paid
                      - released
                      - canceled
                      - reversed
                      - refunded
                      - charged-back
      responses:
        '200':
          description: Successfully retrieved the total commissions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      totalGrossValueInCents:
                        type: integer
                        description: >-
                          Total gross commission value in cents (before fees and
                          taxes).
                      totalNetValueInCents:
                        type: integer
                        description: >-
                          Total net commission value in cents (after fees and
                          taxes).
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/commissions/daily-commissions-list:
    post:
      tags:
        - Commissions
      summary: List daily commissions
      description: >-
        Retrieve a list of daily commissions, including the total number of
        commissions and total value earned per day, optionally filtered by date
        range and commission status.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/business-id'
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                status:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - paid
                      - released
                      - canceled
                      - reversed
                      - refunded
                      - charged-back
      responses:
        '200':
          description: Successfully retrieved the list of daily commissions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        count:
                          type: integer
                          description: Number of commissions on that day.
                        totalValue:
                          type: integer
                          description: Total value earned in cents on that day.
                        date:
                          type: string
                          format: date
                          description: Date for the daily commission record (YYYY-MM-DD).
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/refresh:
    post:
      tags:
        - Authentication
      summary: Refresh access token
      description: >-
        Refresh the user's access token using a valid refresh token. Requires
        authentication via bearer token and device fingerprint. The
        `refresh-token` header must contain the current refresh token.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - name: refresh-token
          in: header
          required: true
          description: Bearer token used to refresh the access token when it expires.
          schema:
            type: string
      responses:
        '200':
          description: Successfully refreshed the access and refresh tokens.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: HTTP status code of the response.
                  data:
                    type: object
                    properties:
                      newTokens:
                        type: object
                        description: Contains the newly issued access and refresh tokens.
                        properties:
                          token:
                            type: string
                            description: New access token to authenticate future requests.
                          refreshToken:
                            type: string
                            description: >-
                              New refresh token to be used for subsequent token
                              refreshes.
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/businesses/balance:
    get:
      tags:
        - Financial
      summary: Get business balance
      description: Retrieve the current balance.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
      responses:
        '200':
          description: Returns the current financial balance details for the business.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: HTTP status code of the response.
                  data:
                    type: object
                    properties:
                      accountFundsInCents:
                        type: integer
                      toBeReleasedFundsInCents:
                        type: integer
                      lastTimeBalanceWasCalculated:
                        type: string
                        format: date-time
                      totalFundsInCents:
                        type: integer
                      blockedFundsInCents:
                        type: integer
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/movement-groups/list:
    post:
      tags:
        - Financial
      summary: Filter movements group
      description: Retrieve paginated movement groups.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                movementsLimit:
                  type: number
                omitDebit:
                  type: boolean
                omitCredit:
                  type: boolean
      responses:
        '200':
          description: Returns paginated groups of movements for the business.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: HTTP status code
                    example: 200
                  data:
                    type: object
                    properties:
                      groups:
                        type: object
                        properties:
                          docs:
                            type: array
                            items:
                              type: object
                              properties:
                                businessIds:
                                  type: array
                                  items:
                                    type: string
                                day:
                                  type: number
                                month:
                                  type: number
                                year:
                                  type: number
                                initialBalanceInCents:
                                  type: number
                                finalBalanceInCents:
                                  type: number
                                status:
                                  type: string
                                  enum:
                                    - open
                                    - closed
                                movements:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      businessIds:
                                        type: array
                                        items:
                                          type: string
                                      valueInCents:
                                        type: number
                                      subject:
                                        type: string
                                      description:
                                        type: string
                                      hash:
                                        type: string
                                      originType:
                                        type: string
                                        enum:
                                          - payment
                                          - deposit
                                          - withdraw-request
                                          - transfer-request
                                          - withdraw-fee
                                          - refund-tax
                                          - promissory
                                          - other
                                      referenceId:
                                        type: string
                                      ocurredAt:
                                        type: string
                                        format: date-time
                                      groupId:
                                        type: string
                          currentPage:
                            type: number
                          hasNext:
                            type: boolean
                          limit:
                            type: number
                          nextPage:
                            type: number
                          totalPages:
                            type: number
              example:
                statusCode: 200
                data:
                  groups:
                    docs:
                      - businessIds:
                          - db6cf2ed-80df-49b3-a36a-ff5911d61b76
                        day: 15
                        month: 9
                        year: 2025
                        initialBalanceInCents: 5000
                        finalBalanceInCents: 5800
                        status: open
                        movements:
                          - id: a1b2c3d4e5f6
                            businessIds:
                              - db6cf2ed-80df-49b3-a36a-ff5911d61b76
                            valueInCents: 300
                            subject: Commission
                            description: >-
                              Commission from sale
                              b03cc407-3567-4ecd-ac49-0ef527e2407e
                            hash: abc123hashvalueexample
                            originType: payment
                            referenceId: fc3f69a2-723d-4401-9c63-692b3e20dd61
                            ocurredAt: '2025-09-15T10:30:00.000Z'
                            groupId: g1h2i3j4k5
                    currentPage: 1
                    hasNext: true
                    limit: 10
                    nextPage: 2
                    totalPages: 3
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          '200':
            description: Returns paginated groups of movements for the business.
            content:
              application/json:
                example:
                  statusCode: 200
                  data:
                    groups:
                      docs:
                        - businessIds:
                            - db6cf2ed-80df-49b3-a36a-ff5911d61b76
                          day: 15
                          month: 9
                          year: 2025
                          initialBalanceInCents: 5000
                          finalBalanceInCents: 5800
                          status: open
                          movements:
                            - id: a1b2c3d4e5f6
                              businessIds:
                                - db6cf2ed-80df-49b3-a36a-ff5911d61b76
                              valueInCents: 300
                              subject: Commission
                              description: >-
                                Commission from sale
                                b03cc407-3567-4ecd-ac49-0ef527e2407e
                              hash: abc123hashvalueexample
                              originType: payment
                              referenceId: fc3f69a2-723d-4401-9c63-692b3e20dd61
                              ocurredAt: '2025-09-15T10:30:00.000Z'
                              groupId: g1h2i3j4k5
                      currentPage: 1
                      hasNext: true
                      limit: 10
                      nextPage: 2
                      totalPages: 3
          '400':
            $ref: '#/components/responses/invalid-param'
          '401':
            $ref: '#/components/responses/unauthorized'
          '403':
            $ref: '#/components/responses/forbidden'
          '500':
            $ref: '#/components/responses/internal-server-error'
          $ref: '#/components/responses/internal-server-error'
  /easyflow/movements/list:
    post:
      tags:
        - Financial
      summary: Filter movements
      description: Retrieve paginated movement.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                initialValue:
                  type: number
                endValue:
                  type: number
                subject:
                  type: string
                description:
                  type: string
                hash:
                  type: string
                originType:
                  type: string
                  enum:
                    - payment
                    - deposit
                    - withdraw-request
                    - transfer-request
                    - withdraw-fee
                    - refund-tax
                    - promissory
                    - other
                referenceId:
                  type: string
                groupId:
                  type: string
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                omitDebit:
                  type: boolean
                omitCredit:
                  type: boolean
              required:
                - groupId
      responses:
        '200':
          description: Returns a paginated list of movements for the business.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      movements:
                        type: object
                        properties:
                          docs:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                businessIds:
                                  type: array
                                  items:
                                    type: string
                                valueInCents:
                                  type: number
                                subject:
                                  type: string
                                description:
                                  type: string
                                hash:
                                  type: string
                                originType:
                                  type: string
                                  enum:
                                    - payment
                                    - deposit
                                    - withdraw-request
                                    - transfer-request
                                    - withdraw-fee
                                    - refund-tax
                                    - promissory
                                    - other
                                referenceId:
                                  type: string
                                ocurredAt:
                                  type: string
                                  format: date-time
                                groupId:
                                  type: string
                          currentPage:
                            type: number
                          hasNext:
                            type: boolean
                          limit:
                            type: number
                          nextPage:
                            type: number
                          totalPages:
                            type: number
                      count:
                        type: number
                      totalValue:
                        type: number
              example:
                statusCode: 200
                data:
                  movements:
                    docs:
                      - id: 68c21f1766f68950ab7166e2
                        businessIds:
                          - db6cf2ed-80df-49b3-a36a-ff5911d61b76
                        valueInCents: 380
                        subject: Commission Sale
                        description: >-
                          Commission for sale
                          b03cc407-3567-4ecd-ac49-0ef527e2407e
                        hash: >-
                          ZWJlYjY1MDAtNmUxNy00NjMyLWE2MzctZWM2OGVmZThjOGVmOmluY29tZTozODA6V2VkIFNlcCAxMCAyMDI1IDIyOjAwOjA3IEdNVC0wMzAwIChCcmFzaWxpYSBTdGFuZGFyZCBUaW1lKTozZDI5ODlmMy1jYmQ2LTRlNDYtYWY2MS1iMDNhYTUzMzQ5MjE=
                        originType: payment
                        referenceId: fc3f69a2-723d-4401-9c63-692b3e20dd61
                        ocurredAt: '2025-09-11T01:00:07.269Z'
                        groupId: 68c21f1866f68950ab7166e7
                    currentPage: 1
                    hasNext: false
                    limit: 10
                    nextPage: 1
                    totalPages: 1
                  count: 1
                  totalValue: 380
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/withdraw-requests/list-by-business:
    post:
      tags:
        - Financial
      summary: Filter withdraw requests by business
      description: Filter all withdraw requests for the business.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                initialDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
                status:
                  type: string
                  enum:
                    - requested
                    - released
                    - canceled
                    - failed
                initialValue:
                  type: number
                endValue:
                  type: number
                orderBy:
                  type: object
                  properties:
                    orderByField:
                      type: string
                      enum:
                        - createdAt
                        - valueInCents
                    orderDirection:
                      type: string
                      enum:
                        - asc
                        - desc
      responses:
        '200':
          description: Returns a paginated list of withdraw requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      docs:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            businessId:
                              type: string
                            valueInCents:
                              type: number
                            status:
                              type: string
                              enum:
                                - requested
                                - released
                                - canceled
                                - failed
                            createdAt:
                              type: string
                              format: date-time
                            bankAccount:
                              type: object
                              properties:
                                bankCode:
                                  type: string
                                agencyNumber:
                                  type: string
                                accountNumber:
                                  type: string
                                pixKey:
                                  type: string
                            withdrawRequestsHistory:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  status:
                                    type: string
                                    enum:
                                      - requested
                                      - released
                                      - canceled
                                      - failed
                                  date:
                                    type: string
                                    format: date-time
                      limit:
                        type: number
                      currentPage:
                        type: number
                      nextPage:
                        type: number
                      totalPages:
                        type: number
                      totalDocs:
                        type: number
                      hasNext:
                        type: boolean
              example:
                statusCode: 200
                data:
                  docs:
                    - id: fb2d3e30-1852-4c6b-bb7f-282d25ad348f
                      businessId: db6cf2ed-80df-49b3-a36a-ff5911d61b76
                      valueInCents: 3000
                      status: released
                      createdAt: '2025-09-15T17:52:22.661Z'
                      bankAccount:
                        bankCode: ''
                        agencyNumber: ''
                        accountNumber: ''
                        pixKey: '55093824810'
                      withdrawRequestsHistory:
                        - id: 0213f1cc-0444-40aa-9a39-e55434315278
                          status: requested
                          date: '2025-09-15T17:52:22.661Z'
                        - id: 473dd31d-c041-4b8f-a1f6-ac3865f73784
                          status: released
                          date: '2025-09-15T17:52:33.865Z'
                  limit: 25
                  currentPage: 1
                  nextPage: 1
                  totalPages: 1
                  totalDocs: 1
                  hasNext: false
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/withdraw-requests/{withdrawRequestId}:
    get:
      tags:
        - Financial
      summary: Get withdraw request details
      description: Get the full details of a specific withdraw request.
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - name: withdrawRequestId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Returns the withdraw request details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      valueInCents:
                        type: number
                      status:
                        type: string
                        enum:
                          - requested
                          - released
                          - canceled
                          - failed
                      createdAt:
                        type: string
                        format: date-time
                      bankAccount:
                        type: object
                        properties:
                          bankCode:
                            type: string
                          agencyNumber:
                            type: string
                          accountNumber:
                            type: string
                          pixKey:
                            type: string
                      withdrawRequestsHistory:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            status:
                              type: string
                              enum:
                                - requested
                                - released
                                - canceled
                                - failed
                            date:
                              type: string
                              format: date-time
              example:
                statusCode: 200
                data:
                  id: fb2d3e30-1852-4c6b-bb7f-282d25ad348f
                  valueInCents: 3000
                  status: released
                  createdAt: '2025-09-15T17:52:22.661Z'
                  bankAccount:
                    bankCode: ''
                    agencyNumber: ''
                    accountNumber: ''
                    pixKey: '55093824810'
                  withdrawRequestsHistory:
                    - id: 0213f1cc-0444-40aa-9a39-e55434315278
                      status: requested
                      date: '2025-09-15T17:52:22.661Z'
                    - id: 473dd31d-c041-4b8f-a1f6-ac3865f73784
                      status: released
                      date: '2025-09-15T17:52:33.865Z'
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/devices:
    post:
      tags:
        - Authentication
      summary: Register new device
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
            example:
              name: Testando
      responses:
        '200':
          description: Returns device created
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      fingerprint:
                        type: string
                      ip:
                        type: string
                      userAgent:
                        type: string
                      status:
                        type: string
                        enum:
                          - enabled
                          - disabled
                          - pending
                      name:
                        type: string
                      id:
                        type: string
              example:
                statusCode: 200
                data:
                  fingerprint: '123456'
                  ip: 15.229.40.42
                  userAgent: >-
                    Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36
                    (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36
                  status: enabled
                  name: testando
                  id: 4300d253-0b23-44e5-81dc-7c79784bb510
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/devices/approve:
    patch:
      tags:
        - Authentication
      summary: Approve new device
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
              required:
                - code
            example:
              code: '311981'
      responses:
        '200':
          description: returns the approved device
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      status:
                        type: string
                        enum:
                          - enabled
                          - disabled
                          - pending
                      fingerprint:
                        type: string
                      userAgent:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                      accountId:
                        type: string
              example:
                statusCode: 200
                data:
                  id: b5ebe444-732e-4aba-8923-e06eb5d51053
                  name: testando
                  status: enabled
                  fingerprint: '12345678'
                  userAgent: PostmanRuntime/7.46.0
                  createdAt: '2025-09-15T18:45:00.674Z'
                  accountId: 50540be2-1bda-41b9-a664-34530a1a75cb
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/accounts/validate:
    patch:
      tags:
        - Authentication
      summary: Validate account
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
              required:
                - code
            example:
              code: '149475'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      accountStatus:
                        type: string
                        enum:
                          - activated
                          - deactivated
                          - reactivated
                          - blocked
                          - pending-validation
                      channelsPendingValidation:
                        type: array
                        items:
                          type: string
                          enum:
                            - EMAIL
                            - SMS
                            - WHATSAPP
              example:
                statusCode: 200
                data:
                  accountStatus: activated
                  channelsPendingValidation: []
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/otps/email:
    post:
      tags:
        - Authentication
      summary: Resend EMAIL OTP
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      otpHasBeenSentToEmail:
                        type: boolean
              example:
                statusCode: 200
                data:
                  otpHasBeenSentToEmail: true
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /identity/otps/sms:
    post:
      tags:
        - Authentication
      summary: Resend SMS OTP
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      otpHasBeenSentToPhone:
                        type: boolean
              example:
                statusCode: 200
                data:
                  otpHasBeenSentToPhone: true
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/businesses/list-by-collaborator:
    get:
      tags:
        - Organizations
      summary: List collaborators
      description: List all businesses the collaborator is part of
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Successful retrieval of businesses for the collaborator
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      docs:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            createdAt:
                              type: string
                              format: date-time
                            name:
                              type: string
                            document:
                              type: object
                              properties:
                                type:
                                  type: string
                                number:
                                  type: string
                            validationStatus:
                              type: string
                              enum:
                                - pending
                                - waiting-approval
                                - approved
                                - reproved
                            totalCollaborator:
                              type: integer
                            owner:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                document:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                    number:
                                      type: string
                                email:
                                  type: string
                            collaborator:
                              type: object
                              properties:
                                id:
                                  type: string
                                createdAt:
                                  type: string
                                  format: date-time
                                userId:
                                  type: string
                                types:
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - admin
                                      - basic
                                      - financial
                            plan:
                              type: object
                              properties:
                                id:
                                  type: string
                                description:
                                  type: string
                                name:
                                  type: string
                                status:
                                  type: string
                                  enum:
                                    - draft
                                    - active
                                    - inactive
                                    - blocked
                                isDefault:
                                  type: boolean
                      limit:
                        type: integer
                      currentPage:
                        type: integer
                      nextPage:
                        type: integer
                      totalPages:
                        type: integer
                      totalDocs:
                        type: integer
                      hasNext:
                        type: boolean
              example:
                statusCode: 200
                data:
                  docs:
                    - id: 7a6572e1-68ab-42a5-b829-2d84428d9de0
                      createdAt: '2024-09-19T22:00:47.224Z'
                      name: Investimento.
                      document:
                        type: CPF
                        number: '22807605842'
                      validationStatus: approved
                      totalCollaborator: 3
                      owner:
                        id: 6f3bb20c-74c3-4c91-bacf-7be7636607a0
                        name: Joao souza
                        document:
                          type: CPF
                          number: '22807605842'
                        email: joao@gmail.com
                      collaborator:
                        id: ba7ebd80-c9ad-45d3-b4d6-1950fdc07730
                        createdAt: '2025-04-05T14:02:54.390Z'
                        userId: 50578a8f-b958-4e58-9276-943370af3257
                        types:
                          - basic
                      plan:
                        id: 35178b67-af8d-48e7-82ec-603977054360
                        description: Plano básico D30
                        name: Basic D30
                        status: active
                        isDefault: true
                  limit: 1
                  currentPage: 1
                  nextPage: 2
                  totalPages: 3
                  totalDocs: 3
                  hasNext: true
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
  /easyflow/subscription-recurrences/{subscriptionRecurrenceId}:
    get:
      tags:
        - Subscriptions
      summary: Get subscription recurrence
      security:
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/x-fingerprint-id'
        - $ref: '#/components/parameters/business-id'
        - in: path
          name: subscriptionRecurrenceId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful retrieval of subscription recurrence details
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      subscription:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          periodicity:
                            type: string
                            enum:
                              - Monthly
                              - Quarterly
                              - Biannualy
                              - Annualy
                          numberRecurrences:
                            type: integer
                          status:
                            type: string
                            enum:
                              - active
                              - inactive
                              - canceled
                              - expired
                          customer:
                            type: object
                            properties:
                              name:
                                type: string
                              email:
                                type: string
                              phone:
                                type: object
                                properties:
                                  areaCode:
                                    type: string
                                  ddd:
                                    type: string
                                  number:
                                    type: string
                                  isMobile:
                                    type: boolean
                              billingAddress:
                                type: object
                                properties:
                                  zipCode:
                                    type: string
                                  street:
                                    type: string
                                  number:
                                    type: string
                                  complement:
                                    type: string
                                  neighborhood:
                                    type: string
                                  city:
                                    type: string
                                  state:
                                    type: string
                              deliveryAddress:
                                type: object
                                properties:
                                  zipCode:
                                    type: string
                                  street:
                                    type: string
                                  number:
                                    type: string
                                  complement:
                                    type: string
                                  neighborhood:
                                    type: string
                                  city:
                                    type: string
                                  state:
                                    type: string
                              document:
                                type: object
                                properties:
                                  type:
                                    type: string
                                  number:
                                    type: string
                              userId:
                                type: string
                              externalReferenceId:
                                type: string
                          recurrenceValueInCents:
                            type: integer
                          expiration:
                            type: string
                          paymentMethod:
                            type: string
                          creditCard:
                            type: object
                            properties:
                              nickname:
                                type: string
                              last4Numbers:
                                type: string
                              holderName:
                                type: string
                              expiresAtMonth:
                                type: integer
                              expiresAtYear:
                                type: integer
                              flag:
                                type: string
                          repeatIndefinitely:
                            type: boolean
                          customValue:
                            type: object
                            properties:
                              recurrenceFrom:
                                type: integer
                              recurrenceTo:
                                type: integer
                              valueInCents:
                                type: integer
                          orderItem:
                            type: object
                            properties:
                              id:
                                type: string
                              orderId:
                                type: string
                              product:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                              unitValueInCents:
                                type: integer
                              quantity:
                                type: integer
                      commissions:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            grossValueInCents:
                              type: integer
                            netValueInCents:
                              type: integer
                            taxInCents:
                              type: integer
                            receiverRole:
                              type: string
                              enum:
                                - producer
                                - co-producer
                                - affiliate
                            settlementDate:
                              type: string
                            planDetails:
                              type: object
                              properties:
                                description:
                                  type: string
                                planName:
                                  type: string
                      payments:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            status:
                              type: string
                              enum:
                                - pending
                                - in-processing
                                - authorized
                                - paid
                                - canceled
                                - refunded
                                - failed
                            valuePaidInCents:
                              type: integer
                            externalId:
                              type: string
                            fineValueInCents:
                              type: integer
                            installments:
                              type: integer
                            interestValueInCents:
                              type: integer
                            paymentMethod:
                              type: string
                            statusHistory:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  status:
                                    type: string
                                  date:
                                    type: string
                            valueInCents:
                              type: integer
                      recurrence:
                        type: integer
                      billingDate:
                        type: string
                      dueDate:
                        type: string
                      paidAt:
                        type: string
                      recurrenceValueInCents:
                        type: integer
                      status:
                        type: string
                        enum:
                          - pending
                          - charged
                          - delayed
                          - failed
                          - paid
                          - canceled
              example:
                statusCode: 200
                data:
                  subscription:
                    id: 1a6fe762-f5de-4808-a8aa-016e8e36df22
                    name: Ficar rico
                    periodicity: Monthly
                    numberRecurrences: 0
                    status: active
                    customer:
                      name: João souza
                      email: joao0162@gmail.com
                      phone:
                        areaCode: '+55'
                        ddd: '11'
                        number: '998504007'
                        isMobile: true
                      billingAddress:
                        zipCode: '04311000'
                        street: Leite
                        number: '77'
                        complement: '103'
                        neighborhood: Jabuca
                        city: Sampa
                        state: SP
                      deliveryAddress:
                        zipCode: '04311000'
                        street: Leite
                        number: '77'
                        complement: '103'
                        neighborhood: Jabuca
                        city: Sampa
                        state: SP
                      document:
                        type: CPF
                        number: '55093824810'
                      userId: db0b2caa-ea00-48c3-9757-73f3a0e406df
                      externalReferenceId: 4a4a05b3-0980-476b-bb7f-df42b00fb54f
                    recurrenceValueInCents: 2000
                    expiration: ''
                    paymentMethod: credit-card
                    creditCard:
                      nickname: ''
                      last4Numbers: '1234'
                      holderName: João souza
                      expiresAtMonth: 1
                      expiresAtYear: 2035
                      flag: visa
                    repeatIndefinitely: true
                    customValue:
                      recurrenceFrom: 1
                      recurrenceTo: 5
                      valueInCents: 2000
                    orderItem:
                      id: 57a6968e-3b04-425d-a6cc-5da3cfaa7abb
                      orderId: b1eed74f-f42a-458e-91d6-b5dfb171e979
                      product:
                        id: 20449634-00e6-4220-adcc-66ff05e0d22d
                        name: Como Rezar Zelda tears of the kingdom face a face
                      unitValueInCents: 2000
                      quantity: 1
                  commissions:
                    - id: eaa0a9fb-13e0-4e3c-b407-ac5376319d1b
                      grossValueInCents: 2000
                      netValueInCents: 1940
                      taxInCents: 60
                      receiverRole: producer
                      settlementDate: '2025-09-26'
                      planDetails:
                        description: Taxa 2,99% + R$ 0,00
                        planName: D30
                  payments:
                    - id: 80c50760-74fb-4f1f-8632-2fe300d716d2
                      status: paid
                      valuePaidInCents: 2000
                      externalId: ''
                      fineValueInCents: 0
                      installments: 1
                      interestValueInCents: 0
                      paymentMethod: credit-card
                      statusHistory:
                        - id: 65425cd5-4b6a-4cb4-bf21-9a34a08b0f11
                          status: pending
                          date: '2025-08-27T18:39:31.877Z'
                        - id: ad30cd65-898d-4431-9945-4fc00189ab56
                          status: in-processing
                          date: '2025-08-27T18:39:41.426Z'
                        - id: cadae48d-497d-45ed-8bfd-cca7b8d90d61
                          status: authorized
                          date: '2025-08-27T18:41:03.093Z'
                        - id: 6f107679-5c5d-4d03-a351-14a34381667c
                          status: paid
                          date: '2025-08-27T18:41:23.126Z'
                      valueInCents: 2000
                  recurrence: 2
                  billingDate: '2025-06-27T03:00:00.000Z'
                  dueDate: '2025-09-27T03:00:00.000Z'
                  paidAt: '2025-08-27T18:39:22.125Z'
                  recurrenceValueInCents: 2000
                  status: paid
        '400':
          $ref: '#/components/responses/invalid-param'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal-server-error'
components:
  schemas: {}
  parameters:
    business-id:
      name: business-id
      in: header
      required: true
      schema:
        type: string
      description: Business Identifier
    page:
      name: page
      in: query
      required: true
      schema:
        type: string
      description: Page number to access
    limit:
      name: limit
      in: query
      schema:
        type: string
      description: Number of items to be loaded per page
      required: true
    x-fingerprint-id:
      name: x-fingerprint-id
      in: header
      required: true
      schema:
        type: string
      description: >-
        Unique device or session fingerprint identifier used for security and
        fraud prevention.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  responses:
    invalid-param:
      description: >-
        If the provided parameter is invalid, the API will return the following
        error response:
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: 'Invalid param: []'
                example: 'Invalid param: []'
              error:
                type: string
                description: Bad Request
                example: Bad Request
              statusCode:
                type: integer
                description: '400'
                example: 400
    forbidden:
      description: >-
        If the request is forbidden, the API will return the following error
        response:
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Forbidden resource
                example: Forbidden resource
              error:
                type: string
                description: Forbidden
                example: Forbidden
              statusCode:
                type: integer
                description: '403'
                example: 403
    unauthorized:
      description: >-
        If the request is unauthorized, the API will return the following error
        response:
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Invalid field
                example: Unauthorized
              error:
                type: string
                description: Unauthorized
                example: Unauthorized
              statusCode:
                type: integer
                description: '401'
                example: 401
    internal-server-error:
      description: >-
        If an unexpected condition occurs and the server cannot process the
        request, the API will return the following error response:
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Internal server error
                example: Internal server error
              error:
                type: string
                description: Internal Server Error
                example: Internal Server Error
              statusCode:
                type: integer
                description: '500'
                example: 500
