openapi: 3.1.0
info:
  title: Brand Contracts API
  version: v11
  description: Retrieve and list contract objects representing the agreements between brands and partners.
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Contracts:
    get:
      operationId: listContracts
      tags:
      - Contracts
      summary: List all contracts
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
      - name: Status
        in: query
        required: false
        schema:
          type: string
          enum:
          - ACTIVE
          - DECLINED
          - EXPIRED
          - PENDING
          - UPCOMING
      - name: PartnerId
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: OK
          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:
      operationId: getContract
      tags:
      - Contracts
      summary: Retrieve a contract
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
      - name: ContractId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contract'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  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: integer
          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'
    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 (e.g., SALE, LEAD, CLICK).
          example: SALE
        DefaultPayoutRate:
          type: string
          description: Default payout rate for this event type.
          example: '15'
        PayoutLevel:
          type: string
          description: Whether payout is calculated per item, order, click, or call.
          example: ITEM
