openapi: 3.1.0
info:
  title: Brand API - Contracts
  description: API for retrieving partner contracts, which define the rules for partner payouts and business relationships.
  version: v12
servers:
- url: https://api.impact.com
paths:
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Contracts:
    get:
      summary: List All Contracts
      description: Returns a list of contracts for a specific campaign, with options for filtering by date, status, and other attributes.
      operationId: listContracts
      tags:
      - Contracts
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
        description: The ID of the campaign (program) to retrieve contracts from.
      - name: DateLastUpdatedBefore
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts updated before a specific date and time.
      - name: DateLastUpdatedAfter
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts updated after a specific date and time.
      - name: StartDateBefore
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts that start before a specific date and time.
      - name: StartDateAfter
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts that start after a specific date and time.
      - name: EndDateBefore
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts that end before a specific date and time.
      - name: EndDateAfter
        in: query
        schema:
          type: string
          format: date-time
        description: Return contracts that end after a specific date and time.
      - name: PartnerId
        in: query
        schema:
          type: integer
        description: Filter contracts for a specific partner.
      - name: Signatory
        in: query
        schema:
          type: string
        description: Search for contracts by brand or partner signatory.
      - name: Status
        in: query
        schema:
          type: string
          enum:
          - ACTIVE
          - DECLINED
          - EXPIRED
          - PENDING
          - UPCOMING
        description: Filter contracts by status. Defaults to ACTIVE if not specified.
      - name: TemplateId
        in: query
        schema:
          type: integer
        description: Filter contracts by the source Template Terms ID.
      responses:
        '200':
          description: A paginated list of contract objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Contracts:
                    type: array
                    description: The list of contract objects.
                    items:
                      $ref: '#/components/schemas/Contract'
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Contracts/{ContractId}:
    get:
      summary: Retrieve a Contract
      description: Retrieves the details of a single, existing contract by its unique ID.
      operationId: getContractById
      tags:
      - Contracts
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
        description: The ID of the campaign (program) the contract belongs to.
      - name: ContractId
        in: path
        required: true
        schema:
          type: string
        description: The unique impact.com ID for the contract.
      responses:
        '200':
          description: A single contract object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contract'
components:
  schemas:
    Contract:
      type: object
      properties:
        Id:
          type: string
          description: The unique identifier for the contract.
          example: S-7777777
        PartnerId:
          type: integer
          description: The unique identifier of the partner the contract is with.
          example: 10000
        PartnerValue1:
          type: string
          description: A custom value associated with the partner.
          example: ''
        Status:
          type: string
          description: The current status of the contract.
          enum:
          - ACTIVE
          - EXPIRED
          example: ACTIVE
        StartDate:
          type: string
          format: date-time
          description: The date and time the contract becomes active.
          example: '2026-01-20T00:00:00-08:00'
        EndDate:
          type: string
          format: date-time
          nullable: true
          description: The date and time the contract expires. Null for open-ended contracts.
          example: ''
        BrandSignatory:
          type: string
          description: The name of the brand representative who signed the contract.
          example: Justin Case
        BrandSignatoryDate:
          type: string
          format: date-time
          description: The date and time the brand signed the contract.
          example: '2026-01-19T23:51:01-08:00'
        PartnerSignatory:
          type: string
          description: The name of the partner representative who signed the contract.
          example: Partner Person
        PartnerSignatoryDate:
          type: string
          format: date-time
          description: The date and time the partner signed the contract.
          example: '2026-01-19T23:51:01-08:00'
        DateCreated:
          type: string
          format: date-time
          description: The date and time the contract was created.
          example: '2026-01-19T23:51:01-08:00'
        DateLastUpdated:
          type: string
          format: date-time
          description: The date and time the contract was last updated.
          example: '2026-01-19T23:51:01-08:00'
        TemplateTerms:
          $ref: '#/components/schemas/TemplateTerms'
          description: The template terms underlying this contract.
        PdfUri:
          type: string
          format: uri-reference
          description: The URI to download the contract as a PDF.
          example: /Advertisers/<AccountSID>/Campaigns/1000/Contracts/S-7777777/Download
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this contract in the impact.com API.
          example: /Advertisers/<AccountSID>/Campaigns/1000/Contracts/S-7777777
    TemplateTerms:
      type: object
      properties:
        TemplateId:
          type: integer
          description: Unique identifier for the template terms.
          example: 99999
        VersionId:
          type: string
          description: Version number of the template terms.
          example: '6'
        Name:
          type: string
          description: Display name for the template terms.
          example: ACME Public Terms
        Labels:
          type: array
          description: Labels assigned to these template terms.
          items:
            type: string
        Currency:
          type: string
          description: Three-letter ISO 4217 currency code for payouts.
          example: USD
        EventPayouts:
          type: array
          description: Payout configurations per event type.
          items:
            $ref: '#/components/schemas/EventPayout'
        PromotionalTerms:
          type: array
          description: Additional promotional terms attached to the contract.
          items:
            $ref: '#/components/schemas/PromotionalTerm'
        ChangeNotificationPeriod:
          type: integer
          description: Number of days notice required before changes take effect.
          example: 30
        ReturnPolicy:
          type: string
          description: How returns are handled for actions under this contract.
          enum:
          - ALWAYS_OK
          - MP_APPROVAL_REQ
          - NO_RETURNS
          example: ALWAYS_OK
        MaxReturnPercentage:
          type: integer
          description: Maximum return rate percentage allowed.
          example: 100
        ActionLimit:
          type: integer
          description: Maximum number of actions allowed within the action limit period.
          example: 1000
        ActionLimitPeriod:
          type: string
          description: The time window for the action limit.
          enum:
          - DAY
          - WEEK
          - MONTH
          - QUARTER
          - IO_DURATION
          example: MONTH
        SpendLimit:
          type: number
          format: decimal
          description: Maximum payout spend allowed within the spend limit period.
          example: 10000.0
        SpendLimitPeriod:
          type: string
          description: The time window for the spend limit.
          enum:
          - DAY
          - WEEK
          - MONTH
          - QUARTER
          - IO_DURATION
          example: MONTH
        MinEarningPerClick:
          type: number
          format: decimal
          description: Minimum earnings per click required.
          example: 0.05
        ContractStartSlottingFee:
          type: number
          format: decimal
          description: Fee charged to the partner when the contract starts.
          example: 0.0
        FirstActionSlottingFee:
          type: number
          format: decimal
          nullable: true
          description: Fee charged to the partner on their first action.
          example: 0.0
        MonthlySlottingFee:
          type: number
          format: decimal
          nullable: true
          description: Monthly fee charged to the partner.
          example: 0.0
        CustomCreativePayer:
          type: string
          description: Which party pays for custom creative work.
          enum:
          - ADVERTISER
          - PUBLISHER
          - NOT_APPLICABLE
          example: ADVERTISER
    EventPayout:
      type: object
      properties:
        EventTypeId:
          type: integer
          description: Unique identifier for the event type.
          example: '18500'
        EventTypeName:
          type: string
          description: Display name of the event type.
          example: Online Sale
        EventCategory:
          type: string
          description: Category of the event.
          enum:
          - LEAD
          - SALE
          - DOWNLOAD
          - PAGE_VISIT
          - CALL_PER_RING
          - CALL_PER_DURATION
          - CALL_PER_CONVERSATION
          - PARTNER_REFERRAL
          - DATA_POST
          - OFFLINE
          - CLICK
          - MOBILE_APP
          example: SALE
        DefaultPayout:
          type: number
          format: decimal
          description: Default flat payout amount for the event.
          example: 10.0
        DefaultPayoutRate:
          type: number
          format: decimal
          description: Default percentage payout rate for the event.
          example: '15'
        PayoutLevel:
          type: string
          description: Whether payout is calculated per item, order, click, or call.
          enum:
          - ITEM
          - ORDER
          - CLICK
          - CALL
          example: ITEM
        PayoutGroups:
          type: array
          description: Conditional payout groups for this event type.
          items:
            $ref: '#/components/schemas/PayoutGroup'
        PayoutAdjustments:
          type: array
          description: Payout adjustment rules applied conditionally.
          items:
            $ref: '#/components/schemas/PayoutAdjustment'
        PerformanceBonus:
          $ref: '#/components/schemas/PerformanceBonus'
          description: Performance bonus configuration for the event type.
        PayoutRestrictions:
          type: array
          description: Restrictions that prevent payout when certain conditions are met.
          items:
            $ref: '#/components/schemas/PayoutRestriction'
        Limits:
          type: array
          description: Payout or volume limits applied to this event.
          items:
            $ref: '#/components/schemas/PayoutLimit'
        Locking:
          $ref: '#/components/schemas/Locking'
          description: Locking schedule that determines when payouts are finalized.
        PayoutScheduling:
          $ref: '#/components/schemas/PayoutScheduling'
          description: Schedule for when payouts become available.
        CreditPolicy:
          type: string
          description: How credit is assigned across referrers in the conversion path.
          enum:
          - LAST_REFERRER
          - FIRST_REFERRER
          - LAST_TO_CART
          - FIRST_TO_CART
          - PARENT_ACTION
          example: LAST_REFERRER
        ValidReferrals:
          type: array
          description: Configuration for valid referral types and attribution windows.
          items:
            $ref: '#/components/schemas/ValidReferral'
    PayoutGroup:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          example: ab12c3d4-5e6f-7g89-01h2-345ijk6lmn78
          description: Select the option that best describes how you use impact.com
        Rank:
          type: integer
          example: '1'
        Rules:
          type: array
          items:
            $ref: '#/components/schemas/PayoutRule'
        Payout:
          type: number
          format: decimal
          example: 1.0
        PayoutRate:
          type: number
          format: decimal
          example: '15'
        Limits:
          type: array
          items:
            $ref: '#/components/schemas/PayoutLimit'
        Tiers:
          type: array
          items:
            $ref: '#/components/schemas/PayoutTier'
    PayoutRule:
      type: object
      properties:
        Variable:
          type: string
          example: CUSTOMER_COUNTRY
        Operator:
          type: string
          example: IS
        Values:
          type: array
          items:
            type: string
    PayoutLimit:
      type: object
      properties:
        Type:
          type: string
          enum:
          - CLICKS
          - ITEM
          - PAYOUT
          - ACTION
          - CONCURRENT_CALLS
          example: PAYOUT
        Subtype:
          type: string
          enum:
          - SKU
          - CATEGORY
          - TEXT2
          nullable: true
        Value:
          type: number
          format: decimal
          example: '45.0'
        LimitBy:
          type: string
          enum:
          - ITEM
          - ORDER
          - CUSTOMER
          - CLICK
          - CALLER_ID
          example: ITEM
        Period:
          type: string
          enum:
          - DAY
          - WEEK
          - MONTH
          - QUARTER
          - CONTRACT_DURATION
          example: DAY
        WeekendOverrideValue:
          type: integer
          example: '500'
    PayoutTier:
      type: object
      properties:
        RevenueThreshold:
          type: number
          format: decimal
          example: '15.00'
        ActionThreshold:
          type: integer
        ParentTier:
          type: integer
        Payout:
          type: number
          format: decimal
        PayoutRate:
          type: number
          format: decimal
          example: '60'
    PayoutAdjustment:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          example: x234y567-8901-2z3a-4567-8b9012345c67
          description: Select the option that best describes how you use impact.com
        Rules:
          type: array
          items:
            $ref: '#/components/schemas/PayoutRule'
        Direction:
          type: string
          enum:
          - INCREASE
          - DECREASE
          - ADD
          - SUBTRACT
          example: INCREASE
        Amount:
          type: number
          format: decimal
        Rate:
          type: integer
          example: '15'
    PerformanceBonus:
      type: object
      properties:
        Type:
          type: string
          enum:
          - ALL_ACTIONS
          - SUBSEQUENT_ACTIONS
          - FIXED
          example: ALL_ACTIONS
        Basis:
          type: string
          enum:
          - REVENUE
          - ACTIONS
          example: REVENUE
        Period:
          type: string
          enum:
          - CALENDAR_MONTH
          example: CALENDAR_MONTH
        Tiers:
          type: array
          items:
            $ref: '#/components/schemas/PayoutTier'
    PayoutRestriction:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          example: 8d9012ef-gh34-56i7-jk89-012345l67890
          description: Select the option that best describes how you use impact.com
        Rules:
          type: array
          items:
            $ref: '#/components/schemas/PayoutRule'
        ZeroPayoutHideReport:
          type: string
          enum:
          - '0'
          - '1'
    Locking:
      type: object
      properties:
        Basis:
          type: string
          enum:
          - TRACKED
          - APPROVED
          - COMMISSIONABLE
          example: TRACKED
        Period:
          type: string
          enum:
          - DAY
          - WEEK
          - HALF_MONTH
          - MONTH
          example: MONTH
        MonthOffset:
          type: integer
          example: '1'
        DayOffset:
          type: integer
          example: '0'
        DayOfMonth:
          type: integer
        OpenEndedAutoLockingMode:
          type: string
          enum:
          - APPROVE
          - REJECT
        MaxMonthsOpenEndedPeriod:
          type: integer
    PayoutScheduling:
      type: object
      properties:
        Basis:
          type: string
          enum:
          - LOCKED
          - INVOICED
          example: LOCKED
        Period:
          type: string
          enum:
          - END_OF_DAY
          - END_OF_MONTH
          example: END_OF_MONTH
        MonthOffset:
          type: integer
        DayOffset:
          type: integer
    ValidReferral:
      type: object
      properties:
        Type:
          type: string
          enum:
          - PARENT_ACTIONS
          - CLICKS
          - IMPRESSIONS
          example: CLICKS
        Window:
          type: integer
          example: '30'
        WindowUnit:
          type: string
          enum:
          - HOUR
          - DAY
          example: DAY
    PromotionalTerm:
      type: object
      properties:
        TermsName:
          type: string
          example: Custom Terms
        TermsType:
          type: string
          enum:
          - CUSTOM
          - EMAIL
          - COPYWRITING
          - PAID_SEARCH
          - SEO
          - TRADEMARK
          - APPROVAL
          example: CUSTOM
        TermsContent:
          type: string
        TermsPdfUri:
          type: string
          format: uri-reference
          nullable: true
