openapi: 3.1.0
info:
  title: Brand API - Deals
  description: API for creating, retrieving, updating, and deleting promotional deals that partners can use in their marketing efforts.
  version: v12
servers:
- url: https://api.impact.com
paths:
  /Advertisers/{AccountSID}/Deals:
    get:
      summary: List All Deals
      description: Returns a list of your deals, with options for filtering by campaign, scope, state, and type.
      operationId: listDeals
      tags:
      - Deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: CampaignId
        in: query
        schema:
          type: integer
        description: Filter deals by the associated campaign ID.
      - name: Scope
        in: query
        schema:
          $ref: '#/components/schemas/DealScope'
        description: Filter deals by their scope.
      - name: State
        in: query
        schema:
          $ref: '#/components/schemas/DealState'
        description: Filter deals by their current state.
      - name: Type
        in: query
        schema:
          $ref: '#/components/schemas/DealType'
        description: Filter deals by their type.
      responses:
        '200':
          description: A paginated list of deal objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Deals:
                    type: array
                    description: The list of deal objects.
                    items:
                      $ref: '#/components/schemas/Deal'
    post:
      summary: Create a Deal
      description: Creates a new deal. The required parameters depend on the deal's `Type` and `Scope`.
      operationId: createDeal
      tags:
      - Deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      requestBody:
        description: The details of the deal to create.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealCreate'
      responses:
        '200':
          description: The deal was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
  /Advertisers/{AccountSID}/Deals/{DealId}:
    get:
      summary: Retrieve a Deal
      description: Retrieves the details of an existing deal by its unique ID.
      operationId: getDealById
      tags:
      - Deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: DealId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the deal.
      responses:
        '200':
          description: A single deal object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
    put:
      summary: Update a Deal
      description: Updates the specified deal by setting the values of the parameters passed. Only a limited set of fields can be updated via API.
      operationId: updateDeal
      tags:
      - Deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: DealId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the deal to update.
      requestBody:
        description: The deal fields to update.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealUpdate'
      responses:
        '200':
          description: The deal was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
    delete:
      summary: Delete a Deal
      description: Permanently deletes a deal. This cannot be undone.
      operationId: deleteDeal
      tags:
      - Deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the account.
      - name: DealId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the deal to delete.
      responses:
        '200':
          description: The deal was successfully deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Indicates that the deal was deleted.
                    example: DELETED
components:
  schemas:
    Deal:
      type: object
      properties:
        Id:
          type: integer
          description: The unique identifier for the deal.
          example: 3
        Name:
          type: string
          description: The display name of the deal.
          example: AcmeDeal3
        Description:
          type: string
          nullable: true
          description: A description of the deal that may be shown to partners.
          example: ''
        CampaignId:
          type: integer
          description: The unique identifier of the campaign the deal belongs to.
          example: 10000
        State:
          $ref: '#/components/schemas/DealState'
          description: The current state of the deal.
        Type:
          $ref: '#/components/schemas/DealType'
          description: The type of deal — what it offers.
        Scope:
          $ref: '#/components/schemas/DealScope'
          description: What the deal applies to.
        Products:
          type: array
          description: The products this deal applies to, when Scope is PRODUCT.
          items:
            $ref: '#/components/schemas/DealProduct'
        Categories:
          type: string
          nullable: true
          description: Comma-separated list of categories the deal applies to, when Scope is CATEGORY.
          example: ''
        DiscountType:
          type: string
          nullable: true
          description: How the discount is calculated.
          enum:
          - FIXED
          - PERCENT
          - PERCENT_RANGE
          - PERCENT_MAXIMUM
          example: FIXED
        DiscountAmount:
          type: number
          format: decimal
          nullable: true
          description: The flat discount amount, when DiscountType is FIXED.
          example: '5.00'
        DiscountCurrency:
          type: string
          nullable: true
          description: Three-letter ISO 4217 currency code for the discount amount.
          example: USD
        DiscountPercent:
          type: number
          format: float
          nullable: true
          description: The discount percentage, when DiscountType is PERCENT.
          example: ''
        DiscountMaximumPercent:
          type: number
          format: float
          nullable: true
          description: The maximum discount percentage, when DiscountType is PERCENT_MAXIMUM.
          example: ''
        DiscountPercentRangeStart:
          type: number
          format: float
          nullable: true
          description: The lower bound of the discount range, when DiscountType is PERCENT_RANGE.
          example: ''
        DiscountPercentRangeEnd:
          type: number
          format: float
          nullable: true
          description: The upper bound of the discount range, when DiscountType is PERCENT_RANGE.
          example: ''
        Gift:
          type: string
          nullable: true
          description: The gift offered, when Type is GIFT_WITH_PURCHASE.
          example: ''
        RebateAmount:
          type: number
          format: decimal
          nullable: true
          description: The rebate amount, when Type is REBATE.
          example: ''
        RebateCurrency:
          type: string
          nullable: true
          description: Three-letter ISO 4217 currency code for the rebate amount.
          example: ''
        DefaultPromoCode:
          type: string
          description: The default promo code partners can promote for this deal.
          example: APlusAnvils
        MinimumPurchaseAmount:
          type: number
          format: decimal
          nullable: true
          description: The minimum order amount required for the deal to apply.
          example: ''
        MinimumPurchaseAmountCurrency:
          type: string
          nullable: true
          description: Three-letter ISO 4217 currency code for the minimum purchase amount.
          example: ''
        MaximumSavingsAmount:
          type: number
          format: decimal
          nullable: true
          description: The maximum total savings the deal can apply to a single order.
          example: ''
        MaximumSavingsCurrency:
          type: string
          nullable: true
          description: Three-letter ISO 4217 currency code for the maximum savings amount.
          example: ''
        BogoBuyQuantity:
          type: integer
          description: Quantity the customer must buy in a BOGO deal.
          example: 0
        BogoBuyScope:
          type: string
          nullable: true
          description: Whether the "buy" requirement is a specific product or category in a BOGO deal.
          enum:
          - PRODUCT
          - CATEGORY
          example: ''
        BogoBuyName:
          type: string
          description: Name of the item the customer must buy in a BOGO deal.
          example: ''
        BogoBuyImageUrl:
          type: string
          format: uri
          description: Image URL of the "buy" item in a BOGO deal.
          example: ''
        BogoGetQuantity:
          type: integer
          description: Quantity the customer receives in a BOGO deal.
          example: 0
        BogoGetScope:
          type: string
          nullable: true
          description: Whether the "get" item is a specific product or category in a BOGO deal.
          enum:
          - PRODUCT
          - CATEGORY
          example: ''
        BogoGetDiscountType:
          type: string
          nullable: true
          description: How the discount on the "get" item is calculated in a BOGO deal.
          enum:
          - FREE
          - AMOUNT
          - PERCENT
          example: ''
        BogoGetName:
          type: string
          description: Name of the item the customer receives in a BOGO deal.
          example: ''
        BogoGetImageUrl:
          type: string
          format: uri
          description: Image URL of the "get" item in a BOGO deal.
          example: ''
        BogoGetDiscountAmount:
          type: number
          format: decimal
          nullable: true
          description: The flat discount amount on the "get" item in a BOGO deal.
          example: ''
        BogoGetDiscountCurrency:
          type: string
          nullable: true
          description: Three-letter ISO 4217 currency code for the BOGO get discount amount.
          example: ''
        BogoGetDiscountPercent:
          type: number
          format: float
          nullable: true
          description: The discount percentage on the "get" item in a BOGO deal.
          example: ''
        PurchaseLimitQuantity:
          type: integer
          description: Maximum number of times the deal can be applied per order.
          example: 0
        StartDate:
          type: string
          format: date-time
          nullable: true
          description: The date and time the deal becomes active.
          example: ''
        EndDate:
          type: string
          format: date-time
          nullable: true
          description: The date and time the deal expires.
          example: ''
        SynchAdsPromoCodes:
          type: boolean
          description: Whether to synchronize promo codes with ads.
          example: false
        RestrictedMediaPartners:
          type: array
          description: Partner IDs that are restricted from promoting this deal.
          items:
            type: string
        RestrictedMediaPartnerGroups:
          type: array
          description: Partner group IDs that are restricted from promoting this deal.
          items:
            type: string
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this deal in the impact.com API.
          example: /Advertisers/<AccountSID>/Deals/00003
    DealProduct:
      type: object
      properties:
        ProductName:
          type: string
          description: The name of the product.
          example: Gray Anvil
        ProductImageUrl:
          type: string
          format: uri-reference
          description: URL of the product image.
          example: /images/Gray_Anvil.png
        ProductBeforePriceAmount:
          type: number
          format: decimal
          description: The product's price before the deal is applied.
          example: '50.00'
        ProductBeforePriceCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the before-price amount.
          example: USD
        ProductAfterPriceAmount:
          type: number
          format: decimal
          description: The product's price after the deal is applied.
          example: '45.00'
        ProductAfterPriceCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the after-price amount.
          example: USD
    DealCreate:
      type: object
      required:
      - CampaignId
      - Name
      - Scope
      - Type
      properties:
        CampaignId:
          type: integer
          description: The unique identifier of the campaign the deal belongs to.
          example: 10000
        Name:
          type: string
          description: The display name of the deal.
          example: AcmeDeal3
        Scope:
          $ref: '#/components/schemas/DealScope'
          description: What the deal applies to.
        Type:
          $ref: '#/components/schemas/DealType'
          description: The type of deal.
        Description:
          type: string
          description: A description of the deal that may be shown to partners.
          example: 10% off Acme tennis balls
        StartDate:
          type: string
          format: date-time
          description: The date and time the deal becomes active.
          example: '2026-01-01T00:00:00-08:00'
        EndDate:
          type: string
          format: date-time
          description: The date and time the deal expires.
          example: '2026-12-31T23:59:59-08:00'
        DefaultPromoCode:
          type: string
          description: The default promo code partners can promote for this deal.
          example: APlusAnvils
        SynchAdsPromoCodes:
          type: boolean
          description: Whether to synchronize promo codes with ads.
          example: false
        DiscountType:
          type: string
          description: How the discount is calculated.
          enum:
          - FIXED
          - PERCENT
          - PERCENT_RANGE
          - PERCENT_MAXIMUM
          example: FIXED
        DiscountAmount:
          type: number
          format: decimal
          description: The flat discount amount, when DiscountType is FIXED.
          example: 5.0
        DiscountCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the discount amount.
          example: USD
        Gift:
          type: string
          description: The gift offered, when Type is GIFT_WITH_PURCHASE.
        RebateAmount:
          type: number
          format: decimal
          description: The rebate amount, when Type is REBATE.
          example: 0.0
        RebateCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the rebate amount.
          example: USD
        BogoBuyQuantity:
          type: integer
          description: Quantity the customer must buy in a BOGO deal.
          example: 0
        BogoBuyScope:
          type: string
          description: Whether the "buy" requirement is a specific product or category.
          enum:
          - PRODUCT
          - CATEGORY
          example: PRODUCT
    DealUpdate:
      type: object
      properties:
        Description:
          type: string
          description: A description of the deal that may be shown to partners.
          example: Updated description.
        StartDate:
          type: string
          format: date-time
          description: The date and time the deal becomes active.
          example: '2026-01-01T00:00:00-08:00'
        EndDate:
          type: string
          format: date-time
          description: The date and time the deal expires.
          example: '2026-12-31T23:59:59-08:00'
        Name:
          type: string
          description: The display name of the deal.
          example: AcmeDeal3
        SynchAdsPromoCodes:
          type: boolean
          description: Whether to synchronize promo codes with ads.
          example: false
        DealScope:
          type: string
          description: 'To what extent the deal applies to the store. Enum values: `PRODUCT`, `CATEGORY`, `ENTIRE_STORE`.'
        DiscountType:
          type: string
          description: 'What kind of discount a consumer receives. Use only if `DealType=GENERAL_SALE`. Enum values: `FIXED`, `PERCENT`, `PERCENT_RANGE`, `PERCENT_MAXIMUM`.'
        DiscountAmount:
          type: number
          format: decimal
          description: Deal's discount amount. Required when `DiscountType=FIXED`.
        DiscountPercent:
          type: number
          format: float
          description: Deal's discount percent. Required when `DiscountType=PERCENT`.
        DiscountPercentRangeStart:
          type: number
          format: float
          description: Beginning of the discount range. Required when `DiscountType=PERCENT_RANGE`.
        DiscountPercentRangeEnd:
          type: number
          format: float
          description: End of the discount range. Required when `DiscountType=PERCENT_RANGE`.
        DiscountMaximumPercent:
          type: number
          format: float
          description: Maximum discount percent. Required when `DiscountType=PERCENT_MAXIMUM`.
        Gift:
          type: string
          description: Name of the gift that comes with a purchase. Required when `DealType=GIFT_WITH_PURCHASE`.
        RebateAmount:
          type: number
          format: decimal
          description: Purchase rebate amount. Required when `DealType=REBATE`.
        BogoBuyName:
          type: string
          description: Name of the "buy" product. Required when `DealType=BOGO`.
        BogoBuyQuantity:
          type: integer
          description: '"Buy" product quantity available. Required when `DealType=BOGO`.'
        BogoBuyScope:
          type: string
          description: '"Buy" product scope. Required when `DealType=BOGO`. Enum values: `PRODUCT`, `CATEGORY`.'
        BogoBuyImageFileName:
          type: string
          description: URL to the "buy" product's image. Used when `DealType=BOGO`.
        BogoGetName:
          type: string
          description: '"Get" product name. Required when `DealType=BOGO`.'
        BogoGetQuantity:
          type: integer
          description: '"Get" product quantity available. Required when `DealType=BOGO`.'
        BogoGetScope:
          type: string
          description: '"Get" product scope. Required when `DealType=BOGO`. Enum values: `PRODUCT`, `CATEGORY`.'
        BogoGetDiscountType:
          type: string
          description: '"Get" product discount type. Required when `DealType=BOGO`. Enum values: `FREE`, `AMOUNT`, `PERCENT`.'
        BogoGetDiscountAmount:
          type: number
          format: decimal
          description: '"Get" product discount amount. Required when `DealType=BOGO` and `BogoGetDiscountType=AMOUNT`.'
        BogoGetDiscountPercent:
          type: number
          format: float
          description: '"Get" product discount percentage. Required when `DealType=BOGO` and `BogoGetDiscountType=PERCENT`.'
        BogoGetImageFileName:
          type: string
          description: URL to the "get" product's image. Used when `DealType=BOGO`.
        ProductName:
          type: string
          description: Product's name. Required when `DealScope=PRODUCT`.
        ProductFileName:
          type: string
          description: Product's image file name. Used when `DealScope=PRODUCT`.
        RegularPrice:
          type: number
          format: decimal
          description: Product's original price. Used when `DealScope=PRODUCT`.
        DealPrice:
          type: number
          format: decimal
          description: Product's deal price. Used when `DealScope=PRODUCT`.
        PurchaseLimitQuantity:
          type: integer
          description: Maximum quantity of "buy" product purchasable in one transaction. Enter `0` for no limit. Used when `DealScope=PRODUCT`.
        Categories:
          type: string
          description: Comma-separated list of deal categories. Used when `DealScope=CATEGORY`.
      description: "Fields available for updating an existing deal. All fields are optional; only provided fields are updated.\n\n**Note:** The following fields appear on the deal object but **cannot be updated via API** — they are managed in the impact.com platform: `Seasonal`, `DealType`, `DefaultPromoCode`, `MinimumPurchaseAmount`, `MaximumSavingsAmount`, `LimitedTimeDeal`, `RestrictedMediaPartners`, `RestrictedMediaPartnerGroups`."
    DealState:
      type: string
      enum:
      - ACTIVE
      - EXPIRED
      - PENDING
      example: ACTIVE
    DealType:
      type: string
      enum:
      - GENERAL_SALE
      - FREE_SHIPPING
      - GIFT_WITH_PURCHASE
      - REBATE
      - BOGO
      example: GENERAL_SALE
    DealScope:
      type: string
      enum:
      - CATEGORY
      - ENTIRE_STORE
      - PRODUCT
      example: PRODUCT
    SuccessUriResponse:
      type: object
      properties:
        Status:
          type: string
          description: Indicates whether the operation was successful.
          example: OK
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to the affected deal.
          example: /Advertisers/<AccountSID>/Deals/00003
