openapi: 3.0.0
paths:
  /plots:
    post:
      description: Create a plot owned by your business using JSON or GeoJSON format.
      operationId: PlotsController_create
      parameters:
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreatePlotDto'
                - $ref: '#/components/schemas/CreateGeoJsonPlotDto'
          application/geo+json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreatePlotDto'
                - $ref: '#/components/schemas/CreateGeoJsonPlotDto'
      responses:
        '201':
          description: Returns the created plot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                $ref: '#/components/schemas/GetFullGeoJsonPlotDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Create a plot.
      tags:
        - Plots
    get:
      description: Lists all plots of your business.
      operationId: PlotsController_findAllByBusiness
      parameters:
        - name: page
          required: false
          in: query
          description: >-
            Page number to retrieve.If you provide invalid value the default
            page number will applied
                    <p>
                         <b>Example: </b> 1
                      </p>
                    <p>
                         <b>Default Value: </b> 1
                      </p>
                    
          schema:
            type: number
        - name: limit
          required: false
          in: query
          description: |-
            Number of records per page.
                  <p>
                         <b>Example: </b> 20
                      </p>
                  <p>
                         <b>Default Value: </b> 100
                      </p>
                  <p>
                         <b>Max Value: </b> 500
                      </p>

                  If provided value is greater than max value, max value will be applied.
                  
          schema:
            type: number
        - name: filter.commodities
          required: false
          in: query
          description: |-
            Filter by commodities query param.
                      <p>
                         <b>Format: </b> filter.commodities={$not}:OPERATION:VALUE
                      </p>
                      <p>
                         <b>Example: </b> filter.commodities=$not:$like:John Doe&filter.commodities=like:John
                      </p>
                      <h4>Available Operations</h4><ul><li>$contains</li></ul>
          schema:
            type: array
            items:
              type: string
        - name: sortBy
          required: false
          in: query
          description: |-
            Parameter to sort by.
                  <p>To sort by multiple fields, just provide query param multiple types. The order in url defines an order of sorting</p>
                  <p>
                         <b>Format: </b> fieldName:DIRECTION
                      </p>
                  <p>
                         <b>Example: </b> sortBy=id:DESC&sortBy=createdAt:ASC
                      </p>
                  <p>
                         <b>Default Value: </b> createdAt:DESC
                      </p>
                  <h4>Available Fields</h4><ul><li>createdAt</li></ul>
                  
          schema:
            type: array
            items:
              type: string
              enum:
                - createdAt:ASC
                - createdAt:DESC
        - name: select
          required: false
          in: query
          description: |-
            List of fields to select.
                  <p>
                         <b>Example: </b> 
                      </p>
                  <p>
                         <b>Default Value: </b> By default all fields returns. If you want to select only some fields, provide them in query param
                      </p>
                  
          schema:
            type: string
        - name: includes
          required: false
          in: query
          description: >-
            A comma-separated list of relations to be included in the response.
            Possible relations are: mostRecentAnalysis, suppliers,
            mostRecentAnalysesByType, riskLevel.
                Deprecation: 'mostRecentAnalysis' is deprecated. Please use 'mostRecentAnalysesByType' as the response data will in particular include the data from 'mostRecentAnalysis'.
          schema:
            example: mostRecentAnalysesByType
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
      responses:
        '200':
          description: All plots in a list or as a GeoJSON FeatureCollection
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/GetPlotBaseDto'
                    - $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                $ref: '#/components/schemas/GetAllGeoJsonPlotDto'
        '401':
          description: ''
        '403':
          description: ''
        '501':
          description: >-
            Using the query parameter 'includes' with 'mostRecentAnalysesByType'
            and 'mostRecentAnalysis' simultaneously is not supported.
            'mostRecentAnalysis' is deprecated. Please only use
            'mostRecentAnalysesByType' as the response data will in particular
            include the data from 'mostRecentAnalysis'.
      summary: List all plots.
      tags:
        - Plots
  /plots/batch:
    post:
      deprecated: true
      description: >-
        Create multiple plots that share the same commodities. The plots will be
        owned by your business. This endpoint is deprecated. Please use the
        `POST /plots/batch/geojson` endpoint instead.
      operationId: PlotsController_createInBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreatePlotsDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseCreatePlotsBatchDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Bulk-create plots.
      tags:
        - Plots
    delete:
      description: >-
        Deletes the specified plots. Uses soft-deletion instead of regular
        deletion to ensure auditability. There is currently no way to undo the
        soft-deletion via the API.
      operationId: PlotsController_softRemoveInBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteBatchPlotsDto'
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '500':
          description: ''
      summary: Delete plots in batch.
      tags:
        - Plots
  /plots/batch/geojson:
    post:
      description: Create multiple plots from a GeoJSON FeatureCollection.
      operationId: PlotsController_createInBatchGeoJson
      parameters:
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
      requestBody:
        required: true
        content:
          application/geo+json:
            schema:
              $ref: '#/components/schemas/CreateBatchGeoJsonPlotDto'
      responses:
        '201':
          description: All created plots
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                $ref: '#/components/schemas/GetAllGeoJsonPlotDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Bulk-create plots in GeoJSON format.
      tags:
        - Plots
  /plots/{id}:
    get:
      description: Retrieve the specified plot.
      operationId: PlotsController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: includes
          required: false
          in: query
          description: |-
            A comma-separated list of relations to be included in the response.
                  Possible relations are: mostRecentAnalysis, mostRecentAnalysesByType, riskLevel.
          schema:
            example: mostRecentAnalysis,mostRecentAnalysesByType,riskLevel
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
      responses:
        '200':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GetPlotBaseDto'
                  - $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GetFullGeoJsonPlotDto'
                  - $ref: '#/components/schemas/GetBaseGeoJsonPlotDto'
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve a plot.
      tags:
        - Plots
    patch:
      description: >-
        Update the properties of the specified plot. Handles updates partially,
        i.e. properties missing in the request body will not be changed.
      operationId: PlotsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePlotDto'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                $ref: '#/components/schemas/GetFullGeoJsonPlotDto'
          description: ''
        '401':
          description: ''
        '403':
          description: ''
      summary: Update a plot.
      tags:
        - Plots
    delete:
      description: >-
        Deletes the specified plot. Uses soft-deletion instead of regular
        deletion to ensure auditability. There is currently no way to undo the
        soft-deletion via the API.
      operationId: PlotsController_softRemove
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '500':
          description: ''
      summary: Delete a plot.
      tags:
        - Plots
  /businesses/{businessId}/plots:
    get:
      description: |-
        List all plots of the specified business as well as
              any plots in upstream businesses of the specified business.
              The specified business must be your direct supplier.
      operationId: BusinessPlotsController_findPlotsByBusinessId
      parameters:
        - name: businessId
          required: true
          in: path
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: >-
            Page number to retrieve.If you provide invalid value the default
            page number will applied
                    <p>
                         <b>Example: </b> 1
                      </p>
                    <p>
                         <b>Default Value: </b> 1
                      </p>
                    
          schema:
            type: number
        - name: limit
          required: false
          in: query
          description: |-
            Number of records per page.
                  <p>
                         <b>Example: </b> 20
                      </p>
                  <p>
                         <b>Default Value: </b> 100
                      </p>
                  <p>
                         <b>Max Value: </b> 500
                      </p>

                  If provided value is greater than max value, max value will be applied.
                  
          schema:
            type: number
        - name: filter.commodities
          required: false
          in: query
          description: |-
            Filter by commodities query param.
                      <p>
                         <b>Format: </b> filter.commodities={$not}:OPERATION:VALUE
                      </p>
                      <p>
                         <b>Example: </b> filter.commodities=$not:$like:John Doe&filter.commodities=like:John
                      </p>
                      <h4>Available Operations</h4><ul><li>$contains</li></ul>
          schema:
            type: array
            items:
              type: string
        - name: filter.countryCode
          required: false
          in: query
          description: |-
            Filter by countryCode query param.
                      <p>
                         <b>Format: </b> filter.countryCode={$not}:OPERATION:VALUE
                      </p>
                      <p>
                         <b>Example: </b> filter.countryCode=$not:$like:John Doe&filter.countryCode=like:John
                      </p>
                      <h4>Available Operations</h4><ul><li>$eq</li></ul>
          schema:
            type: array
            items:
              type: string
        - name: filter.riskAssessmentStatus
          required: false
          in: query
          description: |-
            Filter by riskAssessmentStatus query param.
                      <p>
                         <b>Format: </b> filter.riskAssessmentStatus={$not}:OPERATION:VALUE
                      </p>
                      <p>
                         <b>Example: </b> filter.riskAssessmentStatus=$not:$like:John Doe&filter.riskAssessmentStatus=like:John
                      </p>
                      <h4>Available Operations</h4><ul><li>$eq</li></ul>
          schema:
            type: array
            items:
              type: string
        - name: filter.areaHa
          required: false
          in: query
          description: |-
            Filter by areaHa query param.
                      <p>
                         <b>Format: </b> filter.areaHa={$not}:OPERATION:VALUE
                      </p>
                      <p>
                         <b>Example: </b> filter.areaHa=$not:$like:John Doe&filter.areaHa=like:John
                      </p>
                      <h4>Available Operations</h4><ul><li>$gte</li>
            <li>$lte</li></ul>
          schema:
            type: array
            items:
              type: string
        - name: sortBy
          required: false
          in: query
          description: |-
            Parameter to sort by.
                  <p>To sort by multiple fields, just provide query param multiple types. The order in url defines an order of sorting</p>
                  <p>
                         <b>Format: </b> fieldName:DIRECTION
                      </p>
                  <p>
                         <b>Example: </b> sortBy=id:DESC&sortBy=createdAt:ASC
                      </p>
                  <p>
                         <b>Default Value: </b> createdAt:DESC
                      </p>
                  <h4>Available Fields</h4><ul><li>createdAt</li></ul>
                  
          schema:
            type: array
            items:
              type: string
              enum:
                - createdAt:ASC
                - createdAt:DESC
        - name: select
          required: false
          in: query
          description: |-
            List of fields to select.
                  <p>
                         <b>Example: </b> 
                      </p>
                  <p>
                         <b>Default Value: </b> By default all fields returns. If you want to select only some fields, provide them in query param
                      </p>
                  
          schema:
            type: string
        - name: accept
          in: header
          description: Specify the response format. Defaults to application/json.
          schema:
            type: string
            enum:
              - application/json
              - application/geo+json
        - name: includes
          required: false
          in: query
          description: >-
            A comma-separated list of relations to be included in the response.
            Possible relations are: suppliers, mostRecentAnalysis,
            mostRecentAnalysesByType, riskAssessmentStatus
          schema:
            example: >-
              suppliers,mostRecentAnalysis,mostRecentAnalysesByType,riskAssessmentStatus
      responses:
        '200':
          description: Returns the list of Plots supplied by the Business (upstream).
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/GetPlotBaseDto'
                    - $ref: '#/components/schemas/GetPlotFullDto'
            application/geo+json:
              schema:
                $ref: '#/components/schemas/GetAllGeoJsonPlotDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: List all plots of your supplying business and upstream.
      tags:
        - Business Plots
  /business-connections/suppliers:
    get:
      description: |-
        List all the business connections between your business and your
            suppliers in your commercial network.
      operationId: BusinessConnectionsController_findSuppliersByUser
      parameters: []
      responses:
        '200':
          description: Returns the list of business connections.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetBusinessConnectionDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: >-
        List all the business connections with your suppliers in your commercial
        network.
      tags:
        - Business Connections
  /business-connections/buyers:
    get:
      description: |-
        List all the business connections between your business and your
            buyers in your commercial network.
      operationId: BusinessConnectionsController_findBuyersByUser
      parameters: []
      responses:
        '200':
          description: Returns the list of business connections.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetBusinessConnectionDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: >-
        List all the business connections with your buyers in your commercial
        network.
      tags:
        - Business Connections
  /business-connections/{id}:
    patch:
      description: >-
        Update the custom data of a business connection if you are the buyer
        (source business)
      operationId: BusinessConnectionsController_updateAsSourceBusiness
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBusinessConnectionDto'
      responses:
        '200':
          description: Returns the updated business connection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessConnectionDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Update the custom data of a business connection
      tags:
        - Business Connections
  /businesses/me/members:
    get:
      description: Retrieve the members of your business.
      operationId: BusinessMembersController_findMyBusinessMembers
      parameters: []
      responses:
        '200':
          description: Returns the members of your business.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetMemberDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve your business members.
      tags:
        - Businesses Members
  /supplier-risk-assessments:
    get:
      description: Get all risk assessments given to suppliers
      operationId: SupplierRiskAssessmentController_findAll
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetSupplierRiskAssessmentDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all risk assessments given to suppliers
      tags:
        - Supplier Risk Assessments
  /supplier-risk-assessments/{id}:
    get:
      description: Get a given supplier risk assessment by id
      operationId: SupplierRiskAssessmentController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSupplierRiskAssessmentDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Get a given supplier risk assessment by id
      tags:
        - Supplier Risk Assessments
    patch:
      description: Update a supplier risk assessment by id
      operationId: SupplierRiskAssessmentController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSupplierRiskAssessmentDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSupplierRiskAssessmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '409':
          description: ''
      summary: Update a supplier risk assessment by id
      tags:
        - Supplier Risk Assessments
  /supplier-risk-assessments/{id}/history:
    get:
      description: Retrieve the history of changes for a supplier risk assessment.
      operationId: SupplierRiskAssessmentController_getHistory
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/GetHistoryEntryGetSupplierRiskAssessmentHistoryDto
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve the history of a supplier risk assessment.
      tags:
        - Supplier Risk Assessments
  /businesses/{supplierId}/supplier-risk-assessments:
    post:
      description: Create a supplier risk assessment
      operationId: BusinessSupplierRiskAssessmentController_create
      parameters:
        - name: supplierId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSupplierRiskAssessmentDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSupplierRiskAssessmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '409':
          description: ''
      summary: Create a supplier risk assessment
      tags:
        - Supplier Risk Assessments
  /attachments:
    post:
      description: >-
        Create an attachment which represents the upload of an individual file.


        Allowed file types are: pdf, doc, docx, xls, xlsx, jpeg, jpg, png, tif,
        tiff, heic, csv, txt, rtf.


        Filenames must be less than 200 characters (including the file
        extension),and must no contain any of the following characters: % { } <
        > / \ " ` '
      operationId: AttachmentsController_create
      parameters: []
      requestBody:
        required: true
        description: File to be uploaded.
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateAttachmentDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAttachmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '415':
          description: ''
        '501':
          description: >-
            501 Not Implemented when the feature is not enabled on this
            environment.
      summary: Upload a file.
      tags:
        - File Upload (Attachments)
  /attachments/{id}:
    get:
      description: Retrieve an attachment by its ID.
      operationId: AttachmentsController_findOne
      parameters:
        - name: id
          required: true
          in: path
          description: Id of the retrieved attachment.
          schema:
            type: string
            format: uuid
        - name: presign
          required: false
          in: query
          description: |-
            When set to "true", adds the "fileUrl" field to the response object.
                "fileUrl" enables you to download the uploaded file associated with this attachment.
                If the file has not been malware-scanned and identified as clean yet, 
                it will ignore the "presign" query string parameter and not set the "fileUrl" field.
                Any other value than "true" will be ignored.
          schema:
            example: 'true'
            type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAttachmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '501':
          description: >-
            501 Not Implemented when the feature is not enabled on this
            environment.
      summary: Retrieve an attachment.
      tags:
        - File Upload (Attachments)
  /webhooks:
    post:
      description: Create a new webhook for the current business
      operationId: WebhooksController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookDto'
      responses:
        '201':
          description: The webhook has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Create a new webhook
      tags:
        - Webhooks
    get:
      description: Get all webhooks for the current business
      operationId: WebhooksController_findAll
      parameters: []
      responses:
        '200':
          description: List of webhooks for the current business
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetWebhookDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all webhooks
      tags:
        - Webhooks
  /webhooks/events:
    get:
      description: Get all supported webhook events
      operationId: WebhooksController_listSupportedEvents
      parameters: []
      responses:
        '200':
          description: List of supported webhook events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookListEventsDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all supported webhook events
      tags:
        - Webhooks
  /webhooks/{id}:
    get:
      description: Get a webhook by id
      operationId: WebhooksController_findById
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Returns the webhook with the given ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: The webhook with the given ID was not found
      summary: Get a webhook by id
      tags:
        - Webhooks
    patch:
      description: Update a webhook for the current business
      operationId: WebhooksController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookDto'
      responses:
        '200':
          description: The webhook has been successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: The webhook with the given ID was not found
      summary: Update a webhook
      tags:
        - Webhooks
    delete:
      description: Delete a webhook for the current business
      operationId: WebhooksController_remove
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: The webhook has been successfully deleted
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: The webhook with the given ID was not found
      summary: Delete a webhook
      tags:
        - Webhooks
  /webhooks/{id}/stats:
    get:
      description: Get stats for a webhook
      operationId: WebhooksController_getStats
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Stats for the webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookStatsDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get webhook stats
      tags:
        - Webhooks
  /webhooks/{id}/attempts:
    get:
      description: Get all attempts for a webhook
      operationId: WebhooksController_findAllAttempts
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: List of attempts for a webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookAttemptDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all attempts for a webhook
      tags:
        - Webhooks
  /webhooks/{id}/send-example:
    post:
      description: Send example message to a webhook
      operationId: WebhooksController_sendExampleMessage
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSendExampleDto'
      responses:
        '201':
          description: The message ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSendExampleResponseDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Send example message
      tags:
        - Webhooks
  /webhooks/{id}/secret:
    get:
      description: Get the secret for a webhook endpoint
      operationId: WebhooksController_getEndpointSecret
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The secret for the webhook endpoint
          content:
            application/json:
              schema:
                type: string
        '401':
          description: ''
        '403':
          description: ''
      summary: Get endpoint secret
      tags:
        - Webhooks
  /auth/machine-to-machine-clients/token:
    post:
      description: |-
        Token endpoint for OAuth2.0 Client Credentials Grant using your
            OAuth2.0 machine-to-machine client credentials for programmatic access
            to this API.
            See https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
      operationId: MachineToMachineClientsController_exchangeAccessToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMachineToMachineClientTokenDto'
      responses:
        '200':
          description: >-
            Access token response as defined in
            https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.3
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMachineToMachineClientTokenDto'
        '400':
          description: ''
        '401':
          description: ''
      summary: >-
        Retrieve an access token for programmatic access via OAuth2.0 Client
        Credentials Grant.
      tags:
        - OAuth2.0 Machine-to-Machine Clients
  /user-invitations:
    get:
      description: Returns all user invitations.
      operationId: UserInvitationsController_getUserInvitations
      parameters:
        - name: status
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetUserInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all user invitations.
      tags:
        - User Invitations
    post:
      description: >-
        Creates a UserInvitation, which represents an invitation for someone to
        join
              your business as a business member.
      operationId: UserInvitationsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserInvitationDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserInvitationDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '409':
          description: ''
        '422':
          description: ''
      summary: Invite a user to join your business.
      tags:
        - User Invitations
  /user-invitations/sent:
    get:
      description: Returns all user invitations sent by your business.
      operationId: UserInvitationsController_getSentInvitations
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetUserInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all sent user invitations by your business.
      tags:
        - User Invitations
  /user-invitations/{id}:
    patch:
      description: Updates a user invitation.
      operationId: UserInvitationsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserInvitationDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Update a user invitation.
      tags:
        - User Invitations
  /user-invitations/{id}/resend:
    put:
      description: Resend a user invitation.
      operationId: UserInvitationsController_resend
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Resend a user invitation.
      tags:
        - User Invitations
  /version:
    get:
      description: Retrieve which version this application server is currently running.
      operationId: VersionController_getVersion
      parameters: []
      responses:
        '200':
          description: Version information about the application
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVersionDto'
      summary: Retrieve application version.
      tags:
        - Other
  /health:
    get:
      description: Checks whether the system's components are up and running.
      operationId: HealthController_check
      parameters: []
      responses:
        '200':
          description: The Health Check is successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  info:
                    type: object
                    example:
                      database:
                        status: up
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  error:
                    type: object
                    example: {}
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  details:
                    type: object
                    example:
                      database:
                        status: up
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
        '503':
          description: The Health Check is not successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  info:
                    type: object
                    example:
                      database:
                        status: up
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  error:
                    type: object
                    example:
                      redis:
                        status: down
                        message: Could not connect
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  details:
                    type: object
                    example:
                      database:
                        status: up
                      redis:
                        status: down
                        message: Could not connect
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
      summary: Check system health.
      tags:
        - Other
  /analyses/{id}:
    get:
      description: Retrieve the specified analysis.
      operationId: AnalysesController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAnalysisFullDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve an analysis.
      tags:
        - Analyses
  /analyses/batch:
    post:
      description: |-
        Requests an analysis for the specified plots.
            The analysis happens asynchronously, so you will receive a response object
            which includes a list of statuses and associated ids immediately after calling this endpoint.
            The statuses will be updated by the system once the actual analysis is completed.
      operationId: AnalysesController_createInBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnalysesBatchDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseCreateAnalysesBatchDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
      summary: Create an analysis for each requested plot.
      tags:
        - Analyses
  /plots/{plotId}/analyses:
    post:
      description: |-
        Requests an analysis for the specified plot.
            The analysis happens asynchronously, so you will receive a response object
            which includes a 'status' and an 'id' immediately after calling this endpoint.
            The status will be updated by the system once the actual analysis is completed.
      operationId: PlotAnalysesController_create
      parameters:
        - name: plotId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnalysisDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAnalysisFullDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '501':
          description: 501 Not Implemented when the analysis type is not implemented yet.
        '503':
          description: 503 Service Unavailable when the analyses service is not available.
      summary: Create an analysis for plot.
      tags:
        - Plot Analyses
    get:
      description: List all EUFOROBS and PRECISION analyses of the specified plot.
      operationId: PlotAnalysesController_findAll
      parameters:
        - name: plotId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetAnalysisFullDto'
        '401':
          description: ''
        '403':
          description: User does not have access to this plot
        '404':
          description: ''
      summary: List all EUFOROBS and PRECISION analyses of plot.
      tags:
        - Plot Analyses
  /v2/plots/{plotId}/analyses:
    get:
      description: List all analyses of the specified plot.
      operationId: PlotAnalysesController_findAllV2_v2
      parameters:
        - name: plotId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetAnalysisFullV2Dto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: List all analyses of plot.
      tags:
        - Plot Analyses
  /business-invitations:
    post:
      description: |-
        Creates a business invitation, which represents an invitation
            to a business to join your commercial network so that you can get access to
            their data.
      operationId: BusinessInvitationsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBusinessInvitationDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
        '422':
          description: ''
      summary: Invite a business to join your commercial network.
      tags:
        - Business Invitations
    get:
      description: |-
        List all business invitations you have received from other businesses.
            Business invitations cancelled by the sender will not be included in the
            response.
      operationId: BusinessInvitationsController_findAllNonCancelledByUser
      parameters:
        - name: status
          required: false
          in: query
          description: |-
            Filters by status. If missing, includes all statuses.
                To include multiple statuses, use the 'explode' syntax,
                for example, '?status=ACCEPTED&status=PENDING'
          explode: true
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BusinessInvitationStatus'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: List all the business invitations you received.
      tags:
        - Business Invitations
  /business-invitations/sent:
    get:
      description: |-
        List all business invitations you have sent to other businesses
            to join your commercial network.
      operationId: BusinessInvitationsController_findAllSentByUser
      parameters:
        - name: status
          required: false
          in: query
          description: |-
            Filters by status. If missing, includes all statuses.
                To include multiple statuses, use the 'explode' syntax,
                for example, '?status=ACCEPTED&status=PENDING'
          explode: true
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BusinessInvitationStatus'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: List all the business invitations you have sent.
      tags:
        - Business Invitations
  /business-invitations/{id}:
    get:
      description: Get the details of the specified business invitation.
      operationId: BusinessInvitationsController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Get a business invitation by ID.
      tags:
        - Business Invitations
    patch:
      description: |-
        Update the properties of the specified business invitation.
              Handles updates partially, i.e. properties missing in the request body will
              not be changed. Use this endpoint to update the status of the business
              invitation, i.e. to ACCEPTED or REJECTED.

        If you have sent the invitation,
              you can also cancel it with this endpoint and the status CANCELLED.
      operationId: BusinessInvitationsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBusinessInvitationDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '409':
          description: >-
            409 Conflict when the business connection already exists between the
            two businesses
        '422':
          description: ''
        '501':
          description: >-
            501 Not Implemented when the feature is not enabled on this
            environment.
      summary: Update a business invitation.
      tags:
        - Business Invitations
  /business-invitations/pending/{id}:
    get:
      description: >-
        Get the details of the specified business invitation only if the status
        is pending.
      operationId: BusinessInvitationsController_findOnePending
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBusinessInvitationDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Get a pending business invitation by ID.
      tags:
        - Business Invitations
  /business-invitations/batch:
    post:
      description: Creates multiple BusinessInvitations for a business.
      operationId: BusinessInvitationsController_createBulk
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: array
                  deprecated: true
                  items:
                    $ref: '#/components/schemas/CreateBusinessInvitationDto'
                  maxItems: 100
                  example:
                    - email: supplier1@example.com
                      customData:
                        department: procurement
                    - email: supplier2@example.com
                      customData:
                        region: europe
                - $ref: '#/components/schemas/CreateBatchBusinessInvitationDto'
      responses:
        '200':
          description: Returns a list of created invitations and any errors encountered.
          content:
            application/json:
              schema:
                type: object
                properties:
                  invitations:
                    type: array
                    items:
                      $ref: '#/components/schemas/GetBusinessInvitationDto'
                    maxItems: 100
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        '401':
          description: ''
        '403':
          description: ''
        '409':
          description: ''
        '422':
          description: ''
      summary: Invite multiple users to join your commercial network.
      tags:
        - Business Invitations
  /transactions/{id}:
    get:
      description: Retrieve a transaction by id.
      operationId: TransactionsController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransactionDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve a transaction.
      tags:
        - Transactions
    patch:
      description: >-
        Update the properties of the specified transaction. Handles updates
        partially.
      operationId: TransactionsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTransactionDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransactionDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Update a transaction.
      tags:
        - Transactions
    delete:
      description: Delete the specified transaction.
      operationId: TransactionsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Delete a transaction.
      tags:
        - Transactions
  /transactions:
    get:
      description: Lists all transactions related to your business.
      operationId: TransactionsController_getAll
      parameters:
        - name: includes
          required: false
          in: query
          description: >-
            A comma-separated list of relations to be included in the response.
            Possible relations are: components, components.supplierBusiness,
            components.supplierBusinesses, components.transaction,
            components.ddsReferences, dds, legalEntity, dds.ddsReference.
          schema:
            example: components,components.supplierBusinesses
      responses:
        '200':
          description: A list of all transactions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetTransactionDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: List all transactions.
      tags:
        - Transactions
    post:
      description: Create a transaction for a business.
      operationId: TransactionsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransactionDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransactionDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Create a transaction for a business.
      tags:
        - Transactions
  /transactions/{id}/submit:
    put:
      description: Update the status property of a transaction to TO_SUBMIT.
      operationId: TransactionsController_submit
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransactionDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '409':
          description: >-
            409 Conflict when a transaction is already SUBMITTED, AVAILABLE,
            WITHDRAWN or PROCESSING.
        '422':
          description: ''
      summary: Submit a transaction to be sent to traces.
      tags:
        - Transactions
  /components/{id}:
    get:
      description: Retrieve a component by id.
      operationId: ComponentsController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve a component.
      tags:
        - Components
    patch:
      description: >-
        Update the properties of the specified component. Handles updates
        partially.
      operationId: ComponentsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateComponentDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Update a component.
      tags:
        - Components
    delete:
      description: Delete the specified component.
      operationId: ComponentsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Delete a component.
      tags:
        - Components
  /transactions/{id}/components:
    post:
      description: Create a new component for the specified transaction.
      operationId: TransactionComponentsController_createComponent
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransactionComponentDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
      summary: Create a component for a transaction.
      tags:
        - Components
  /legal-entities:
    get:
      description: List all the legal entities of your business
      operationId: LegalEntitiesController_findAll
      parameters: []
      responses:
        '200':
          description: Returns the list of legal entities.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetLegalEntityDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: List all the legal entities of your business
      tags:
        - LegalEntities
    post:
      description: Create a legal entity for your business
      operationId: LegalEntitiesController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLegalEntityDto'
      responses:
        '200':
          description: Returns the created legal entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLegalEntityDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
      summary: Create a legal entity for your business
      tags:
        - LegalEntities
  /legal-entities/{id}:
    patch:
      description: Update a legal entity of your business
      operationId: LegalEntitiesController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLegalEntityDto'
      responses:
        '200':
          description: Returns the updated legal entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLegalEntityDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Update a legal entity of your business
      tags:
        - LegalEntities
    delete:
      description: Delete a legal entity of your business
      operationId: LegalEntitiesController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Delete a legal entity of your business
      tags:
        - LegalEntities
  /dds/fetch-dds-data:
    get:
      description: >-
        More info about EUDR Traces system:
        https://green-business.ec.europa.eu/deforestation-regulation-implementation/information-system-deforestation-regulation_en
      operationId: DdsController_fetchDdsData
      parameters:
        - name: verificationNumber
          required: true
          in: query
          description: The verification number of the DDS
          schema:
            example: KZ4BVOCZ
            type: string
        - name: referenceNumber
          required: true
          in: query
          description: The reference number of the DDS
          schema:
            example: 25DEPPQEM17212
            type: string
      responses:
        '200':
          description: The DDS data
        '400':
          description: Incorrect reference or/and verification number
        '403':
          description: The business does not have permission to manage transactions
        '429':
          description: 'Too many requests - Limit: 2 requests per 10 seconds'
        '503':
          description: The DDS data could not be fetched from EUDR Traces system
      summary: Fetch Due Diligence Statement data from EUDR Traces system
      tags:
        - DDS
  /survey-responses/{id}/pdf:
    get:
      description: Retrieve the specified completed survey response as rendered PDF.
      operationId: SurveyResponsesController_renderPdf
      parameters:
        - name: id
          required: true
          in: path
          description: Id of the survey response to be rendered.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: ''
          content:
            application/pdf:
              schema:
                format: binary
                type: string
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '422':
          description: Returned if the survey response is not in status COMPLETED.
        '501':
          description: >-
            501 Not Implemented when the feature is not enabled on this
            environment.
      summary: Retrieve survey response as PDF.
      tags:
        - Survey Responses
  /survey-responses/{id}:
    delete:
      description: Delete a survey response owned by your business that is DRAFT status.
      operationId: SurveyResponsesController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: ID of the survey response being deleted.
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
        '422':
          description: ''
      summary: Delete a survey response.
      tags:
        - Survey Responses
  /plot-risk-assessments:
    get:
      description: Get all plot risk assessments
      operationId: PlotRiskAssessmentController_findAll
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
        '401':
          description: ''
        '403':
          description: ''
      summary: Get all plot risk assessments
      tags:
        - Plot Risk Assessments
  /plot-risk-assessments/{id}:
    get:
      description: Get a given plot risk assessment by id
      operationId: PlotRiskAssessmentController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Get a given plot risk assessment by id
      tags:
        - Plot Risk Assessments
    patch:
      description: Update a plot risk assessment by id
      operationId: PlotRiskAssessmentController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePlotRiskAssessmentDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Update a plot risk assessment by id
      tags:
        - Plot Risk Assessments
  /plot-risk-assessments/{id}/history:
    get:
      description: Retrieve the history of changes for a plot risk assessment.
      operationId: PlotRiskAssessmentController_getHistory
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetHistoryEntryGetPlotRiskAssessmentDto'
        '401':
          description: ''
        '403':
          description: ''
        '404':
          description: ''
      summary: Retrieve the history of a plot risk assessment.
      tags:
        - Plot Risk Assessments
  /plots/{plotId}/plot-risk-assessments:
    post:
      description: Create a plot risk assessment
      operationId: PlotPlotRiskAssessmentController_create
      parameters:
        - name: plotId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlotRiskAssessmentDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
        '400':
          description: ''
        '401':
          description: ''
        '403':
          description: ''
      summary: Create a plot risk assessment
      tags:
        - Plot Risk Assessments
info:
  title: TradeAware API
  description: >-
    An API that accepts supply chain networks and plots of land to determine the
    deforestation state in line with the EU Deforestation Regulation
  version: 0.40.0
  contact: {}
tags: []
servers:
  - url: https://api.tradeaware.live-eo.com
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    Commodity:
      type: string
      enum:
        - cattle
        - cocoa
        - coffee
        - oil palm
        - rubber
        - soya
        - timber
      description: >-
        What crops (among the relevant commodities) are grown on this field
        (currently).
    CreatePlotDto:
      type: object
      properties:
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        description:
          type: string
          description: Short description to find and identify plots as owners.
        geometry:
          type: object
          description: >-
            The geometry of the plot with the polygon. Currently supported:
            Polygon geometry as defined in
            https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6.
          example:
            type: Polygon
            coordinates:
              - - - 100
                  - 0
                - - 101
                  - 0
                - - 101
                  - 1
                - - 100
                  - 1
                - - 100
                  - 0
        countryCode:
          type: string
          description: |-
            Deprecated. This will be automatically populated by the system.
                The country code (ISO 31661Alpha2 expected).
          deprecated: true
        isActive:
          type: boolean
          description: Is this plot active in the system
          default: true
        filename:
          type: string
          description: Filename of the file where the plot is defined
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a plot in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the plot.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
        areaHa:
          type: number
          description: |-
            The area of the plot or production place in hectares (ha).

                Only applicable when the geometry is a GeoJSON point.
                - must be between 0.01 and 4 hectares
                - defaults to 4 hectares if not specified

                If the geometry is a polygon, this value will be ignored as the area is calculated from the polygon itself
          default: 4
          minimum: 0.1
          maximum: 4
          example: 0.5
      required:
        - commodities
        - name
        - geometry
    GetPolygonDto:
      type: object
      properties:
        type:
          type: string
          example: Polygon
          description: The type of geometry. Always 'Polygon' for polygons
        coordinates:
          type: array
          description: >-
            A Polygon's coordinates. Three-dimensional number array. Should
            follow https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
          example:
            - - - 100
                - 0
              - - 100.01
                - 0
              - - 100.01
                - 0.01
              - - 100
                - 0.01
              - - 100
                - 0
          items:
            type: array
            items:
              type: array
              items:
                type: number
      required:
        - type
        - coordinates
    GetMultiPolygonDto:
      type: object
      properties:
        type:
          type: string
          example: MultiPolygon
          description: The type of geometry. Always 'MultiPolygon' for multipolygons
        coordinates:
          type: array
          description: >-
            A MultiPolygon's coordinates. Four-dimensional number array. Should
            follow https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.7
          items:
            type: array
            items:
              type: array
              items:
                type: array
                items:
                  type: number
          example: See https://datatracker.ietf.org/doc/html/rfc7946#appendix-A.6
      required:
        - type
        - coordinates
    AnalysisStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - SUCCEEDED
        - FAILED
      description: The overall status of the underlying analysis pipeline
    AnalysisType:
      type: string
      enum:
        - OS
        - EUFOROBS
        - PRECISION
      description: The type of analysis that was requested
    GetAnalysisFullDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of this analysis
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        status:
          example: PENDING
          description: The overall status of the underlying analysis pipeline
          allOf:
            - $ref: '#/components/schemas/AnalysisStatus'
        plotId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the plot that this analysis belongs to and is performed on
        analysedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        version:
          type: string
          example: open-source-1.0.0
          description: The version of the analysis pipeline that was run
        deforestedArea:
          type: number
          example: 123.45
          description: The deforested area in square meters
        deforestedGeometry:
          example:
            type: Polygon
            coordinates:
              - - - 13
                  - 52.5
                - - 13.5
                  - 52.5
                - - 13.5
                  - 52
                - - 13
                  - 52
                - - 13
                  - 52.5
          description: The deforested area as a GeoJSON Polygon
          oneOf:
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        riskOfDeforestation:
          type: number
          example: 0.3
          description: >-
            The risk of deforestation in this area. 0.0 is no risk, 1.0 is
            certain deforestation.
        type:
          example: OS
          description: The type of analysis that was requested
          allOf:
            - $ref: '#/components/schemas/AnalysisType'
        customData:
          type: object
          example:
            some: metadata
          description: Additional custom data. We don't use it for any calculations.
        metadata:
          type: object
          example:
            some: metadata
          description: |-
            Additional metadata. We don't use it for any calculations.
                  This field is deprecated and will be removed in the future. Please use
                  customData instead.
          deprecated: true
        name:
          type: string
          description: A human-friendly name for this analysis
      required:
        - id
        - createdAt
        - updatedAt
        - status
        - plotId
        - type
    GetMostRecentAnalysesFullDto:
      type: object
      properties:
        EUFOROBS:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetAnalysisFullDto'
        PRECISION:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetAnalysisFullDto'
      required:
        - EUFOROBS
        - PRECISION
    PlotRiskAssessmentStatus:
      type: string
      enum:
        - NEW
        - UNDER_REVIEW
        - IN_RISK_MITIGATION
        - EUDR_COMPLIANT
        - EUDR_NON_COMPLIANT
      description: The risk assessment status of this plot set by your business
    GetPlotFullDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        suppliers:
          description: |-
            The suppliers of the plot with respect to the current business.
                May be multiple if the plot is reachable in the supply chain
                via multiple different direct suppliers of the current business.
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessDto'
        geometry:
          oneOf:
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
          description: The geometry of the plot.
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        surfaceArea:
          type: number
          description: Surface area in square meters
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country code of where the plot is located
        mostRecentAnalysis:
          description: |-
            The latest analysis of this plot by createdAt.
                  IMPORTANT: only set when 'mostRecentAnalysis' is provided in
                  'includes'. If no analysis on this plot is available yet, this
                  property may be missing even when provided in 'includes'.
          allOf:
            - $ref: '#/components/schemas/GetAnalysisFullDto'
        mostRecentAnalysesByType:
          description: |-
            The latest analyses of this plot by createdAt.
                  Contains one analysis per analysis type, or null if no analysis of that type is available.
          allOf:
            - $ref: '#/components/schemas/GetMostRecentAnalysesFullDto'
        riskAssessmentStatus:
          description: The risk assessment status of this plot set by your business
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        riskLevel:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: |-
            The risk level of deforestation in this plot.
                  IMPORTANT: only set when 'riskLevel' is provided in 'includes'.
                  If no analysis on this plot is available yet, this property may be null.
        filename:
          type: object
          description: >-
            Filename of the plot. Useful to know where is the Plot coming from
            on batch create.
          nullable: true
        description:
          type: string
          description: >-
            Free text descrption of the plot. Useful for to keep human friendly
            Plot names.
          nullable: true
        ownerId:
          type: string
          description: >-
            The id of the owning business. May be undefined for supplier
            masking.
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a plot in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the plot.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - id
        - createdAt
        - updatedAt
        - geometry
        - commodities
        - name
        - surfaceArea
        - countryCode
    BusinessInvitationStatus:
      type: string
      enum:
        - PENDING
        - ACCEPTED
        - REJECTED
        - EXPIRED
        - CANCELLED
      description: status of this invitation
    GetBusinessInvitationDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: id of this entity
        sentByUser:
          description: user that sent this invitation
          allOf:
            - $ref: '#/components/schemas/GetUserDto'
        business:
          description: business that this invitation is for
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        email:
          type: string
          example: user@example.com
          description: email of the user that this invitation is for
        status:
          description: status of this invitation
          allOf:
            - $ref: '#/components/schemas/BusinessInvitationStatus'
        createdAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was created
        updatedAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was last updated
        sourceIsInvitee:
          type: boolean
          example: 'true'
          description: describes if the invited business will share or receive data
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a business invitation in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the business invitation.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - id
        - sentByUser
        - email
        - status
        - createdAt
        - updatedAt
        - sourceIsInvitee
    UserInvitationStatus:
      type: string
      enum:
        - ACCEPTED
        - CANCELLED
        - EXPIRED
        - PENDING
        - REJECTED
      description: status of this invitation
    GetUserInvitationDto:
      type: object
      properties:
        id:
          type: string
          description: id of this entity
        email:
          type: string
          example: some@email.com
          description: email of the user that this invitation is for
        sentByUser:
          description: user that sent this invitation
          allOf:
            - $ref: '#/components/schemas/GetUserDto'
        inviteToBusiness:
          description: business from which this invitation was sent
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        status:
          example: ACCEPTED
          description: status of this invitation
          allOf:
            - $ref: '#/components/schemas/UserInvitationStatus'
        createdAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was created
        updatedAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was last updated
      required:
        - id
        - email
        - sentByUser
        - inviteToBusiness
        - status
        - createdAt
        - updatedAt
    GetEntitlementsDto:
      type: object
      properties:
        canTriggerPrecisionAnalysis:
          type: boolean
          default: false
          description: Indicates whether the user can request precision analysis for a plot
        canManageTransactions:
          type: boolean
          default: false
          description: Indicates whether the user can manage transactions
        canViewSurveys:
          type: boolean
          default: false
          description: Indicates whether the user can view surveys
        canViewOwnedSurveyResponses:
          type: boolean
          default: true
          description: >-
            Indicates whether the user can view the survey responses owned by
            their business
        canViewSurveyResponsesOfTier1Suppliers:
          type: boolean
          default: false
          description: >-
            Indicates whether the user can view the survey responses of their
            tier-1 suppliers
        canMutateOwnedSurveyResponses:
          type: boolean
          default: false
          description: >-
            Indicates whether the user can update or delete survey responses or
            create a new survey response owned by their business
        canDownloadSurveyResponses:
          type: boolean
          default: false
          description: >-
            Indicates whether the user can download their own survey responses
            or the completed survey responses of their tier-1 suppliers
        canManageWebhooks:
          type: boolean
          default: false
          description: Indicates whether the user can manage webhooks
        canAccessApi:
          type: boolean
          default: false
          description: Indicates whether the user has programmatic access to the API
        canManageCmsSupplierRiskAssessmentStatuses:
          type: boolean
          default: false
          description: >-
            Indicates whether the user can manage CMS supplier risk assessment
            statuses
      required:
        - canTriggerPrecisionAnalysis
        - canManageTransactions
        - canViewSurveys
        - canViewOwnedSurveyResponses
        - canViewSurveyResponsesOfTier1Suppliers
        - canMutateOwnedSurveyResponses
        - canDownloadSurveyResponses
        - canManageWebhooks
        - canAccessApi
        - canManageCmsSupplierRiskAssessmentStatuses
    GetUserDto:
      type: object
      properties:
        auth0UserId:
          type: string
          example: auth0|41ba-aa49-f114ca4c263f
          description: id of this entity, ref to auth0
        business:
          description: business that this user is member of
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        businessId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: business id that this user is member of
        firstName:
          type: string
          example: Paul
          description: first name of user
        lastName:
          type: string
          example: Smith
          description: last name of user
        locale:
          type: string
          example: id-ID
          description: locale that is used for the invitation email sent to the user
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        completed:
          type: boolean
          example: 'false'
          default: false
          description: is onboarding process completed
        businessInvitations:
          description: business invitations with relation to
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessInvitationDto'
        userInvitations:
          description: user invitations with relation to
          type: array
          items:
            $ref: '#/components/schemas/GetUserInvitationDto'
        email:
          type: string
          example: user@example.com
          description: email of the user
        consentedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: >-
            ISO 8601 Date when user consented to terms and conditions. If
            undefined, then consent has not been given
        entitlements:
          default:
            canTriggerPrecisionAnalysis: false
          description: Entitlements of the user, e.g. can trigger precision analysis
          allOf:
            - $ref: '#/components/schemas/GetEntitlementsDto'
      required:
        - auth0UserId
        - locale
        - createdAt
        - updatedAt
        - completed
        - entitlements
    GetBusinessConnectionDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: id of this entity
        sourceBusiness:
          description: source business of this connection
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        targetBusiness:
          description: target business of this connection
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        createdAt:
          type: string
          example: '2021-01-01T00:00:00.000Z'
          description: date that this connection was created
        updatedAt:
          type: string
          example: '2021-01-01T00:00:00.000Z'
          description: date that this connection was last updated
        customData:
          type: object
          example:
            foo: bar
          description: >-
            metadata for this business connection. Only visible to the buyer who
            set this.
        plotsCount:
          type: number
          example: 1
          description: Total number of plots in this supplier's supply chain
          default: 0
        plotsCommodities:
          example:
            - cattle
            - cocoa
          description: List of all commodities produced in this supplier's supply chain
          type: array
          items:
            type: string
      required:
        - id
        - sourceBusiness
        - targetBusiness
        - createdAt
        - updatedAt
        - customData
        - plotsCount
        - plotsCommodities
    GetBusinessDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        email:
          type: string
          example: user@example.com
          description: email of the contact person in the business
          nullable: true
        name:
          type: string
          example: Example Inc.
          description: business's name
          nullable: true
        username:
          type: string
          example: John Doe
          description: Business's username
          nullable: true
        addressStreet:
          type: string
          example: Salawati 143
          description: street address of the business
          nullable: true
        addressZip:
          type: string
          example: '98451'
          description: country-specific area code or zip code of the business's address
          nullable: true
        addressPostcode:
          type: string
          example: '12345'
          description: country-specific postcode of the business's address
          nullable: true
        addressArea:
          type: string
          example: Brandenburg
          description: country region of the business's address
          nullable: true
        addressCity:
          type: string
          example: West Papua
          description: city of the business's address
          nullable: true
        addressCountryCode:
          type: string
          example: ID
          description: two-letter country code (ISO 3166 Alpha-2) of the business's address
          nullable: true
        addressCountry:
          type: string
          example: Indonesia
          description: Country of the business's address
          nullable: true
        addressLine1:
          type: string
          example: Salawati 123
          description: first line of the business address
          nullable: true
        addressLine2:
          type: string
          example: 3rd floor
          description: second line of the business address
          nullable: true
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        initialLocale:
          type: object
          example: id-ID
          description: Locale that is used for the invitation email sent to the business
        units:
          type: string
          example: metric
          description: units of measurement used by the application
        plots:
          description: >-
            IMPORTANT: only set when 'plots' is provided in 'includes'. List of
            plots owned by the business
          type: array
          items:
            $ref: '#/components/schemas/GetPlotFullDto'
        newlyCreated:
          type: boolean
          example: 'true'
          default: true
          description: whether the business was created recently
        members:
          description: users members of the business
          type: array
          items:
            $ref: '#/components/schemas/GetUserDto'
        connectionsAsSource:
          description: connections where the business is the source
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessConnectionDto'
        connectionsAsTarget:
          description: connections where the business is the target
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessConnectionDto'
        businessInvitations:
          description: invitations sent by the business
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessInvitationDto'
        contactPerson:
          description: contact person of business
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetUserDto'
        machineToMachineClientId:
          type: string
          example: 1234567890asdfghjk
          description: The machine-to-machine client created by user
          nullable: true
        eori:
          type: string
          description: EORI number of the business
          nullable: true
        vat:
          type: string
          description: VAT number of the business
          nullable: true
        tracesEnvironment:
          type: string
          enum:
            - ACCEPTANCE
            - PRODUCTION
          example: ACCEPTANCE
          description: >-
            The TRACES environment configured for the business. ACCEPTANCE for
            testing, PRODUCTION for live submissions.
      required:
        - id
        - email
        - name
        - createdAt
        - updatedAt
        - initialLocale
        - newlyCreated
        - eori
        - vat
    GetAnalysisBaseDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of this analysis
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        status:
          example: PENDING
          description: The overall status of the underlying analysis pipeline
          allOf:
            - $ref: '#/components/schemas/AnalysisStatus'
        plotId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the plot that this analysis belongs to and is performed on
        analysedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        version:
          type: string
          example: open-source-1.0.0
          description: The version of the analysis pipeline that was run
        deforestedArea:
          type: number
          example: 123.45
          description: The deforested area in square meters
        deforestedGeometry:
          example:
            type: Polygon
            coordinates:
              - - - 13
                  - 52.5
                - - 13.5
                  - 52.5
                - - 13.5
                  - 52
                - - 13
                  - 52
                - - 13
                  - 52.5
          description: The deforested area as a GeoJSON Polygon
          oneOf:
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        riskOfDeforestation:
          type: number
          example: 0.3
          description: >-
            The risk of deforestation in this area. 0.0 is no risk, 1.0 is
            certain deforestation.
        type:
          example: OS
          description: The type of analysis that was requested
          allOf:
            - $ref: '#/components/schemas/AnalysisType'
      required:
        - id
        - createdAt
        - updatedAt
        - status
        - plotId
        - type
    GetMostRecentAnalysesBaseDto:
      type: object
      properties:
        EUFOROBS:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetAnalysisBaseDto'
        PRECISION:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetAnalysisBaseDto'
      required:
        - EUFOROBS
        - PRECISION
    GetPlotBaseDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        suppliers:
          description: |-
            The suppliers of the plot with respect to the current business.
                May be multiple if the plot is reachable in the supply chain
                via multiple different direct suppliers of the current business.
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessDto'
        geometry:
          oneOf:
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
          description: The geometry of the plot.
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        surfaceArea:
          type: number
          description: Surface area in square meters
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country code of where the plot is located
        mostRecentAnalysis:
          description: |-
            The latest analysis of this plot by createdAt.
                  IMPORTANT: only set when 'mostRecentAnalysis' is provided in
                  'includes'. If no analysis on this plot is available yet, this
                  property may be missing even when provided in 'includes'.
          allOf:
            - $ref: '#/components/schemas/GetAnalysisBaseDto'
        mostRecentAnalysesByType:
          description: |-
            The latest analyses of this plot by createdAt.
                Contains one analysis per analysis type, or null if no analysis of that type is available.
          allOf:
            - $ref: '#/components/schemas/GetMostRecentAnalysesBaseDto'
        riskAssessmentStatus:
          description: The risk assessment status of this plot set by your business
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        riskLevel:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: |-
            The risk level of deforestation in this plot.
                  IMPORTANT: only set when 'riskLevel' is provided in 'includes'.
                  If no analysis on this plot is available yet, this property may be null.
      required:
        - id
        - createdAt
        - updatedAt
        - geometry
        - commodities
        - name
        - surfaceArea
        - countryCode
    CreateGeoJsonPlotPropertiesDto:
      type: object
      properties:
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        description:
          type: string
          description: Short description to find and identify plots as owners.
        countryCode:
          type: string
          description: |-
            Deprecated. This will be automatically populated by the system.
                The country code (ISO 31661Alpha2 expected).
          deprecated: true
        isActive:
          type: boolean
          description: Is this plot active in the system
          default: true
        filename:
          type: string
          description: Filename of the file where the plot is defined
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a plot in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the plot.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
        areaHa:
          type: number
          description: |-
            The area of the plot or production place in hectares (ha).

                Only applicable when the geometry is a GeoJSON point.
                - must be between 0.01 and 4 hectares
                - defaults to 4 hectares if not specified

                If the geometry is a polygon, this value will be ignored as the area is calculated from the polygon itself
          default: 4
          minimum: 0.1
          maximum: 4
          example: 0.5
      required:
        - commodities
        - name
    CreateGeoJsonPlotDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the geojson object. Always 'Feature' for geojson plots.
          example: Feature
        geometry:
          description: >-
            A GeoJSON geometry object as defined in
            https://datatracker.ietf.org/doc/html/rfc7946
          oneOf:
            - $ref: '#/components/schemas/GetPointDto'
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        properties:
          description: The properties of the geojson plot.
          allOf:
            - $ref: '#/components/schemas/CreateGeoJsonPlotPropertiesDto'
      description: Create a plot in GeoJSON format
      required:
        - type
        - geometry
        - properties
    GetBaseGeoJsonPlotPropertiesDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        suppliers:
          description: |-
            The suppliers of the plot with respect to the current business.
                May be multiple if the plot is reachable in the supply chain
                via multiple different direct suppliers of the current business.
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessDto'
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        surfaceArea:
          type: number
          description: Surface area in square meters
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country code of where the plot is located
        mostRecentAnalysis:
          description: |-
            The latest analysis of this plot by createdAt.
                  IMPORTANT: only set when 'mostRecentAnalysis' is provided in
                  'includes'. If no analysis on this plot is available yet, this
                  property may be missing even when provided in 'includes'.
          allOf:
            - $ref: '#/components/schemas/GetAnalysisBaseDto'
        mostRecentAnalysesByType:
          description: |-
            The latest analyses of this plot by createdAt.
                Contains one analysis per analysis type, or null if no analysis of that type is available.
          allOf:
            - $ref: '#/components/schemas/GetMostRecentAnalysesBaseDto'
        riskAssessmentStatus:
          description: The risk assessment status of this plot set by your business
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        riskLevel:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: |-
            The risk level of deforestation in this plot.
                  IMPORTANT: only set when 'riskLevel' is provided in 'includes'.
                  If no analysis on this plot is available yet, this property may be null.
      required:
        - id
        - createdAt
        - updatedAt
        - commodities
        - name
        - surfaceArea
        - countryCode
    GetBaseGeoJsonPlotDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the geojson object. Always 'Feature' for geojson plots.
          example: Feature
        id:
          type: string
          description: The id of the plot.
          example: '123'
        geometry:
          description: >-
            A GeoJSON geometry object as defined in
            https://datatracker.ietf.org/doc/html/rfc7946
          oneOf:
            - $ref: '#/components/schemas/GetPointDto'
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        properties:
          description: The properties of the geojson plot.
          allOf:
            - $ref: '#/components/schemas/GetBaseGeoJsonPlotPropertiesDto'
      required:
        - type
        - id
        - geometry
        - properties
    GetPointDto:
      type: object
      properties:
        type:
          type: string
          example: Point
          description: The type of geometry. Always 'Point' for points
        coordinates:
          type: array
          description: >-
            A Point's coordinates. Should follow
            https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
          example:
            - 100
            - 0
          items:
            type: number
            minItems: 2
            maxItems: 3
      required:
        - type
        - coordinates
    GetFullGeoJsonPlotPropertiesDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        suppliers:
          description: |-
            The suppliers of the plot with respect to the current business.
                May be multiple if the plot is reachable in the supply chain
                via multiple different direct suppliers of the current business.
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessDto'
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        surfaceArea:
          type: number
          description: Surface area in square meters
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country code of where the plot is located
        mostRecentAnalysis:
          description: |-
            The latest analysis of this plot by createdAt.
                  IMPORTANT: only set when 'mostRecentAnalysis' is provided in
                  'includes'. If no analysis on this plot is available yet, this
                  property may be missing even when provided in 'includes'.
          allOf:
            - $ref: '#/components/schemas/GetAnalysisFullDto'
        mostRecentAnalysesByType:
          description: |-
            The latest analyses of this plot by createdAt.
                  Contains one analysis per analysis type, or null if no analysis of that type is available.
          allOf:
            - $ref: '#/components/schemas/GetMostRecentAnalysesFullDto'
        riskAssessmentStatus:
          description: The risk assessment status of this plot set by your business
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        riskLevel:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: |-
            The risk level of deforestation in this plot.
                  IMPORTANT: only set when 'riskLevel' is provided in 'includes'.
                  If no analysis on this plot is available yet, this property may be null.
        filename:
          type: object
          description: >-
            Filename of the plot. Useful to know where is the Plot coming from
            on batch create.
          nullable: true
        description:
          type: string
          description: >-
            Free text descrption of the plot. Useful for to keep human friendly
            Plot names.
          nullable: true
        ownerId:
          type: string
          description: >-
            The id of the owning business. May be undefined for supplier
            masking.
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a plot in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the plot.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - id
        - createdAt
        - updatedAt
        - commodities
        - name
        - surfaceArea
        - countryCode
    GetFullGeoJsonPlotDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the geojson object. Always 'Feature' for geojson plots.
          example: Feature
        id:
          type: string
          description: The id of the plot.
          example: '123'
        geometry:
          description: >-
            A GeoJSON geometry object as defined in
            https://datatracker.ietf.org/doc/html/rfc7946
          oneOf:
            - $ref: '#/components/schemas/GetPointDto'
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        properties:
          description: The properties of the geojson plot.
          allOf:
            - $ref: '#/components/schemas/GetFullGeoJsonPlotPropertiesDto'
      description: Create a plot in GeoJSON format
      required:
        - type
        - id
        - geometry
        - properties
    GetAllGeoJsonPlotDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the geojson object. Always 'FeatureCollection'
          example: FeatureCollection
        features:
          type: array
          description: A list of plots as GeoJSON Features.
          items:
            oneOf:
              - $ref: '#/components/schemas/GetBaseGeoJsonPlotDto'
              - $ref: '#/components/schemas/GetFullGeoJsonPlotDto'
      required:
        - type
        - features
    BatchCreatePlotsDto:
      type: object
      properties:
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on these
            fields (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        filename:
          type: string
          description: Filename used to upload Plots in batch.
        geometries:
          type: object
          description: >-
            The geometries of the Plots as key-value pairs. Each value should be
            a geometry. Each key is used to identify the geometry/plot in the
            response and stored as name of the plot
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/GetPolygonDto'
              - $ref: '#/components/schemas/GetMultiPolygonDto'
          example:
            plot1:
              type: Polygon
              coordinates:
                - - - 30
                    - 10
                  - - 40
                    - 40
                  - - 20
                    - 40
                  - - 10
                    - 20
                  - - 30
                    - 10
            plot2:
              type: MultiPolygon
              coordinates:
                - - - - 30
                      - 20
                    - - 45
                      - 40
                    - - 10
                      - 40
                    - - 30
                      - 20
                - - - - 15
                      - 5
                    - - 40
                      - 10
                    - - 10
                      - 20
                    - - 5
                      - 10
                    - - 15
                      - 5
      required:
        - commodities
        - geometries
    ResponseCreatePlotsBatchDto:
      type: object
      properties:
        status:
          type: string
          description: It describes the overall result of the batch operation.
          example: PARTIAL_FAILURE
        errors:
          type: object
          description: Index and error detail for failed Plots.
          example:
            some_index_0: some detailed error
        processed:
          type: object
          description: Index and endpoints for Plots processed successfully.
          example:
            some_index_0: /plots/123
      required:
        - status
        - errors
        - processed
    CreateBatchGeoJsonPlotDto:
      type: object
      properties:
        type:
          type: string
          description: The type of the geojson object. Always 'FeatureCollection'
          example: FeatureCollection
        features:
          type: array
          description: A list of plots as GeoJSON Features.
          items:
            $ref: '#/components/schemas/CreateGeoJsonPlotDto'
          maxItems: 10000
          minItems: 1
      required:
        - type
        - features
    UpdatePlotDto:
      type: object
      properties:
        commodities:
          type: array
          description: >-
            What crops (among the relevant commodities) are grown on this field
            (currently).
          example:
            - oil palm
            - rubber
          items:
            $ref: '#/components/schemas/Commodity'
        name:
          type: string
          description: >-
            Free text name of the plot. Useful for easily finding and
            identifying the plot as an enduser.
        description:
          type: string
          description: Short description to find and identify plots as owners.
        geometry:
          type: object
          description: >-
            The geometry of the plot with the polygon. Currently supported:
            Polygon geometry as defined in
            https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6.
          example:
            type: Polygon
            coordinates:
              - - - 100
                  - 0
                - - 101
                  - 0
                - - 101
                  - 1
                - - 100
                  - 1
                - - 100
                  - 0
        countryCode:
          type: string
          description: |-
            Deprecated. This will be automatically populated by the system.
                The country code (ISO 31661Alpha2 expected).
          deprecated: true
        isActive:
          type: boolean
          description: Is this plot active in the system
          default: true
        filename:
          type: string
          description: Filename of the file where the plot is defined
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a plot in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the plot.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
        areaHa:
          type: number
          description: |-
            The area of the plot or production place in hectares (ha).

                Only applicable when the geometry is a GeoJSON point.
                - must be between 0.01 and 4 hectares
                - defaults to 4 hectares if not specified

                If the geometry is a polygon, this value will be ignored as the area is calculated from the polygon itself
          default: 4
          minimum: 0.1
          maximum: 4
          example: 0.5
    DeleteBatchPlotsDto:
      type: object
      properties:
        plotIds:
          description: The IDs of the plots to delete.
          maxItems: 10000
          minItems: 1
          type: array
          items:
            type: string
      required:
        - plotIds
    UpdateBusinessConnectionDto:
      type: object
      properties:
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a business invitation in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the business invitation.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - customData
    GetMemberDto:
      type: object
      properties:
        firstName:
          type: string
          example: Paul
          description: first name of user
        lastName:
          type: string
          example: Smith
          description: last name of user
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        completed:
          type: boolean
          example: 'false'
          default: false
          description: is onboarding process completed
        email:
          type: string
          example: user@example.com
          description: email of the user
        consentedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: >-
            ISO 8601 Date when user consented to terms and conditions. If
            undefined, then consent has not been given
      required:
        - createdAt
        - updatedAt
        - completed
    SupplierRiskAssessmentStatus:
      type: string
      enum:
        - NEW
        - UNDER_REVIEW
        - READY_FOR_ASSESSMENT
        - CMS_ASSESSMENT_REQUESTED
        - CMS_ASSESSMENT_COMPLETED
        - IN_RISK_MITIGATION
        - EUDR_COMPLIANT
        - EUDR_NON_COMPLIANT
      description: The status of the supplier risk assessment
    GetAttachmentDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        createdAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        fileUrl:
          type: string
          example: >-
            https://tradeaware.live-eo.com/api/biz-id-74b46f10-4d05-467d-bbfd-e2386772ff9b/atc-id-60bcd197-84d7-45e4-ae5f-827c8e739185.pdf
          description: >-
            Absolute URL to download the file that this attachment is
            representing. Usage example: curl <fileUrl>
        filename:
          type: string
          example: testfile.txt
          description: Name of file, including extension
        fileSizeKb:
          type: number
          example: 1024
          description: File size in kilobytes (KB)
        uploadedByUserId:
          type: string
          example: auth0|1234567890abcdef
          description: >-
            The Auth0 user ID of the user who uploaded the file. Null if the
            attachment was uploaded by an M2M client.
          nullable: true
      required:
        - id
        - updatedAt
        - createdAt
        - filename
        - fileSizeKb
        - uploadedByUserId
    GetSupplierRiskAssessmentDto:
      type: object
      properties:
        id:
          type: string
          description: The ID of the supplier risk assessment
          example: 123e4567-e89b-12d3-a456-426614174000
        status:
          description: The status of the supplier risk assessment
          example: NEW
          default: NEW
          allOf:
            - $ref: '#/components/schemas/SupplierRiskAssessmentStatus'
        notes:
          type: string
          description: The notes of the supplier risk assessment
          example: This is a note
          maxLength: 1000
        createdAt:
          format: date-time
          type: string
          description: The date and time the supplier risk assessment was created
          example: '2023-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time the supplier risk assessment was updated
          example: '2023-01-01T00:00:00.000Z'
        supplierId:
          type: string
          description: The ID of the supplier assessed by the buyer
          example: 123e4567-e89b-12d3-a456-426614174000
        buyerId:
          type: string
          description: The ID of the buyer assessing the supplier risk
          example: 123e4567-e89b-12d3-a456-426614174000
        supplier:
          description: The supplier assessed by the buyer
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        buyer:
          description: The buyer assessing the supplier risk
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        attachments:
          description: The documents associated with the supplier risk assessment
          type: array
          items:
            $ref: '#/components/schemas/GetAttachmentDto'
      required:
        - id
        - status
        - createdAt
        - updatedAt
        - supplierId
        - buyerId
        - attachments
    UpdateSupplierRiskAssessmentDto:
      type: object
      properties:
        status:
          default: NEW
          description: The status of the supplier risk assessment
          allOf:
            - $ref: '#/components/schemas/SupplierRiskAssessmentStatus'
        notes:
          type: string
          maxLength: 1000
          description: The notes of the supplier risk assessment
        attachmentIds:
          description: >-
            List of attachments included as part of the supplier risk
            assessment.
                  Note that setting this property is atomic, so always provide the full list of attachments for this supplier risk assessment.
                  To remove all attachments from this supplier risk assessment, set the value to an empty array.
                  Beware that removing an attachment from a supplier risk assessment does NOT mean deletion
                  of the attachment. To delete an attachment, please refer to the
                  API documentation on Attachments.
          example:
            - c1dbc78d-a127-454a-961b-ef30becf37fd
            - a8593d6b-1d23-47d0-9396-72d1a4862d19
          type: array
          items:
            type: string
    GetSupplierRiskAssessmentHistoryDto:
      type: object
      properties:
        id:
          type: string
          description: The ID of the supplier risk assessment
          example: 123e4567-e89b-12d3-a456-426614174000
        status:
          description: The status of the supplier risk assessment
          example: NEW
          default: NEW
          allOf:
            - $ref: '#/components/schemas/SupplierRiskAssessmentStatus'
        notes:
          type: string
          description: The notes of the supplier risk assessment
          example: This is a note
          maxLength: 1000
        createdAt:
          format: date-time
          type: string
          description: The date and time the supplier risk assessment was created
          example: '2023-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time the supplier risk assessment was updated
          example: '2023-01-01T00:00:00.000Z'
        supplierId:
          type: string
          description: The ID of the supplier assessed by the buyer
          example: 123e4567-e89b-12d3-a456-426614174000
        buyerId:
          type: string
          description: The ID of the buyer assessing the supplier risk
          example: 123e4567-e89b-12d3-a456-426614174000
        supplier:
          description: The supplier assessed by the buyer
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        buyer:
          description: The buyer assessing the supplier risk
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        attachmentIds:
          description: The document ids associated with the supplier risk assessment
          type: array
          items:
            type: string
      required:
        - id
        - status
        - createdAt
        - updatedAt
        - supplierId
        - buyerId
    UserType:
      type: string
      enum:
        - USER
        - M2M
        - SYSTEM
      description: The type of the user that did the change. Can be USER, M2M, SYSTEM.
    ActionType:
      type: string
      enum:
        - CREATE
        - UPDATE
        - DELETE
      description: The type of the action. Can be CREATE, UPDATE, DELETE.
    GetHistoryEntryGetSupplierRiskAssessmentHistoryDto:
      type: object
      properties:
        entityId:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Id of this entity
        changedByUserType:
          description: The type of the user that did the change. Can be USER, M2M, SYSTEM.
          allOf:
            - $ref: '#/components/schemas/UserType'
        changedByUser:
          nullable: true
          description: User that triggered the change.
          allOf:
            - $ref: '#/components/schemas/GetUserDto'
        action:
          description: The type of the action. Can be CREATE, UPDATE, DELETE.
          allOf:
            - $ref: '#/components/schemas/ActionType'
        changedAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was last updated
        beforeData:
          description: The entity before the change was made.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetSupplierRiskAssessmentHistoryDto'
        afterData:
          description: The entity after the change was made.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetSupplierRiskAssessmentHistoryDto'
      required:
        - entityId
        - changedByUserType
        - changedByUser
        - action
        - changedAt
        - beforeData
        - afterData
    CreateSupplierRiskAssessmentDto:
      type: object
      properties:
        status:
          default: NEW
          description: The status of the supplier risk assessment
          allOf:
            - $ref: '#/components/schemas/SupplierRiskAssessmentStatus'
        notes:
          type: string
          maxLength: 1000
          description: The notes of the supplier risk assessment
        attachmentIds:
          description: >-
            List of attachments included as part of the supplier risk
            assessment.
                  Note that setting this property is atomic, so always provide the full list of attachments for this supplier risk assessment.
                  To remove all attachments from this supplier risk assessment, set the value to an empty array.
                  Beware that removing an attachment from a supplier risk assessment does NOT mean deletion
                  of the attachment. To delete an attachment, please refer to the
                  API documentation on Attachments.
          example:
            - c1dbc78d-a127-454a-961b-ef30becf37fd
            - a8593d6b-1d23-47d0-9396-72d1a4862d19
          type: array
          items:
            type: string
    CreateAttachmentDto:
      type: object
      properties:
        file:
          type: string
          description: File data
          format: binary
      required:
        - file
    WebhookEventType:
      type: string
      enum:
        - transaction.updated
        - business_invitation.updated
        - analysis.precision.updated
        - supplier_risk_assessment.updated
      description: Types of events to subscribe to
    CreateWebhookDto:
      type: object
      properties:
        url:
          type: string
          description: >-
            The URL where webhook events will be sent. Must be a valid URL with
            a TLD.
          example: https://example.com/webhooks
          maxLength: 2048
          format: url
        description:
          type: string
          description: Optional description for this webhook
          maxLength: 1000
        events:
          type: array
          description: Types of events to subscribe to
          example:
            - transaction.updated
          items:
            $ref: '#/components/schemas/WebhookEventType'
        isActive:
          type: boolean
          description: Whether the webhook is active
          example: true
          default: true
      required:
        - url
        - events
    GetWebhookDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the webhook
          example: 123e4567-e89b-12d3-a456-426614174000
        url:
          type: string
          description: The URL where webhook events will be sent
          example: https://example.com/webhooks
        description:
          type: object
          description: Optional description for this webhook
        events:
          type: array
          description: Types of events subscribed to
          example:
            - transaction.updated
          items:
            $ref: '#/components/schemas/WebhookEventType'
        isActive:
          type: boolean
          description: Whether the webhook is active
          example: true
        createdAt:
          format: date-time
          type: string
          description: When the webhook was created
          example: '2023-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: When the webhook was last updated
          example: '2023-01-01T12:00:00.000Z'
      required:
        - id
        - url
        - description
        - events
        - isActive
        - createdAt
        - updatedAt
    GetWebhookListEventsDto:
      type: object
      properties:
        events:
          description: List of supported webhook events
          example:
            - transaction.updated
          type: array
          items:
            type: string
      required:
        - events
    UpdateWebhookDto:
      type: object
      properties:
        url:
          type: string
          description: >-
            The URL where webhook events will be sent. Must be a valid URL with
            a TLD.
          example: https://example.com/webhooks
          maxLength: 2048
          format: url
        description:
          type: string
          description: Optional description for this webhook
          maxLength: 1000
        isActive:
          type: boolean
          description: Whether the webhook is active
          example: true
      required:
        - url
    GetWebhookStatsDto:
      type: object
      properties:
        successfulMessages:
          type: number
          description: The number of successful messages
          example: 100
        failedMessages:
          type: number
          description: The number of failed messages
          example: 10
      required:
        - successfulMessages
        - failedMessages
    WebhookAttemptStatus:
      type: string
      enum:
        - SUCCESS
        - PENDING
        - FAILED
        - SENDING
      description: Status of the webhook attempt
    WebhookMessageDto:
      type: object
      properties:
        eventType:
          description: Type of the event
          example: transaction.updated
          allOf:
            - $ref: '#/components/schemas/WebhookEventType'
        payload:
          type: object
          description: Event payload data
          example: {}
        id:
          type: string
          description: Unique identifier for the message
          example: msg_1srOrx2ZWZBpBUvZwXKQmoEYga2
        timestamp:
          format: date-time
          type: string
          description: Timestamp when the message was created
          example: '2019-08-24T14:15:22Z'
      required:
        - eventType
        - payload
        - id
        - timestamp
    GetWebhookAttemptDto:
      type: object
      properties:
        url:
          type: string
          description: The URL where the webhook was sent
          example: https://example.com/webhook/
        response:
          type: string
          description: Response body from the webhook endpoint
          example: '{}'
        responseStatusCode:
          type: number
          description: HTTP status code of the response
          example: 200
        status:
          description: Status of the webhook attempt
          example: SUCCESS
          allOf:
            - $ref: '#/components/schemas/WebhookAttemptStatus'
        msgId:
          type: string
          description: Message ID
          example: msg_1srOrx2ZWZBpBUvZwXKQmoEYga2
        id:
          type: string
          description: Unique identifier for the attempt
          example: atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2
        timestamp:
          format: date-time
          type: string
          description: Timestamp when the attempt was made
          example: '2019-08-24T14:15:22Z'
        msg:
          description: Message details
          allOf:
            - $ref: '#/components/schemas/WebhookMessageDto'
      required:
        - url
        - response
        - responseStatusCode
        - status
        - msgId
        - id
        - timestamp
        - msg
    WebhookSendExampleDto:
      type: object
      properties:
        eventType:
          type: string
          description: The event type to send
          example: transaction.updated
      required:
        - eventType
    WebhookSendExampleResponseDto:
      type: object
      properties:
        messageId:
          type: string
          description: The message ID
          example: msg_1srOrx2ZWZBpBUvZwXKQmoEYga2
      required:
        - messageId
    CreateMachineToMachineClientTokenDto:
      type: object
      properties:
        grant_type:
          type: string
          description: >-
            The OAuth2.0 Grant Type that shall be used for authorization.
            Supported values: 'client_credentials'
          example: client_credentials
        client_id:
          type: string
          description: The client id of your OAuth2.0 machine-to-machine client
          example: ABCAAAAAAAAAAAAAAAAAAAAAAAAAA123
        client_secret:
          type: string
          description: The client secret of your OAuth2.0 machine-to-machine client
          example: supersecret
      required:
        - grant_type
        - client_id
        - client_secret
    GetMachineToMachineClientTokenDto:
      type: object
      properties:
        access_token:
          type: string
          description: >-
            The JSON Web Token to be used for authentication and authorization
            with the API. See access_token at
            https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 
        token_type:
          type: string
          description: >-
            See token_type at
            https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
          example: Bearer
        expires_in:
          type: number
          description: >-
            See expires_in at
            https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
          example: 86400
        scope:
          type: string
          description: >-
            See scope at
            https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
          example: create:example manage:users read:example
      required:
        - access_token
        - token_type
        - expires_in
    CreateUserInvitationDto:
      type: object
      properties:
        email:
          type: string
          example: user@example.com
          description: email of the person that should join your business
      required:
        - email
    UpdateUserInvitationDto:
      type: object
      properties:
        status:
          type: string
          example: CANCELLED
          description: |-
            The desired status of the invitation. 
                  Invitee can only update the status to ACCEPTED or REJECTED.
                  Sender can only update the status to CANCELLED.
      required:
        - status
    GetVersionDto:
      type: object
      properties:
        gitCommitSha:
          type: string
          description: Git commit sha of the currently deployed version
          example: b6f4598bd465a397190ceb2ba4d1be5d7f0a9621
      required:
        - gitCommitSha
    CreateAnalysesBatchDto:
      type: object
      properties:
        plotIds:
          example:
            - d70741c2-58ea-4a25-a4c3-c3d84b2571e9
            - e0e1afde-df46-4293-afee-66687ec99671
          description: List of plot ids for which analyses will be created
          maxItems: 1000
          minItems: 1
          uniqueItems: true
          type: array
          items:
            type: string
        type:
          example: EUFOROBS
          description: >-
            Type of analysis to be performed. Currently only EUFOROBS, PRECISION
            and OS are supported and only one type can be performed in a batch
            request.
          allOf:
            - $ref: '#/components/schemas/AnalysisType'
      required:
        - plotIds
        - type
    ResponseCreateAnalysesBatchDto:
      type: object
      properties:
        status:
          type: string
          description: It describes the overall result of the batch operation.
          example: PARTIAL_FAILURE
        errors:
          type: object
          description: Plot reference and error detail for failed Analyses.
          example:
            d70741c2-58ea-4a25-a4c3-c3d84b2571e9: some detailed error
        processed:
          type: object
          description: Plot reference and Analysis processed successfully.
          example:
            d70741c2-58ea-4a25-a4c3-c3d84b2571e9: |-
              {
                      "id": "02c36247-1aad-41ba-aa49-f114ca4c263f",
                      "status": "pending",
                      "type": "PRECISION"
                    }
      required:
        - status
        - errors
        - processed
    CreateAnalysisDto:
      type: object
      properties:
        name:
          type: string
          example: Some name for the analysis
          description: Human-friendly name of the analysis for reference
        type:
          example: EUFOROBS
          description: >-
            Type of analysis to be performed. Currently only EUFOROBS, PRECISION
            and OS are supported.
          allOf:
            - $ref: '#/components/schemas/AnalysisType'
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: |-
            Custom data related to the analysis.
                  This can be used to store any additional information that is relevant to the analysis.
                  The input object must fulfill the following requirements:
                    - max <=10 keys
                    - max key length of <=255 characters
                    - max string value length of <=255 characters
                    - values must be either strings, number, or booleans
                    - keys cannot contain the substrings __proto__, constructor, or prototype
                  
        metadata:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: |-
            Alias for customData. See customData for requirements.
                  This field is deprecated and will be removed in the future.
                  Please use customData instead.
          deprecated: true
      required:
        - type
    GetAnalysisResultDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of this analysis result
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        layerVersion:
          type: string
          example: jrc_gfc-v1
          description: The version of the layer that was used for this analysis result
        layerClass:
          type: string
          example: Forest cover, 2020
          description: The class of the layer that was used for this analysis result
        layerName:
          type: string
          example: Global Forest Types 2020
          description: The name of the layer that was used for this analysis result
        geometry:
          example:
            type: MultiPolygon
            coordinates:
              - - - 13
                  - 52.5
                - - 13.5
                  - 52.5
                - - 13.5
                  - 52
                - - 13
                  - 52
                - - 13
                  - 52.5
          description: >-
            The geometry is the overlap between the plot and the layer
            geometries
          oneOf:
            - $ref: '#/components/schemas/GetPolygonDto'
            - $ref: '#/components/schemas/GetMultiPolygonDto'
        overlapAreaSqm:
          type: number
          example: 10000
          description: The overlap area in square meters of the analysis result
        overlapPercentage:
          type: number
          example: 0.5
          description: The overlap percentage of the analysis result
      required:
        - id
        - createdAt
        - updatedAt
        - geometry
        - overlapAreaSqm
        - overlapPercentage
    GetAnalysisFullV2Dto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of this analysis
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        status:
          example: PENDING
          description: The overall status of the underlying analysis pipeline
          allOf:
            - $ref: '#/components/schemas/AnalysisStatus'
        plotId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the plot that this analysis belongs to and is performed on
        analysedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        type:
          example: OS
          description: The type of analysis that was requested
          allOf:
            - $ref: '#/components/schemas/AnalysisType'
        results:
          description: The results of the analysis
          type: array
          items:
            $ref: '#/components/schemas/GetAnalysisResultDto'
        customData:
          type: object
          example:
            some: metadata
          description: Additional custom data. We don't use it for any calculations.
        name:
          type: string
          description: A human-friendly name for this analysis
      required:
        - id
        - createdAt
        - updatedAt
        - status
        - plotId
        - type
        - results
    CreateBusinessInvitationDto:
      type: object
      properties:
        email:
          type: string
          example: user@example.com
          description: >-
            email of the user representing the business that this invitation is
            for
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a business invitation in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the business invitation.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - email
    UpdateBusinessInvitationDto:
      type: object
      properties:
        status:
          description: new status for this invitation
          allOf:
            - $ref: '#/components/schemas/BusinessInvitationStatus'
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: >-
            A customizable metadata field for storing additional information
            related to a business invitation in TradeAware.
                  This field allows customers to associate their own identifiers or data with TradeAware's system.

                  The `customData` field is returned unchanged and is visible only to the owners of the business invitation.

                  Constraints:
                    - Up to 10 keys per object
                    - Key length: Maximum 255 characters
                    - String value length: Maximum 255 characters
                    - Values must be of type: string, number, or boolean
                    - Nested objects are not allowed
                    - Keys cannot contain: '__proto__', 'constructor', or 'prototype'
                  
      required:
        - status
    CreateBatchBusinessInvitationDto:
      type: object
      properties:
        invitations:
          description: >-
            Array of business invitations to create. Can be sent as a direct
            array for backwards compatibility or as an object with invitations
            property.
          example:
            - email: user1@example.com
              customData:
                key1: value1
            - email: user2@example.com
              customData:
                key2: value2
          type: array
          items:
            $ref: '#/components/schemas/CreateBusinessInvitationDto'
      required:
        - invitations
    TransactionStatus:
      type: string
      enum:
        - DRAFT
        - SUBMITTED
        - AVAILABLE
        - WITHDRAWN
        - TO_SUBMIT
        - PROCESSING
        - ERROR
        - REJECTED
      description: Status of this transaction.
    GetTransactionDdsDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of DDS entity
        submitted:
          type: boolean
          example: false
          description: Whether the DDS has been submitted to Traces
        submittedAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        tracesDdsReferenceNumber:
          type: string
          example: 25DEPPQEM17212
          description: Traces DDS reference number
        tracesDdsVerificationNumber:
          type: string
          example: KZ4BVOCZ
          description: Traces DDS verification number
        errors:
          example:
            - Error message
          description: Array of error messages extracted from Traces API response structure
          type: array
          items:
            type: string
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
      required:
        - id
        - submitted
        - createdAt
        - updatedAt
    GetLegalEntityDto:
      type: object
      properties:
        name:
          type: string
          example: Example Palm Oil Trader
          description: Business's name
        email:
          type: object
          example: user@example.com
          description: email of the contact person in the business
          nullable: true
        addressCity:
          type: string
          example: West Papua
          description: City of the business's address
        addressCountryCode:
          type: string
          example: ID
          description: Two-letter country code (ISO 3166 Alpha-2) of the business's address
        addressLine1:
          type: string
          example: Salawati 123
          description: First line of the business address
        addressLine2:
          type: object
          example: 2nd floor
          description: Second line of the business address
          nullable: true
        addressPostcode:
          type: string
          example: '12345'
          description: Country-specific postcode of the business's address
        eori:
          type: object
          description: EORI number of the business
          nullable: true
        vat:
          type: object
          example: 1234567890asdfghjk
          description: VAT number of the business
          nullable: true
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: id of this entity
        createdAt:
          format: date-time
          type: string
          example: '2021-01-01T00:00:00.000Z'
          description: ISO 8601
        updatedAt:
          format: date-time
          type: string
          example: '2021-01-01T00:00:00.000Z'
          description: ISO 8601
      required:
        - name
        - addressCity
        - addressCountryCode
        - addressLine1
        - addressLine2
        - addressPostcode
        - id
        - createdAt
        - updatedAt
    GetTransactionDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        status:
          example: DRAFT
          description: Status of this transaction.
          allOf:
            - $ref: '#/components/schemas/TransactionStatus'
        customId:
          type: string
          description: >-
            Custom identifier. Can be used for internal reference or tracking
            purposes.
          example: DEC-24-238620
        activityType:
          type: string
          example: EXPORT
          description: Type of transaction to be performed.
        countryOfActivity:
          type: string
          example: IT
          description: >-
            Two-letter country code (ISO 3166 Alpha-2) of the place of activity.
            Depends on activityType. For import, Country of entry into the EU.
            For Export, Country of exit from the EU. For Domestic Production and
            Trade, EU country where goods are sourced, manufactured or produced
            or made available on the market.
        isGeoLocationConfidential:
          type: boolean
          example: 'false'
          description: Whether the geolocation data is confidential.
        components:
          type: array
          items:
            $ref: '#/components/schemas/GetComponentDto'
          description: The components of the transaction.
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: |-
            Metadata related to the transaction. 
                  This can be used to store any additional information that is relevant to the transaction.
                  The input object must fulfill the following requirements:
                    - max <=10 keys
                    - max key length of <=255 characters
                    - max string value length of <=255 characters
                    - values must be either strings, number, or booleans
                    - keys cannot contain the substrings __proto__, constructor, or prototype
                  
        dds:
          description: Due diligence statement details
          allOf:
            - $ref: '#/components/schemas/GetTransactionDdsDto'
        legalEntity:
          description: >-
            The legal entity containing company details (name, address, EORI,
            etc.) that will be used as the primary actor for this transaction
            when submitting to EU Information System.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetLegalEntityDto'
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
      required:
        - id
        - status
        - customId
        - activityType
        - countryOfActivity
        - isGeoLocationConfidential
        - components
        - legalEntity
        - createdAt
        - updatedAt
    CreateTransactionDto:
      type: object
      properties:
        customId:
          type: string
          description: >-
            Custom identifier. Can be used for internal reference or tracking
            purposes. If not provided, generates a default Id
          example: DEC-24-238620
        activityType:
          type: string
          example: EXPORT
          description: >-
            Type of transaction to be performed. Can be one of: IMPORT, EXPORT,
            DOMESTIC, TRADE.
        countryOfActivity:
          type: string
          example: IT
          description: >-
            Two-letter country code (ISO 3166 Alpha-2) of the place of activity.
            Depends on activityType. For import, Country of entry into the EU.
            For Export, Country of exit from the EU. For Domestic Production and
            Trade, EU country where goods are sourced, manufactured or produced
            or made available on the market.
        legalEntityId:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: >-
            The id of the legal entity containing company details (name,
            address, EORI, etc.) that will be used as the primary actor for this
            transaction when submitting to EU Information System.
        components:
          type: array
          description: The components of the transaction.
          items:
            $ref: '#/components/schemas/CreateTransactionComponentDto'
        isGeoLocationConfidential:
          type: boolean
          example: 'false'
          default: false
          description: Whether the geolocation data is confidential.
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: |-
            Metadata related to the transaction. 
                  This can be used to store any additional information that is relevant to the transaction.
                  The input object must fulfill the following requirements:
                    - max <=50 keys
                    - max key length of <=255 characters
                    - max string value length of <=255 characters
                    - values must be either strings, number, or booleans
                    - keys cannot contain the substrings __proto__, constructor, or prototype
                  
        status:
          default: DRAFT
          description: >-
            The status this transaction response is created in. Must be DRAFT if
            provided.
          allOf:
            - $ref: '#/components/schemas/TransactionStatus'
      required:
        - activityType
        - countryOfActivity
        - components
    UpdateTransactionDto:
      type: object
      properties:
        countryOfActivity:
          type: string
          example: IT
          description: >-
            Two-letter country code (ISO 3166 Alpha-2) of the place of activity.
            Depends on activityType. For import, Country of entry into the EU.
            For Export, Country of exit from the EU. For Domestic Production and
            Trade, EU country where goods are sourced, manufactured or produced
            or made available on the market.
        legalEntityId:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: >-
            The id of the legal entity containing company details (name,
            address, EORI, etc.) that will be used as the primary actor for this
            transaction when submitting to EU Information System.
        customData:
          type: object
          example:
            key1: someValue
            key2: true
            key3: 1234
          description: |-
            Metadata related to the transaction. 
                  This can be used to store any additional information that is relevant to the transaction.
                  The input object must fulfill the following requirements:
                    - max <=50 keys
                    - max key length of <=255 characters
                    - max string value length of <=255 characters
                    - values must be either strings, number, or booleans
                    - keys cannot contain the substrings __proto__, constructor, or prototype
                  
        isGeoLocationConfidential:
          type: boolean
          example: 'false'
          description: Whether the geolocation data is confidential.
        customId:
          type: string
          description: >-
            Custom identifier. Can be used for internal reference or tracking
            purposes.
          example: DEC-24-238620
    Unit:
      type: string
      enum:
        - LTR
        - MTR
        - MTRSQR
        - MTRCUBE
        - KGM
        - TNE
        - PCS
        - PR
        - SET
        - PKG
      description: Measurement unit of the product quantity.
    ComponentNamePairDto:
      type: object
      properties:
        commonName:
          type: object
          description: The common name of the product.
          example: soybean
          nullable: true
        scientificName:
          type: object
          description: The scientific name of the product.
          example: Glycine max
          nullable: true
      required:
        - commonName
        - scientificName
    DdsReferenceDto:
      type: object
      properties:
        id:
          type: string
          description: Reference number of the Due Diligence Statement.
          example: 24DKYIGLPU3439
        verificationNumber:
          type: string
          description: Verification number of the Due Diligence Statement.
          example: 4NAB3QYM
      required:
        - id
        - verificationNumber
    GetComponentDto:
      type: object
      properties:
        id:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: id of this entity
        hsn:
          type: string
          example: '18010000'
          description: HS Code of the product.
        commodity:
          description: Commodity of the product.
          example: oil palm
          allOf:
            - $ref: '#/components/schemas/Commodity'
        quantity:
          type: number
          description: Quantity of the product, measured in the specified unit.
          example: 123.45
        unit:
          description: Measurement unit of the product quantity.
          example: KGM
          allOf:
            - $ref: '#/components/schemas/Unit'
        description:
          type: string
          description: Short description of the product.
        namePairs:
          description: The common and scientific names of the product.
          type: array
          items:
            $ref: '#/components/schemas/ComponentNamePairDto'
        transactionId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the transaction that this component belongs to
        dateOfProduction:
          type: string
          description: |-
            ISO 8601. The time at which the product was produced., 
                    Can be a time range if endDateOfProduction is specified.
          example: '2021-01-01T00:00:00.000Z'
        endDateOfProduction:
          type: string
          description: ISO 8601. The time at which a time-ranged production was finalized.
          example: '2021-01-01T00:00:00.000Z'
        createdAt:
          type: string
          example: '2023-07-26T15:03:48Z'
          description: ISO 8601
        updatedAt:
          type: string
          example: '2023-07-28T09:13:37Z'
          description: ISO 8601
        supplierBusiness:
          description: Supplier business of this product
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
        supplierBusinesses:
          description: Supplier businesses of this product
          type: array
          items:
            $ref: '#/components/schemas/GetBusinessDto'
        plotIds:
          description: Ids of the plots associated with this component.
          example:
            - 02c36247-1aad-41ba-aa49-f114ca4c263f
            - 02c36247-1aad-41ba-aa49-f114ca4c263f
          type: array
          items:
            type: string
        ddsReferences:
          description: Identifiers of the upstream DDS references.
          example:
            - id: 24DKYIGLPU3439
              verificationNumber: 4NAB3QYM
          type: array
          items:
            $ref: '#/components/schemas/DdsReferenceDto'
      required:
        - id
        - hsn
        - commodity
        - quantity
        - unit
        - description
        - namePairs
        - transactionId
        - createdAt
        - updatedAt
        - ddsReferences
    UpdateComponentDto:
      type: object
      properties:
        hsn:
          type: string
          example: '1201'
          description: >-
            HS Code of the product. The HS code consists of at least six digits
            and is used by customs to classify the product being shipped.
        quantity:
          type: number
          description: Quantity of the product, measured in the specified unit.
          example: 123.45
        unit:
          description: >-
            Measurement unit of the product quantity. Can be one of: LTR, MTR,
            MTRSQR, MTRCUBE, KGM, TNE, PCS, PR, SET, PKG.
          example: KGM
          allOf:
            - $ref: '#/components/schemas/Unit'
        description:
          type: string
          description: Short description of the product.
        namePairs:
          description: The name pairs of the product.
          example:
            - commonName: soybean
              scientificName: Glycine max
            - commonName: edamame
              scientificName: Glycine max var. viridis
          default: []
          type: array
          items:
            $ref: '#/components/schemas/ComponentNamePairDto'
        dateOfProduction:
          type: string
          description: |-
            ISO 8601. The time at which the product was produced.,
                    For time ranges, also specify the endDateOfProduction.
          example: '2021-01-01T00:00:00.000Z'
        endDateOfProduction:
          type: string
          description: ISO 8601. The time at which a time-ranged production was finalized.
          example: '2022-01-01T00:00:00.000Z'
        supplierBusinessId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the supplier business for the transaction.
        supplierBusinessIds:
          example:
            - 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Ids of the supplier businesses for the transaction.
          type: array
          items:
            type: string
        plotIds:
          description: >-
            A list of plot IDs to be associated with this component. Omit this
            field to attach all plots of the supplier business.
          example:
            - a78c1a68-d326-4217-a131-893f3c47a064
            - e8d2e3e6-2c7c-4c4e-98a9-3e3f4e2c1a68
          type: array
          items:
            type: string
        ddsReferences:
          description: Identifiers of the upstream DDS references.
          example:
            - id: 24DKYIGLPU3439
              verificationNumber: 4NAB3QYM
          type: array
          items:
            $ref: '#/components/schemas/DdsReferenceDto'
    CreateTransactionComponentDto:
      type: object
      properties:
        hsn:
          type: string
          example: '1201'
          description: >-
            HS Code of the product. The HS code consists of at least six digits
            and is used by customs to classify the product being shipped.
        quantity:
          type: number
          description: Quantity of the product, measured in the specified unit.
          example: 123.45
        unit:
          description: >-
            Measurement unit of the product quantity. Can be one of: LTR, MTR,
            MTRSQR, MTRCUBE, KGM, TNE, PCS, PR, SET, PKG.
          example: KGM
          allOf:
            - $ref: '#/components/schemas/Unit'
        description:
          type: string
          description: Short description of the product.
        namePairs:
          description: The name pairs of the product.
          example:
            - commonName: soybean
              scientificName: Glycine max
            - commonName: edamame
              scientificName: Glycine max var. viridis
          default: []
          type: array
          items:
            $ref: '#/components/schemas/ComponentNamePairDto'
        dateOfProduction:
          type: string
          description: |-
            ISO 8601. The time at which the product was produced.,
                    For time ranges, also specify the endDateOfProduction.
          example: '2021-01-01T00:00:00.000Z'
        endDateOfProduction:
          type: string
          description: ISO 8601. The time at which a time-ranged production was finalized.
          example: '2022-01-01T00:00:00.000Z'
        supplierBusinessId:
          type: string
          example: 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Id of the supplier business for the transaction.
        supplierBusinessIds:
          example:
            - 02c36247-1aad-41ba-aa49-f114ca4c263f
          description: Ids of the supplier businesses for the transaction.
          type: array
          items:
            type: string
        plotIds:
          description: >-
            A list of plot IDs to be associated with this component. Omit this
            field to attach all plots of the supplier business.
          example:
            - a78c1a68-d326-4217-a131-893f3c47a064
            - e8d2e3e6-2c7c-4c4e-98a9-3e3f4e2c1a68
          type: array
          items:
            type: string
        ddsReferences:
          description: Identifiers of the upstream DDS references.
          example:
            - id: 24DKYIGLPU3439
              verificationNumber: 4NAB3QYM
          type: array
          items:
            $ref: '#/components/schemas/DdsReferenceDto'
      required:
        - hsn
        - quantity
        - unit
        - description
    CreateLegalEntityDto:
      type: object
      properties:
        name:
          type: string
          example: Example Palm Oil Trader
          description: Business's name
        email:
          type: object
          example: user@example.com
          description: email of the contact person in the business
          nullable: true
        addressCity:
          type: string
          example: West Papua
          description: City of the business's address
        addressCountryCode:
          type: string
          example: ID
          description: Two-letter country code (ISO 3166 Alpha-2) of the business's address
        addressLine1:
          type: string
          example: Salawati 123
          description: First line of the business address
        addressLine2:
          type: object
          example: 2nd floor
          description: Second line of the business address
          nullable: true
        addressPostcode:
          type: string
          example: '12345'
          description: Country-specific postcode of the business's address
        eori:
          type: object
          description: EORI number of the business
          nullable: true
        vat:
          type: object
          example: 1234567890asdfghjk
          description: VAT number of the business
          nullable: true
      required:
        - name
        - addressCity
        - addressCountryCode
        - addressLine1
        - addressLine2
        - addressPostcode
    UpdateLegalEntityDto:
      type: object
      properties:
        name:
          type: string
          example: Example Palm Oil Trader
          description: Business's name
        email:
          type: object
          example: user@example.com
          description: email of the contact person in the business
          nullable: true
        addressCity:
          type: string
          example: West Papua
          description: City of the business's address
        addressCountryCode:
          type: string
          example: ID
          description: Two-letter country code (ISO 3166 Alpha-2) of the business's address
        addressLine1:
          type: string
          example: Salawati 123
          description: First line of the business address
        addressLine2:
          type: object
          example: 2nd floor
          description: Second line of the business address
          nullable: true
        addressPostcode:
          type: string
          example: '12345'
          description: Country-specific postcode of the business's address
        eori:
          type: object
          description: EORI number of the business
          nullable: true
        vat:
          type: object
          example: 1234567890asdfghjk
          description: VAT number of the business
          nullable: true
    GetPlotRiskAssessmentDto:
      type: object
      properties:
        id:
          type: string
          description: The ID of the plot risk assessment
          example: 123e4567-e89b-12d3-a456-426614174000
        status:
          description: The status of the plot risk assessment
          example: NEW
          default: NEW
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        notes:
          type: string
          description: The notes of the plot risk assessment
          example: This is a note
          maxLength: 1000
        createdAt:
          format: date-time
          type: string
          description: The date and time the plot risk assessment was created
          example: '2023-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time the plot risk assessment was updated
          example: '2023-01-01T00:00:00.000Z'
        plotId:
          type: string
          description: The ID of the plot assessed by the buyer
          example: 123e4567-e89b-12d3-a456-426614174000
        businessId:
          type: string
          description: The ID of the business assessing the plot risk
          example: 123e4567-e89b-12d3-a456-426614174000
        plot:
          description: The plot assessed by the buyer
          allOf:
            - $ref: '#/components/schemas/GetPlotBaseDto'
        business:
          description: The business assessing the plot risk
          allOf:
            - $ref: '#/components/schemas/GetBusinessDto'
      required:
        - id
        - status
        - createdAt
        - updatedAt
        - plotId
        - businessId
    UpdatePlotRiskAssessmentDto:
      type: object
      properties:
        status:
          default: NEW
          description: The status of the plot risk assessment
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        notes:
          type: string
          maxLength: 1000
          description: The notes of the plot risk assessment
    GetHistoryEntryGetPlotRiskAssessmentDto:
      type: object
      properties:
        entityId:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Id of this entity
        changedByUserType:
          description: The type of the user that did the change. Can be USER, M2M, SYSTEM.
          allOf:
            - $ref: '#/components/schemas/UserType'
        changedByUser:
          nullable: true
          description: User that triggered the change.
          allOf:
            - $ref: '#/components/schemas/GetUserDto'
        action:
          description: The type of the action. Can be CREATE, UPDATE, DELETE.
          allOf:
            - $ref: '#/components/schemas/ActionType'
        changedAt:
          type: string
          example: '2020-01-01T00:00:00.000Z'
          description: date this entity was last updated
        beforeData:
          description: The entity before the change was made.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
        afterData:
          description: The entity after the change was made.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GetPlotRiskAssessmentDto'
      required:
        - entityId
        - changedByUserType
        - changedByUser
        - action
        - changedAt
        - beforeData
        - afterData
    CreatePlotRiskAssessmentDto:
      type: object
      properties:
        status:
          default: NEW
          description: The status of the plot risk assessment
          allOf:
            - $ref: '#/components/schemas/PlotRiskAssessmentStatus'
        notes:
          type: string
          maxLength: 1000
          description: The notes of the plot risk assessment
security:
  - bearer: []
