openapi: 3.0.4
info:
  title: Talli Campaign Manager API
  description: >-
    The Talli Campaign Manager API provides programmatic access to create and
    manage payout campaigns, 

    payout instructions, and reports. This API powers the Talli console
    interface and can be integrated with 

    third-party systems to automate workflows.


    ## Key Resources


    - **Campaigns**: Create and manage fund distribution campaigns.

    - **Campaign drafts**: Create and manage campaign drafts.

    - **Payout Instructions**: Send and track payments to beneficiaries.

    - **Payout Methods**: View available payment methods (PayPal, ACH, gift
    cards, etc.).

    - **Payouts**: Details about selected payout 
      - Gift Cards: View details of a gift card requested by the beneficiary
      - Prepaid Cards: View details of a prepaid card requested by the beneficiary
      - Transfers: View details of Paypal, Venmo or ACH transfer requested by the beneficiary 
    - **Reports**: Access analytics and statistics about campaign performance.

    - **Funding sources**: Create and manage funding sources.

    - **Templates**: Create and manage templates.


    ## Authentication


    All requests require OAuth 2.0 authentication using Auth0 with appropriate
    scopes.
  contact:
    name: Talli API Support
    email: api-support@talli.ai
  license:
    name: Proprietary and Confidential
  version: v2
paths:
  /v2/campaign-manager/ach-transfers/{id}:
    get:
      tags:
        - ach-transfers
      summary: Get ACH Transfer
      description: >-
        Retrieves an ACH transfer by its unique identifier. Returns 404 if no
        valid transfer is found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.ACHTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/ach-transfers:
    get:
      tags:
        - ach-transfers
      summary: Get ACH Transfer by Payout Instruction ID
      description: >-
        Retrieves an ACH transfer by its associated payout instruction ID.
        Returns 404 if no valid transfer is found for the given payout
        instruction.
      parameters:
        - name: payoutInstructionId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.ACHTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/campaign-drafts:
    post:
      tags:
        - campaign-drafts
      summary: Create Campaign Draft
      description: >-
        Creates a new campaign draft. All fields are optional as drafts can be
        saved in incomplete state.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                fundingSourceId:
                  type: string
                  format: uuid
                welcomeHeadline:
                  type: string
                campaignDescription:
                  type: string
                campaignManager:
                  type: string
                welcomeText:
                  type: string
                iconFile:
                  type: string
                  format: binary
                payoutMethodIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                expiryDate:
                  type: string
                  format: date
                displayEndDate:
                  type: string
                  format: date
                validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
                  type: boolean
            encoding:
              name:
                style: form
              fundingSourceId:
                style: form
              welcomeHeadline:
                style: form
              campaignDescription:
                style: form
              campaignManager:
                style: form
              welcomeText:
                style: form
              iconFile:
                style: form
              payoutMethodIds:
                style: form
              expiryDate:
                style: form
              displayEndDate:
                style: form
              validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
                style: form
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignDraftResponse
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:create
  /v2/campaign-manager/campaign-drafts/{id}:
    get:
      tags:
        - campaign-drafts
      summary: Get Campaign Draft
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignDraftResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:view
    patch:
      tags:
        - campaign-drafts
      summary: Patch Campaign Draft
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Json.Patch.JsonPatch'
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:edit
  /v2/campaign-manager/campaign-drafts/{id}/campaign-icon:
    patch:
      tags:
        - campaign-drafts
      summary: Update Campaign Draft Icon
      description: Updates the icon for an existing campaign draft.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iconFile:
                  type: string
                  format: binary
            encoding:
              iconFile:
                style: form
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:edit
  /v2/campaign-manager/campaign-drafts/{id}/:promote:
    post:
      tags:
        - campaign-drafts
      summary: Promote Campaign Draft to Campaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:create
  /v2/campaign-manager/campaigns:
    get:
      tags:
        - campaigns
      summary: Get Campaigns
      description: >-
        Retrieves a paginated list of campaigns, optionally filtered by a payout
        instruction ID.

        To include details about total funds received and statistics on the
        statuses of the payout instructions, use 'includeDetails' flag.
      parameters:
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
            default: 1
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
            default: 20
        - name: payoutInstructionId
          in: query
          schema:
            type: string
            format: uuid
        - name: includeDetails
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.Campaigns.CampaignWithDetailsResponse]
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:view
    post:
      tags:
        - campaigns
      summary: Create Campaign
      description: Creates a new campaign with the specified data.
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - fundingSourceId
                - name
                - payoutMethodIds
              type: object
              properties:
                name:
                  type: string
                welcomeHeadline:
                  type: string
                campaignDescription:
                  type: string
                welcomeText:
                  type: string
                campaignManager:
                  type: string
                iconFile:
                  type: string
                  format: binary
                payoutMethodIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                expiryDate:
                  type: string
                  format: date
                displayEndDate:
                  type: string
                  format: date
                validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
                  type: boolean
                fundingSourceId:
                  type: string
                  format: uuid
            encoding:
              name:
                style: form
              welcomeHeadline:
                style: form
              campaignDescription:
                style: form
              welcomeText:
                style: form
              campaignManager:
                style: form
              iconFile:
                style: form
              payoutMethodIds:
                style: form
              expiryDate:
                style: form
              displayEndDate:
                style: form
              validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
                style: form
              fundingSourceId:
                style: form
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:create
  /v2/campaign-manager/campaigns/{id}:
    patch:
      tags:
        - campaigns
      summary: Patch Campaign
      description: |-
        Patches an existing campaign with the provided data.
        Note: The icon needs to be patched separately.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Json.Patch.JsonPatch'
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:edit
    get:
      tags:
        - campaigns
      summary: Get Campaign
      description: Retrieves a single campaign based on provided identifier
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignResponse
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:view
  /v2/campaign-manager/campaigns/{id}/campaign-icon:
    patch:
      tags:
        - campaigns
      summary: Patch Campaign icon
      description: Patches an existing campaign with the provided icon file.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                iconFile:
                  type: string
                  format: binary
            encoding:
              iconFile:
                style: form
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:edit
  /v2/campaign-manager/campaigns/{id}/payout-instructions/:upload:
    post:
      tags:
        - campaigns
      summary: Upload a file with payout instructions
      description: >-
        Uploads a file with payout instructions to the given campaign. The
        maximum size of the file is 262144000 bytes
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  format: binary
            encoding:
              file:
                style: form
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:create
            - payoutInstructions:update
  /v2/campaign-manager/campaigns/{id}/payout-instructions/:send-reminder:
    post:
      tags:
        - campaigns
      summary: Send reminders for given campaign
      description: >-
        Sends reminders for a given campaign.

        The endpoint allows send reminders either to the specified list of IDs
        or to payout instructions in the specified statuses.

        If neither of the above is specified, reminders will be sent to the
        payout instructions that have not been excluded, requested or fulfilled.

        If the list of ids is specified, you can also schedule the sending
        window with the 'distributionPeriodInSeconds' parameter.

        The schedule window will be automatically calculated based on the number
        of payout instructions found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.App.Models.Requests.SendCampaignRemindersRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponse
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - campaigns:sendReminders
  /v2/campaign-manager/funding-sources:
    get:
      tags:
        - funding-sources
      summary: List Funding Sources
      description: |-
        Retrieves a paginated list of funding sources for the organization. 
                        Funding sources represent accounts that can be used to fund campaigns, 
                        including the primary organization account and settlement funds.
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            default: 1
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
            default: 20
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.FundingSource.FundingSourceResponse]
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - fundingSources:view
    post:
      tags:
        - funding-sources
      summary: Create Settlement Fund
      description: |-
        Creates a new settlement fund (FBO account) for the organization. 
                        The settlement fund inherits business details from the organization's primary account 
                        and requires a settlement fund name plus optional supporting documents.
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Talli.Api.Contracts.FundingSource.CreateSettlementFundRequest
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.FundingSource.FundingSourceResponse
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - fundingSources:manage
  /v2/campaign-manager/funding-sources/{id}:
    get:
      tags:
        - funding-sources
      summary: Get Funding Source
      description: |-
        Retrieves a specific funding source by its unique identifier. 
                        Returns the funding source details including banking information and current status.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.FundingSource.FundingSourceResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - fundingSources:view
  /v2/campaign-manager/gift-cards/{id}:
    get:
      tags:
        - gift-cards
      summary: Get Gift Card
      description: >-
        Retrieves a gift card by its unique identifier. Returns 404 if there is
        no valid card.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.GiftCards.Contracts.Responses.CampaignManager.GiftCardResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/gift-cards:
    get:
      tags:
        - gift-cards
      summary: Get Gift Card by Payout Instruction ID
      description: >-
        Retrieves a gift card by its associated payout instruction ID. Returns
        404 if no valid card is found for the given payout instruction.
      parameters:
        - name: payoutInstructionId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.GiftCards.Contracts.Responses.CampaignManager.GiftCardResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/payout-instructions:
    get:
      tags:
        - payout-instructions
      summary: Get Payout Instructions
      description: >-
        Retrieves a paginated list of payout instructions, optionally filtered
        by campaign id, status, external id, or email. 
                        A payout instruction represents an intention to pay a specific amount of money to a beneficiary and is associated with exactly one campaign.
      parameters:
        - name: campaignId
          in: query
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          schema:
            $ref: >-
              #/components/schemas/Talli.Campaigns.Contracts.PayoutInstructionStatus
        - name: externalId
          in: query
          schema:
            type: string
        - name: email
          in: query
          schema:
            type: string
        - name: pageNumber
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.PayoutInstructions.PayoutInstructionResponse]
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:view
    post:
      tags:
        - payout-instructions
      summary: Create Payout Instruction
      description: >-
        Creates a new payout instruction with the specified campaign and
        recipient details. 
                        Note that creating a payout instruction does not automatically send it to the beneficiary or allocate funds; it only records the intention to pay. 
                        The payout instruction must be explicitly initiated in a separate step to notify the beneficiary.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.Api.Contracts.PayoutInstructions.CreatePayoutInstructionV2Request
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:create
  /v2/campaign-manager/payout-instructions/{id}:
    get:
      tags:
        - payout-instructions
      summary: Get Payout Instruction
      description: |-
        Retrieves a single payout instruction based on provided identifier. 
                        Creating a payout instruction does not automatically distribute funds to the beneficiary; it requires subsequent initiation.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.PayoutInstructions.PayoutInstructionResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:view
    patch:
      tags:
        - payout-instructions
      summary: Update Payout Instruction
      description: >-
        Patches an existing payout instruction with the provided data.

        Note: This operation might be pefrormed only for payout instructions
        that have not been redeemed or requested.

        Note2: If the email is changed then the previous links get invalidated
        and the payout instruction moves back to Restored status.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Json.Patch.JsonPatch'
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:update
  /v2/campaign-manager/payout-instructions/{id}/activity:
    get:
      tags:
        - payout-instructions
      summary: Get Payout Instruction Activity
      description: >-
        Retrieves the complete activity history for a specific payout
        instruction, including status changes, notifications sent, and actions
        performed by both administrators and beneficiaries.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/Talli.Api.Contracts.PayoutInstructions.PayoutInstructionActivityResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:view
  /v2/campaign-manager/payout-instructions/{id}/payout:
    get:
      tags:
        - payout-instructions
      summary: Get Payout Instruction Payout
      description: |-
        Retrieves the payout details for a specific payout instruction. 
                        A payout is created when a beneficiary acts on a payout instruction and selects a specific payout method to receive their funds. 
                        The payout contains additional details specific to the chosen method, such as gift card identifiers or transaction references.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.PayoutInstructions.PayoutInstructionPayoutResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:view
  /v2/campaign-manager/payout-instructions/{id}/:initiate:
    post:
      tags:
        - payout-instructions
      summary: Initiate Payout Instruction
      description: >-
        Initiates the payout process for a specific payout instruction using the
        specified notification channel. 
                        This action allocates funds from the associated campaign to this payout instruction and sends the initial notification to the beneficiary, allowing them to claim their funds.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.Api.Contracts.InitiatePayoutInstructionRequest
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:initiate
  /v2/campaign-manager/payout-instructions/{id}/:cancel:
    post:
      tags:
        - payout-instructions
      summary: Cancel Payout Instruction
      description: >-
        Cancels a specific payout instruction with the provided cancellation
        reason. 
                        This halts the payout process and prevents the beneficiary from claiming the funds. 
                        If funds were already allocated, they will be returned to the campaign budget.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.App.Models.Requests.CancelPayoutInstructionRequest
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:cancel
  /v2/campaign-manager/payout-instructions/{id}/:try-restore:
    post:
      tags:
        - payout-instructions
      summary: Try Restore Payout Instruction
      description: >-
        Attempts to restore a payout instruction when a payment was requested
        but not successfully processed (e.g., a PayPal transfer that the
        beneficiary hasn't accepted). 
                        This action attempts to cancel the pending external payout and return the beneficiary to a state where they can select a different payout method and process their payout again.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:tryRestore
  /v2/campaign-manager/payout-instructions/{id}/:send-reminder:
    post:
      tags:
        - payout-instructions
      summary: Send Payout Instruction Reminder
      description: >-
        Sends a reminder notification to the beneficiary about their pending
        payout instruction. 
                        This can be used when a beneficiary has not claimed their funds after the initial notification was sent.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.App.Models.Requests.SendPayoutInstructionReminderRequest
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutInstructions:sendReminder
  /v2/campaign-manager/payout-methods:
    get:
      tags:
        - payout-methods
      summary: Get Payout Methods
      description: >-
        Retrieves the list of available payout methods that can be used to
        distribute funds to beneficiaries. 
                        Each payout method represents a different way for beneficiaries to receive their funds, such as gift cards, 
                        bank transfers, or digital payment options.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/Talli.Api.Contracts.PayoutMethodResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/payout-methods/{id}:
    get:
      tags:
        - payout-methods
      summary: Get Payout Method
      description: |-
        Retrieves a specific payout method by its unique identifier. 
                        This endpoint provides detailed information about a single payout method, 
                        including its name, category, requirements, and transaction limits.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Talli.Api.Contracts.PayoutMethodResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/paypal-transfers/{id}:
    get:
      tags:
        - paypal-transfers
      summary: Get PayPal Transfer
      description: >-
        Retrieves a PayPal transfer by its unique identifier. Returns 404 if no
        valid transfer is found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.PayPalTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/paypal-transfers:
    get:
      tags:
        - paypal-transfers
      summary: Get PayPal Transfer by Payout Instruction ID
      description: >-
        Retrieves a PayPal transfer by its associated payout instruction ID.
        Returns 404 if no valid transfer is found for the given payout
        instruction.
      parameters:
        - name: payoutInstructionId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.PayPalTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/prepaid-cards/{id}:
    get:
      tags:
        - prepaid-cards
      summary: Get Prepaid Card
      description: >-
        Retrieves a prepaid card by its unique identifier. Returns 404 if no
        valid card is found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.PrepaidCards.Contracts.Responses.Beneficiary.PrepaidCardResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/prepaid-cards:
    get:
      tags:
        - prepaid-cards
      summary: Get Prepaid Card by Payout Instruction ID
      description: >-
        Retrieves a prepaid card by its associated payout instruction ID.
        Returns 404 if no valid card is found for the given payout instruction.
      parameters:
        - name: payoutInstructionId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.PrepaidCards.Contracts.Responses.Beneficiary.PrepaidCardResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/reports/campaigns/{campaignId}/payout-methods:
    get:
      tags:
        - reports
      summary: Get Campaign Payout Methods Report
      description: >-
        Retrieves a report detailing the distribution of payout methods selected
        by beneficiaries for a specific campaign.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Reporting.PayoutMethodsReportResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - reports:view
  /v2/campaign-manager/reports/campaigns/{campaignId}/conversion:
    get:
      tags:
        - reports
      summary: Get Campaign Conversion Report
      description: >-
        Retrieves a report analyzing conversion metrics for a specific campaign,
        including notification delivery and payout claim rates.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Reporting.ConversionReportResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - reports:view
  /v2/campaign-manager/reports/campaigns/{campaignId}/statistics:
    get:
      tags:
        - reports
      summary: Get Campaign Statistics Report
      description: >-
        Retrieves comprehensive statistics for a specific campaign, including
        overall performance metrics, budget utilization, and timeline analysis.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Reporting.CampaignStatisticsReportResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - reports:view
  /v2/campaign-manager/reports/campaigns/{campaignId}/payouts-history:
    get:
      tags:
        - reports
      summary: Get Campaign Payouts History Report
      description: >-
        Retrieves a historical record of all payouts processed for a specific
        campaign, including timestamps, amounts, and status changes.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Reporting.PayoutsHistoryReportResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - reports:view
  /v2/campaign-manager/reports/campaigns/{campaignId}/basic:
    get:
      tags:
        - reports
      summary: Get Campaign Basic Report
      description: >-
        Retrieves a basic CSV report for a specific campaign with sorting and
        pagination options. The report contains fundamental information about
        payout instructions and their current status.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: pageNumber
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: sortBy
          in: query
          schema:
            $ref: >-
              #/components/schemas/Talli.Campaigns.Contracts.Requests.BasicCampaignReportSortableColumn
        - name: sortDirection
          in: query
          schema:
            $ref: >-
              #/components/schemas/Talli.Common.Contracts.Pagination.SortDirection
      responses:
        '200':
          description: OK
          content:
            text/csv:
              schema:
                type: string
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - reports:view
  /v2/campaign-manager/templates/template-types:
    get:
      tags:
        - templates
      summary: Get template types
      description: Retrieves a list of template types.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/Talli.Api.Contracts.Templates.TemplateTypeSchemaResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - templates:view
  /v2/campaign-manager/templates/{id}:
    get:
      tags:
        - templates
      summary: Get template
      description: Retrieves a single template based on provided identifier.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Api.Contracts.Templates.TemplateResponse
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - templates:view
    put:
      tags:
        - templates
      summary: Update template
      description: Updates an existing template with the provided template.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.Api.Contracts.Templates.UpdateTemplateRequest
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - templates:edit
  /v2/campaign-manager/templates:
    get:
      tags:
        - templates
      summary: Get templates
      description: >-
        Retrieves a paginated list of templates, optionally filtered by template
        type.
      parameters:
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
            default: 1
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
            default: 20
        - name: templateType
          in: query
          schema:
            $ref: '#/components/schemas/Talli.Api.Contracts.Templates.TemplateType'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.Templates.TemplateResponse]
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - templates:view
    post:
      tags:
        - templates
      summary: Create template
      description: Creates a new template with the specified details.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Talli.Api.Contracts.Templates.CreateTemplateRequest
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Http.HttpValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - templates:create
  /v2/campaign-manager/venmo-transfers/{id}:
    get:
      tags:
        - venmo-transfers
      summary: Get Venmo Transfer
      description: >-
        Retrieves a Venmo transfer by its unique identifier. Returns 404 if no
        valid transfer is found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.PayPalTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
  /v2/campaign-manager/venmo-transfers:
    get:
      tags:
        - venmo-transfers
      summary: Get Venmo Transfer by Payout Instruction ID
      description: >-
        Retrieves a Venmo transfer by its associated payout instruction ID.
        Returns 404 if no valid transfer is found for the given payout
        instruction.
      parameters:
        - name: payoutInstructionId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Talli.Transfers.Contracts.Responses.CampaignManager.PayPalTransferResponse
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - oauth2:
            - Auth0Policy
            - payoutMethods:view
components:
  schemas:
    Json.Patch.JsonPatch:
      type: object
      properties:
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Json.Patch.PatchOperation'
      additionalProperties: false
    Json.Patch.OperationType:
      enum:
        - Unknown
        - Add
        - Remove
        - Replace
        - Move
        - Copy
        - Test
      type: string
    Json.Patch.PatchOperation:
      type: object
      properties:
        op:
          $ref: '#/components/schemas/Json.Patch.OperationType'
        from:
          type: array
          items:
            type: string
          readOnly: true
        path:
          type: array
          items:
            type: string
          readOnly: true
        value:
          $ref: '#/components/schemas/System.Text.Json.Nodes.JsonNode'
      additionalProperties: false
    Microsoft.AspNetCore.Http.HttpValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      additionalProperties: {}
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    System.Text.Json.Nodes.JsonNode:
      type: object
      properties:
        options:
          $ref: '#/components/schemas/System.Text.Json.Nodes.JsonNodeOptions'
        parent:
          $ref: '#/components/schemas/System.Text.Json.Nodes.JsonNode'
        root:
          $ref: '#/components/schemas/System.Text.Json.Nodes.JsonNode'
      additionalProperties: false
    System.Text.Json.Nodes.JsonNodeOptions:
      type: object
      properties:
        propertyNameCaseInsensitive:
          type: boolean
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.CampaignDraftPayoutMethodResponse:
      type: object
      properties:
        payoutMethodId:
          type: string
          description: The unique identifier of the payout method.
          format: uuid
        isDisabled:
          type: boolean
          description: >-
            Indicates whether this payout method is disabled for the campaign
            draft.
        disableReason:
          $ref: >-
            #/components/schemas/Talli.Common.Contracts.PayoutMethodDisableReason
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.CampaignDraftResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the campaign draft.
          format: uuid
        name:
          type: string
          description: The name of the campaign draft.
          nullable: true
        fundingSourceId:
          type: string
          description: The funding source identifier associated with the campaign draft.
          format: uuid
          nullable: true
        welcomeHeadline:
          type: string
          description: >-
            The welcome headline text that will be displayed in the application
            welcome screen.
          nullable: true
        campaignDescription:
          type: string
          description: The campaign description of the campaign draft.
          nullable: true
        campaignManager:
          type: string
          description: The name of the campaign manager.
          nullable: true
        welcomeText:
          type: string
          description: >-
            The welcome text that will be displayed in the application welcome
            screen.
          nullable: true
        iconUrl:
          type: string
          description: >-
            URL to the campaign's icon image that will be displayed in the
            application welcome screen.
          nullable: true
        payoutMethods:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignDraftPayoutMethodResponse
          description: Available payout methods for this campaign draft.
        expiryDate:
          type: string
          description: The date when the campaign expires.
          format: date
          nullable: true
        displayEndDate:
          type: string
          description: The date informing beneficiaries when is the end of the campaign.
          format: date
          nullable: true
        createdOn:
          type: string
          description: The date when the campaign draft was created.
          format: date
        updatedOn:
          type: string
          description: The date when the campaign draft was last updated.
          format: date
        validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
          type: boolean
          description: >-
            Indicates whether a valid mobile phone number is required to
            initiate payout instructions.If this is disabled payouts with no
            phone number will be sent to customers, but some payout methods
            might be disabled.
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.CampaignPayoutMethodResponse:
      type: object
      properties:
        payoutMethodId:
          type: string
          description: The unique identifier of the payout method.
          format: uuid
        isDisabled:
          type: boolean
          description: Indicates whether this payout method is disabled for the campaign.
        disableReason:
          $ref: >-
            #/components/schemas/Talli.Common.Contracts.PayoutMethodDisableReason
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.CampaignResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the campaign.
          format: uuid
        name:
          type: string
          description: The name of the campaign.
        fundingSourceId:
          type: string
          description: The funding source associated with the campaign.
          format: uuid
        welcomeHeadline:
          type: string
          description: >-
            The welcome headline text that will be displayed in the application
            welcome screen.
          nullable: true
        campaignDescription:
          type: string
          description: The campaign description of the campaign.
          nullable: true
        campaignManager:
          type: string
          description: The name of the campaign manager.
          nullable: true
        welcomeText:
          type: string
          description: >-
            The welcome text that will be displayed in the application welcome
            screen.
          nullable: true
        iconUrl:
          type: string
          description: >-
            URL to the campaign's icon image that will be displayed in the
            application welcome screen.
          nullable: true
        payoutMethods:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignPayoutMethodResponse
          description: Available payout methods for this campaign.
        expiryDate:
          type: string
          description: The date when the campaign expires.
          format: date
          nullable: true
        displayEndDate:
          type: string
          description: The date informing beneficiaries when is the end of the campaign.
          format: date
          nullable: true
        creationDate:
          type: string
          description: The date when the campaign was created.
          format: date
        validMobilePhoneNumberRequiredToInitiatePayoutInstructions:
          type: boolean
          description: >-
            Indicates whether a valid mobile phone number is required to
            initiate payout instructions.If this is disabled payouts with no
            phone number will be sent to customers, but some payout methods
            might be disabled.
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.CampaignWithDetailsResponse:
      type: object
      properties:
        campaign:
          $ref: '#/components/schemas/Talli.Api.Contracts.Campaigns.CampaignResponse'
        details:
          $ref: '#/components/schemas/Talli.Api.Contracts.Campaigns.DetailsResponse'
      additionalProperties: false
    Talli.Api.Contracts.Campaigns.DetailsResponse:
      type: object
      properties:
        totalFundsReceived:
          type: number
          description: Total funds that landed in the campaign FBO aczcount
          format: double
          nullable: true
        stats:
          $ref: '#/components/schemas/Talli.Api.Contracts.Reporting.ConversionStages'
      additionalProperties: false
    Talli.Api.Contracts.FundingSource.CreateSettlementFundRequest:
      type: object
      properties:
        settlementFundName:
          type: string
        w9Form:
          type: string
          format: binary
          nullable: true
        finalApprovalOrder:
          type: string
          format: binary
          nullable: true
        preliminaryApprovalOrder:
          type: string
          format: binary
          nullable: true
        settlementAgreement:
          type: string
          format: binary
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.FundingSource.FundingSourceResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        type:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.FundingSource.FundingSourceType
        status:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.FundingSource.FundingSourceStatus
      additionalProperties: false
    Talli.Api.Contracts.FundingSource.FundingSourceStatus:
      enum:
        - Pending
        - Active
        - Rejected
      type: integer
      format: int32
    Talli.Api.Contracts.FundingSource.FundingSourceType:
      enum:
        - OrganizationAccount
        - SettlementFund
      type: integer
      format: int32
    Talli.Api.Contracts.InitiatePayoutInstructionRequest:
      type: object
      properties:
        channel:
          type: string
          description: >-
            A channel that is used to deliver the Payout Instruction. Valid
            values are 'email' and 'none' (none will not actually perform any
            action)
      additionalProperties: false
    Talli.Api.Contracts.PayoutInstructions.CreatePayoutInstructionV2Request:
      type: object
      properties:
        campaignId:
          type: string
          description: >-
            The unique identifier of the campaign this payout instruction
            belongs to.
          format: uuid
        externalId:
          type: string
          description: >-
            An external identifier for this payout instruction, used for
            integration with client systems.
        firstName:
          type: string
          description: The first name of the beneficiary.
          nullable: true
        lastName:
          type: string
          description: The last name of the beneficiary.
          nullable: true
        amount:
          type: number
          description: The monetary amount of the payout instruction.
          format: double
          nullable: true
        email:
          type: string
          description: >-
            The email address of the beneficiary. This is the primary contact
            method.
          nullable: true
        phoneNumber:
          type: string
          description: >-
            The phone number of the beneficiary. May be required for certain
            payout methods.
          nullable: true
        addressLine1:
          type: string
          description: The first line of the beneficiary's address.
          nullable: true
        addressLine2:
          type: string
          description: The second line of the beneficiary's address.
          nullable: true
        city:
          type: string
          description: The city of the beneficiary's address.
          nullable: true
        stateCode:
          $ref: '#/components/schemas/Talli.Common.Contracts.StateCode'
        zipCode:
          type: string
          description: The ZIP/postal code of the beneficiary's address.
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.PayoutInstructions.PayoutInstructionActivityResponse:
      type: object
      properties:
        messageId:
          type: string
          description: Unique identifier for the activity message.
          format: uuid
          nullable: true
        messageType:
          type: string
          description: Type of message associated with this activity.
        timestamp:
          type: string
          description: Date and time when the activity occurred.
          format: date-time
          nullable: true
        type:
          type: string
          description: Category or classification of the activity.
        description:
          type: string
          description: Human-readable description of the activity.
        details:
          type: object
          additionalProperties:
            type: string
          description: >-
            Additional contextual information about the activity as key-value
            pairs.
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.PayoutInstructions.PayoutInstructionPayoutResponse:
      type: object
      properties:
        payoutInstructionId:
          type: string
          description: >-
            The unique identifier of the payout instruction associated with this
            payout.
          format: uuid
        payoutMethodId:
          type: string
          description: The unique identifier of the payout method used for this payout.
          format: uuid
        status:
          $ref: >-
            #/components/schemas/Talli.Campaigns.Contracts.PayoutInstructionStatus
        requestedOn:
          type: string
          description: The date and time when the payout was requested by the beneficiary.
          format: date-time
          nullable: true
        completedOn:
          type: string
          description: The date and time when the payout was completed successfully.
          format: date-time
          nullable: true
        externalIdentifiers:
          type: object
          additionalProperties:
            type: string
          description: >-
            External identifiers related to the payout, specific to the payment
            method (e.g., transaction IDs, payment references).
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.PayoutInstructions.PayoutInstructionResponse:
      type: object
      properties:
        payoutInstructionId:
          type: string
          description: The unique identifier for the payout instruction.
          format: uuid
        campaignId:
          type: string
          description: The identifier of the campaign this payout instruction belongs to.
          format: uuid
        amount:
          type: number
          description: The monetary amount of the payout instruction.
          format: double
          nullable: true
        firstName:
          type: string
          description: The first name of the beneficiary.
          nullable: true
        lastName:
          type: string
          description: The last name of the beneficiary.
          nullable: true
        email:
          type: string
          description: >-
            The email address of the beneficiary. This is the primary contact
            method.
        phoneNumber:
          type: string
          description: >-
            The phone number of the beneficiary. May be required for certain
            payout methods.
          nullable: true
        addressLine1:
          type: string
          description: The first line of the beneficiary's address.
          nullable: true
        addressLine2:
          type: string
          description: The second line of the beneficiary's address.
          nullable: true
        city:
          type: string
          description: The city of the beneficiary's address.
          nullable: true
        stateCode:
          $ref: '#/components/schemas/Talli.Common.Contracts.StateCode'
        zipCode:
          type: string
          description: The ZIP/postal code of the beneficiary's address.
          nullable: true
        status:
          $ref: >-
            #/components/schemas/Talli.Campaigns.Contracts.PayoutInstructionStatus
        disabledPayoutMethods:
          type: object
          additionalProperties:
            $ref: >-
              #/components/schemas/Talli.Common.Contracts.PayoutMethodDisableReason
          description: >-
            A dictionary of payout methods that are disabled for this
            instruction, with reasons.
        cancellationReason:
          $ref: '#/components/schemas/Talli.Common.Contracts.CancellationReason'
        selectedPayoutMethodId:
          type: string
          description: >-
            The identifier of the payout method selected by the beneficiary, if
            any.
          format: uuid
          nullable: true
        externalId:
          type: string
          description: >-
            An external identifier for this payout instruction, used for
            integration with client systems.
      additionalProperties: false
    Talli.Api.Contracts.PayoutMethodResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the payout method.
          format: uuid
        name:
          type: string
          description: Display name of the payout method.
        category:
          $ref: '#/components/schemas/Talli.Common.Contracts.PayoutMethodCategory'
        iconUrl:
          type: string
          description: URL for the payout method's icon or logo.
        isValidPhoneNumberRequired:
          type: boolean
          description: >-
            Indicates whether a valid phone number is required for this payout
            method.
        isActive:
          type: boolean
          description: Informs whether a payout method is active.
        description:
          type: string
          description: >-
            Optional description providing additional information about the
            payout method.
          nullable: true
        minAmount:
          type: number
          description: >-
            Optional minimum amount that can be processed with this payout
            method.
          format: double
          nullable: true
        maxAmount:
          type: number
          description: >-
            Optional maximum amount that can be processed with this payout
            method.
          format: double
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.Reporting.CampaignMetrics:
      type: object
      properties:
        totalFundsReceived:
          type: number
          description: Total funds that landed in the campaign FBO account
          format: double
        totalPayoutsSentAmount:
          type: number
          description: >-
            Total amount of payouts that are either redeemed or in progress
            (where money is allocated)
          format: double
        totalPayoutsSentCount:
          type: integer
          description: Total count of payouts that have been sent
          format: int32
        totalPayoutsSentPrecentage:
          type: integer
          description: Percentage of total funds that have been sent as payouts
          format: int32
        unredeemedFundsAmount:
          type: number
          description: Total amount of payouts sent but not yet redeemed by beneficiaries
          format: double
        unredeemedFundsPercentage:
          type: integer
          description: Percentage of total funds that have been sent but not yet redeemed
          format: int32
        availableToDisburse:
          type: number
          description: Balance available to send more payouts (unallocated balance)
          format: double
        availableToDisbursePercentage:
          type: integer
          description: Percentage of total funds that are still available to disburse
          format: int32
        numberOfBeneficiaries:
          type: integer
          description: Total number of beneficiaries in the campaign
          format: int32
      additionalProperties: false
    Talli.Api.Contracts.Reporting.CampaignStatisticsReportResponse:
      type: object
      properties:
        campaignId:
          type: string
          description: Unique identifier of the campaign
          format: uuid
        campaignName:
          type: string
          description: Name of the campaign
        metrics:
          $ref: '#/components/schemas/Talli.Api.Contracts.Reporting.CampaignMetrics'
        generationDate:
          type: string
          description: Date and time when this report was generated
          format: date-time
      additionalProperties: false
    Talli.Api.Contracts.Reporting.ConversionReportResponse:
      type: object
      properties:
        campaignId:
          type: string
          description: Unique identifier of the campaign
          format: uuid
        campaignName:
          type: string
          description: Name of the campaign
        conversionStages:
          $ref: '#/components/schemas/Talli.Api.Contracts.Reporting.ConversionStages'
        generationDate:
          type: string
          description: Date and time when this report was generated
          format: date-time
      additionalProperties: false
    Talli.Api.Contracts.Reporting.ConversionStageMetrics:
      type: object
      properties:
        count:
          type: integer
          description: Number of payout instructions in this stage
          format: int32
        amount:
          type: number
          description: Total monetary amount of payout instructions in this stage
          format: double
        percentage:
          type: number
          description: Percentage of eligible payout instructions that are in this stage
          format: double
        statuses:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Campaigns.Contracts.PayoutInstructionStatus
          description: List of payout instruction statuses that are included in this stage
      additionalProperties: false
    Talli.Api.Contracts.Reporting.ConversionStages:
      type: object
      properties:
        eligible:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.ConversionStageMetrics
        communicated:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.ConversionStageMetrics
        actioned:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.ConversionStageMetrics
        completed:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.ConversionStageMetrics
        excluded:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.ConversionStageMetrics
      additionalProperties: false
    Talli.Api.Contracts.Reporting.DailyActivity:
      required:
        - initiations
        - redemptions
      type: object
      properties:
        date:
          type: string
          description: Calendar date of the activity
          format: date
        initiations:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutActivityMetrics
        redemptions:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutActivityMetrics
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutActivityMetrics:
      type: object
      properties:
        count:
          type: integer
          description: Number of payout activities
          format: int32
        amount:
          type: number
          description: Total monetary amount of payout activities
          format: double
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutMethodUsage:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the payout method
          format: uuid
        name:
          type: string
          description: Name of the payout method
        category:
          $ref: '#/components/schemas/Talli.Common.Contracts.PayoutMethodCategory'
        usage:
          $ref: '#/components/schemas/Talli.Api.Contracts.Reporting.UsageMetrics'
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutMethodsReportResponse:
      type: object
      properties:
        campaignId:
          type: string
          description: Unique identifier of the campaign
          format: uuid
        campaignName:
          type: string
          description: Name of the campaign
        payoutMethods:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Reporting.PayoutMethodUsage
          description: List of payout methods with their usage metrics
        generationDate:
          type: string
          description: Date and time when this report was generated
          format: date-time
        totalCount:
          type: integer
          description: Total count of payout instructions across all payout methods
          format: int32
        totalAmount:
          type: number
          description: Total monetary amount across all payout methods
          format: double
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutsHistoryPeriod:
      type: object
      properties:
        from:
          type: string
          description: Start date and time of the report period (inclusive)
          format: date-time
        to:
          type: string
          description: End date and time of the report period (inclusive)
          format: date-time
        days:
          type: integer
          description: Total number of days in the report period
          format: int32
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutsHistoryReportResponse:
      type: object
      properties:
        campaignId:
          type: string
          description: Unique identifier of the campaign
          format: uuid
        campaignName:
          type: string
          description: Name of the campaign
        reportPeriod:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutsHistoryPeriod
        dailyActivity:
          type: array
          items:
            $ref: '#/components/schemas/Talli.Api.Contracts.Reporting.DailyActivity'
          description: List of daily payout activities within the report period
        summary:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutsHistorySummary
        generationDate:
          type: string
          description: Date and time when this report was generated
          format: date-time
      additionalProperties: false
    Talli.Api.Contracts.Reporting.PayoutsHistorySummary:
      type: object
      properties:
        payoutsSent:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutActivityMetrics
        payoutsRedeemed:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Reporting.PayoutActivityMetrics
        averagePayoutAmount:
          type: number
          description: Average monetary amount per payout sent during the report period
          format: double
        averageDailyPayouts:
          type: number
          description: Average number of payouts sent per day during the report period
          format: double
      additionalProperties: false
    Talli.Api.Contracts.Reporting.UsageMetrics:
      type: object
      properties:
        count:
          type: integer
          description: Total count of instances
          format: int32
        amount:
          type: number
          description: Total monetary amount associated with the instances
          format: double
        percentageByCount:
          type: number
          description: Percentage representation based on count relative to the total
          format: double
        percentageByAmount:
          type: number
          description: Percentage representation based on amount relative to the total
          format: double
      additionalProperties: false
    Talli.Api.Contracts.Templates.ContentFieldDefinitionResponse:
      type: object
      properties:
        description:
          type: string
          description: Description of the content field.
        defaultValue:
          type: string
          description: Default value of the content field.
      additionalProperties: false
    Talli.Api.Contracts.Templates.CreateTemplateRequest:
      type: object
      properties:
        templateType:
          $ref: '#/components/schemas/Talli.Api.Contracts.Templates.TemplateType'
        name:
          type: string
          description: The name of the template.
        isActive:
          type: boolean
          description: >-
            Indicates whether a template is active or not. If this is disabled,
            this template will not be used.
          nullable: true
        contentFields:
          type: object
          additionalProperties:
            type: string
          description: >-
            The dictionary is used to store context fields. The template
            consists of content fields.
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.Templates.TemplateLayoutResponse:
      type: object
      properties:
        externalTemplateId:
          type: string
          description: >-
            External identifier for the template, typically used for reference
            in external systems.
        contentFields:
          type: object
          additionalProperties:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Templates.ContentFieldDefinitionResponse
          description: >-
            The dictionary is used to store context fields. The template
            consists of content fields.
      additionalProperties: false
    Talli.Api.Contracts.Templates.TemplateModelElementResponse:
      type: object
      properties:
        type:
          type: string
          description: Type of the template model element (e.g., string).
        description:
          type: string
          description: Description of the template model element.
      additionalProperties: false
    Talli.Api.Contracts.Templates.TemplateResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the template.
          format: uuid
        templateType:
          $ref: '#/components/schemas/Talli.Api.Contracts.Templates.TemplateType'
        name:
          type: string
          description: The name of the template.
        isActive:
          type: boolean
          description: >-
            Indicates whether a template is active or not. If this is disabled,
            this template will not be used.
          nullable: true
        contentFields:
          type: object
          additionalProperties:
            type: string
          description: >-
            The dictionary is used to store context fields. The template
            consists of content fields.
          nullable: true
      additionalProperties: false
    Talli.Api.Contracts.Templates.TemplateType:
      enum:
        - InitiateEmail
        - ReminderEmail
        - FailureReinitiateEmail
        - OtpEmail
        - PushEmail
      type: integer
      format: int32
    Talli.Api.Contracts.Templates.TemplateTypeSchemaResponse:
      type: object
      properties:
        templateType:
          $ref: '#/components/schemas/Talli.Api.Contracts.Templates.TemplateType'
        description:
          type: string
          description: Description of the template type.
        templateModelSchema:
          type: object
          additionalProperties:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Templates.TemplateModelElementResponse
          description: >-
            Dictionary is used to store template model elements for a template
            type. Template model elements can be used in content fields.
            Elements can refer to an entire campaign (e.g., expiry date) or to a
            unique user (e.g., first name).
        layout:
          $ref: >-
            #/components/schemas/Talli.Api.Contracts.Templates.TemplateLayoutResponse
      additionalProperties: false
    Talli.Api.Contracts.Templates.UpdateTemplateRequest:
      type: object
      properties:
        templateType:
          $ref: '#/components/schemas/Talli.Api.Contracts.Templates.TemplateType'
        name:
          type: string
          description: The name of the template.
        isActive:
          type: boolean
          description: >-
            Indicates whether a template is active or not. If this is disabled,
            this template will not be used.
          nullable: true
        contentFields:
          type: object
          additionalProperties:
            type: string
          description: >-
            The dictionary is used to store context fields. The template
            consists of content fields.
          nullable: true
      additionalProperties: false
    Talli.App.Models.Requests.CancelPayoutInstructionRequest:
      type: object
      properties:
        cancellationReason:
          type: string
          description: >-
            Reason for Payout Instruction Cancelation, valid values are:
            `BeneficiaryRequest`, `CampaignManagerRequest`, 'EmailHardBounce',
            'EmailSpamComplaint', 'UnsubscribedFromEmails',
            'EmailScreeningFailed'
      additionalProperties: false
    Talli.App.Models.Requests.SendCampaignRemindersRequest:
      type: object
      properties:
        payoutInstructionIds:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
        distributionPeriodInSeconds:
          type: integer
          format: int32
          nullable: true
        payoutInstructionStatuses:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Campaigns.Contracts.PayoutInstructionStatus
          nullable: true
        dryRun:
          type: boolean
      additionalProperties: false
    Talli.App.Models.Requests.SendPayoutInstructionReminderRequest:
      type: object
      additionalProperties: false
    Talli.Campaigns.Contracts.PayoutInstructionStatus:
      enum:
        - Draft
        - Ready
        - PushInitiated
        - Initiated
        - InitiationFailed
        - PayoutMethodSelected
        - Requested
        - Restored
        - Reinitiated
        - ReinitiationFailed
        - ExpiryRequested
        - Fulfilled
        - Expired
        - Cancelled
      type: integer
      format: int32
    Talli.Campaigns.Contracts.Requests.BasicCampaignReportSortableColumn:
      enum:
        - PayoutInstructionId
        - PayoutInstructionStatus
        - CreatedOn
        - UpdatedOn
        - BeneficiaryFirstName
        - BeneficiaryLastName
        - PayoutInstructionAmount
        - BeneficiaryEmail
        - BeneficiaryPhoneNumber
        - SelectedPayoutMethod
        - SelectedPayoutMethodCategory
      type: integer
      format: int32
    Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponse:
      type: object
      properties:
        dryRun:
          type: boolean
        details:
          $ref: >-
            #/components/schemas/Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponseDetails
      additionalProperties: false
    Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponseDetails:
      type: object
      properties:
        batchId:
          type: string
          format: uuid
          nullable: true
        count:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponseItem
      additionalProperties: false
    Talli.Campaigns.Contracts.Responses.CampaignManager.SendCampaignRemindersResponseItem:
      type: object
      properties:
        email:
          type: string
        count:
          type: integer
          format: int32
      additionalProperties: false
    Talli.Common.AccountType:
      enum:
        - Checking
        - Savings
      type: integer
      format: int32
    Talli.Common.Contracts.CancellationReason:
      enum:
        - Unknown
        - BeneficiaryRequest
        - CampaignManagerRequest
        - EmailHardBounce
        - EmailSpamComplaint
        - UnsubscribedFromEmails
        - EmailScreeningFailed
      type: integer
      format: int32
    Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.Campaigns.CampaignWithDetailsResponse]:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
          readOnly: true
        totalItems:
          type: integer
          format: int32
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Campaigns.CampaignWithDetailsResponse
      additionalProperties: false
    Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.FundingSource.FundingSourceResponse]:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
          readOnly: true
        totalItems:
          type: integer
          format: int32
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.FundingSource.FundingSourceResponse
      additionalProperties: false
    Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.PayoutInstructions.PayoutInstructionResponse]:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
          readOnly: true
        totalItems:
          type: integer
          format: int32
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.PayoutInstructions.PayoutInstructionResponse
      additionalProperties: false
    Talli.Common.Contracts.Pagination.PagedCollection`1[Talli.Api.Contracts.Templates.TemplateResponse]:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
          readOnly: true
        totalItems:
          type: integer
          format: int32
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.Api.Contracts.Templates.TemplateResponse
      additionalProperties: false
    Talli.Common.Contracts.Pagination.SortDirection:
      enum:
        - Ascending
        - Descending
      type: integer
      format: int32
    Talli.Common.Contracts.PayoutMethodCategory:
      enum:
        - PrepaidCards
        - GiftCards
        - ACHTransfer
        - VenmoTransfer
        - PayPalTransfer
        - PayPalV2Transfer
        - VenmoV2Transfer
      type: integer
      format: int32
    Talli.Common.Contracts.PayoutMethodDisableReason:
      enum:
        - Default
        - InvalidPhoneNumber
        - AmountNotSupported
      type: integer
      format: int32
    Talli.Common.Contracts.StateCode:
      enum:
        - AL
        - AK
        - AR
        - AZ
        - CA
        - CO
        - CT
        - DC
        - DE
        - FL
        - GA
        - HI
        - IA
        - ID
        - IL
        - IN
        - KS
        - KY
        - LA
        - MA
        - MD
        - ME
        - MI
        - MN
        - MO
        - MS
        - MT
        - NC
        - ND
        - NE
        - NH
        - NJ
        - NM
        - NV
        - NY
        - OK
        - OH
        - OR
        - PA
        - RI
        - SC
        - SD
        - TN
        - TX
        - UT
        - VA
        - VT
        - WA
        - WI
        - WV
        - WY
      type: integer
      format: int32
    Talli.GiftCards.Contracts.GiftCardStatus:
      enum:
        - Initiated
        - Issued
        - Failed
        - FailedPermanently
      type: integer
      format: int32
    Talli.GiftCards.Contracts.Responses.CampaignManager.GiftCardResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        amount:
          type: number
          format: double
        status:
          $ref: '#/components/schemas/Talli.GiftCards.Contracts.GiftCardStatus'
        requestedOn:
          type: string
          format: date-time
        issuedOn:
          type: string
          format: date-time
          nullable: true
        issuerCardId:
          type: string
        imageUrl:
          type: string
        legalDisclaimer:
          type: string
        termsAndConditions:
          type: string
        usageInstructions:
          type: string
        marketingDescription:
          type: string
        dynamicFields:
          type: object
          properties:
            CardNumber:
              $ref: >-
                #/components/schemas/Talli.GiftCards.Contracts.Responses.GiftCardResponseField
            Pin:
              $ref: >-
                #/components/schemas/Talli.GiftCards.Contracts.Responses.GiftCardResponseField
            Auxiliary:
              $ref: >-
                #/components/schemas/Talli.GiftCards.Contracts.Responses.GiftCardResponseField
            BarcodeImageUrl:
              $ref: >-
                #/components/schemas/Talli.GiftCards.Contracts.Responses.GiftCardResponseField
          additionalProperties: false
      additionalProperties: false
    Talli.GiftCards.Contracts.Responses.GiftCardResponseField:
      type: object
      properties:
        value:
          type: string
        label:
          type: string
          nullable: true
      additionalProperties: false
    Talli.PrepaidCards.Contracts.PrepaidCardStatus:
      enum:
        - Initiated
        - Issued
        - Failed
        - FailedPermanently
      type: integer
      format: int32
    Talli.PrepaidCards.Contracts.Responses.Beneficiary.PrepaidCardResponse:
      type: object
      properties:
        prepaidCardId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/Talli.PrepaidCards.Contracts.PrepaidCardStatus'
        embeddedCardUiUrl:
          type: string
          nullable: true
        balance:
          type: number
          format: double
        transactions:
          type: array
          items:
            $ref: >-
              #/components/schemas/Talli.PrepaidCards.Contracts.Responses.TransactionDetails
      additionalProperties: false
    Talli.PrepaidCards.Contracts.Responses.TransactionDetails:
      type: object
      properties:
        id:
          type: string
          format: uuid
        amount:
          type: number
          format: double
        merchant:
          type: string
        merchantAddress:
          type: string
        status:
          $ref: '#/components/schemas/Talli.PrepaidCards.Contracts.TransactionStatus'
        createdOn:
          type: string
          format: date-time
      additionalProperties: false
    Talli.PrepaidCards.Contracts.TransactionStatus:
      enum:
        - Pending
        - Settled
        - Failed
      type: integer
      format: int32
    Talli.Transfers.Contracts.ACHTransferStatus:
      enum:
        - Initiated
        - PayoutOutgoingAccountRequested
        - Processed
        - Failed
        - FailedPermanently
        - Settled
      type: integer
      format: int32
    Talli.Transfers.Contracts.PayPalTransferStatus:
      enum:
        - Initiated
        - Triggered
        - Processed
        - Unclaimed
        - Failed
        - FailedPermanently
        - CancelRequested
        - Queued
      type: integer
      format: int32
    Talli.Transfers.Contracts.Responses.CampaignManager.ACHTransferResponse:
      type: object
      properties:
        triggeredOn:
          type: string
          format: date-time
        processedOn:
          type: string
          format: date-time
          nullable: true
        estimatedCompletionDate:
          type: string
          format: date-time
        accountNumber:
          type: string
        routingNumber:
          type: string
        accountType:
          $ref: '#/components/schemas/Talli.Common.AccountType'
        status:
          $ref: '#/components/schemas/Talli.Transfers.Contracts.ACHTransferStatus'
      additionalProperties: false
    Talli.Transfers.Contracts.Responses.CampaignManager.PayPalTransferResponse:
      type: object
      properties:
        triggeredOn:
          type: string
          format: date-time
        completedOn:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/Talli.Transfers.Contracts.PayPalTransferStatus'
        externalIdentifiers:
          type: object
          additionalProperties:
            type: string
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: oauth2
      description: Auth0 Authentication (OAuth2, Authorization Code Flow)
      flows:
        authorizationCode:
          authorizationUrl: https://talli-ai.us.auth0.com/authorize
          tokenUrl: https://talli-ai.us.auth0.com/oauth/token
          scopes:
            campaigns:view: campaigns:view
            campaigns:create: campaigns:create
            campaigns:edit: campaigns:edit
            campaigns:sendReminders: campaigns:sendReminders
            users:create: users:create
            users:manage: users:manage
            users:view: users:view
            payoutInstructions:view: payoutInstructions:view
            payoutInstructions:sendReminder: payoutInstructions:sendReminder
            payoutInstructions:cancel: payoutInstructions:cancel
            payoutInstructions:tryRestore: payoutInstructions:tryRestore
            payoutInstructions:create: payoutInstructions:create
            payoutInstructions:update: payoutInstructions:update
            payoutInstructions:initiate: payoutInstructions:initiate
            payoutMethods:view: payoutMethods:view
            reports:view: reports:view
            fundingSources:view: fundingSources:view
            fundingSources:manage: fundingSources:manage
            templates:view: templates:view
            templates:create: templates:create
            templates:edit: templates:edit
    oauth2-token-only:
      type: apiKey
      description: >-
        Standard Authorization header using the Bearer scheme. Example: "bearer
        {token}"
      name: Authorization
      in: header
tags:
  - name: campaigns
    description: >-
      Endpoints for creating and managing campaigns. A campaign represents a
      distribution of funds to multiple beneficiaries.
  - name: payout-instructions
    description: >-
      Endpoints for creating and managing payout instructions. A payout
      instruction represents an intention to pay a specific amount of money to a
      beneficiary.It is associated with one and only one campaign. 
  - name: payout-methods
    description: >-
      Endpoints for viewing and managing available payout methods, such as ACH,
      PayPal, and gift cards.
  - name: reports
    description: >-
      Endpoints for accessing analytics and reporting data about campaigns and
      payouts.
  - name: ach-transfers
    description: Endpoints for managing ACH bank transfers as a payout method.
  - name: gift-cards
    description: Endpoints for managing gift card payouts and retrieving gift card details.
  - name: paypal-transfers
    description: >-
      Endpoints for managing PayPal payouts and retrieving PayPal transfer
      details.
  - name: prepaid-cards
    description: >-
      Endpoints for managing prepaid card payouts and retrieving prepaid card
      details.
  - name: venmo-transfers
    description: >-
      Endpoints for managing Venmo transfers and retrieving Venmo transaction
      details.
  - name: funding-sources
    description: >-
      Represents an account connected to a business entity that can be used as a
      source of funds for one or multiple campaigns. Each funding source
      corresponds to a separate bank account in our payment system and maintains
      it's own banking details and fund management capabilities
