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

# Set a broker deal's outcome



## OpenAPI

````yaml https://app.herondata.io/swagger put /api/broker/end_users/{end_user_id_or_heron_id}/outcome
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/broker/end_users/{end_user_id_or_heron_id}/outcome:
    put:
      tags:
        - Brokers
      summary: Set a broker deal's outcome
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrokerDealOutcomeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrokerDealOutcomeResponse'
          description: OK
        '404':
          description: Not found
        '422':
          description: Invalid deal outcome
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BrokerDealOutcomeRequest:
      properties:
        funded_offer_heron_id:
          nullable: true
          type: string
        funded_offer_terms:
          allOf:
            - $ref: '#/components/schemas/BrokerFundedOfferTerms'
          nullable: true
        outcome:
          enum:
            - funded
            - closed
        reason:
          nullable: true
          type: string
      required:
        - outcome
      type: object
    BrokerDealOutcomeResponse:
      properties:
        deal_stage:
          enum:
            - ready
            - missing_docs
            - shopped
            - offers_in
            - funded
            - closed
        funded_offer_heron_id:
          nullable: true
          readOnly: true
          type: string
      type: object
    BrokerFundedOfferTerms:
      properties:
        buy_rate:
          anyOf:
            - nullable: true
              type: number
            - format: decimal
              nullable: true
              type: string
        commission_percent:
          anyOf:
            - nullable: true
              type: number
            - format: decimal
              nullable: true
              type: string
        factor_rate:
          anyOf:
            - nullable: true
              type: number
            - format: decimal
              nullable: true
              type: string
        funded_amount:
          anyOf:
            - type: number
            - format: decimal
              type: string
        payment_amount:
          anyOf:
            - nullable: true
              type: number
            - format: decimal
              nullable: true
              type: string
        payment_frequency:
          enum:
            - daily
            - weekly
            - biweekly
            - monthly
            - null
          nullable: true
          type: string
        term_length:
          anyOf:
            - nullable: true
              type: number
            - format: decimal
              nullable: true
              type: string
        term_unit:
          enum:
            - days
            - weeks
            - months
            - null
          nullable: true
          type: string
      required:
        - funded_amount
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.