openapi: 3.1.0
info:
  title: Brand Deals API
  version: v11
  description: "Manage discounts and promotions partners use for marketing. This API allows for the creation, \nretrieval, updating, and deletion of deals, including BOGO, Free Shipping, and General Sales.\n"
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Deals:
    get:
      operationId: listDeals
      tags:
      - Deals
      summary: List all deals
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: query
        required: false
        description: Filter deals by the associated campaign ID.
        schema:
          type: integer
      - name: Scope
        in: query
        required: false
        description: Filter deals by their scope.
        schema:
          type: string
          enum:
          - PRODUCT
          - CATEGORY
          - ENTIRE_STORE
      - name: State
        in: query
        required: false
        description: Filter deals by their current state.
        schema:
          type: string
          enum:
          - ACTIVE
          - EXPIRED
          - PENDING
      - name: Type
        in: query
        required: false
        description: Filter deals by their type.
        schema:
          type: string
          enum:
          - GENERAL_SALE
          - FREE_SHIPPING
          - GIFT_WITH_PURCHASE
          - REBATE
          - BOGO
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  Deals:
                    type: array
                    description: The list of deal objects.
                    items:
                      $ref: '#/components/schemas/Deal'
    post:
      operationId: createDeal
      tags:
      - Deals
      summary: Create a deal
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealCreate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealStatusResponse'
  /Advertisers/{AccountSID}/Deals/{DealId}:
    get:
      operationId: getDeal
      tags:
      - Deals
      summary: Retrieve a deal
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: DealId
        in: path
        required: true
        description: The unique identifier for the deal.
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
    put:
      operationId: updateDeal
      tags:
      - Deals
      summary: Update a deal
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: DealId
        in: path
        required: true
        description: The unique identifier for the deal.
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealUpdate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealStatusResponse'
    delete:
      operationId: deleteDeal
      tags:
      - Deals
      summary: Delete a deal
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: DealId
        in: path
        required: true
        description: The unique identifier for the deal.
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Indicates that the deal was deleted.
                    example: DELETED
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    Deal:
      type: object
      properties:
        Id:
          type: string
          description: The unique identifier for the deal.
          example: '1'
        Name:
          type: string
          description: The display name of the deal.
          example: AcmeDeal3
        CampaignId:
          type: string
          description: The unique identifier of the campaign the deal belongs to.
          example: '10000'
        State:
          type: string
          description: The current state of the deal.
          enum:
          - ACTIVE
          - EXPIRED
          - PENDING
          example: ACTIVE
        Type:
          type: string
          description: The type of deal — what it offers.
          enum:
          - GENERAL_SALE
          - FREE_SHIPPING
          - GIFT_WITH_PURCHASE
          - REBATE
          - BOGO
          example: GENERAL_SALE
        Scope:
          type: string
          description: What the deal applies to (a category, the entire store, or a specific product).
          enum:
          - CATEGORY
          - ENTIRE_STORE
          - PRODUCT
          example: PRODUCT
        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'
        Categories:
          type: string
          description: Comma-separated list of categories the deal applies to, when `Scope` is `CATEGORY`.
        BogoBuyQuantity:
          type: integer
          description: Quantity the customer must buy in a BOGO deal.
        BogoBuyScope:
          type: string
          description: Whether the "buy" requirement is a specific product or category in a BOGO deal.
        BogoBuyName:
          type: string
          description: Name of the item the customer must buy in a BOGO deal.
        BogoBuyImageUrl:
          type: string
          format: uri
          description: If `Type` is `BOGO`, the "buy" product image URL.
        BogoGetQuantity:
          type: integer
          description: Quantity the customer receives in a BOGO deal.
        BogoGetScope:
          type: string
          description: Whether the "get" item is a specific product or category in a BOGO deal.
        BogoGetDiscountType:
          type: string
          description: How the discount on the "get" item is calculated in a BOGO deal.
        BogoGetName:
          type: string
          description: Name of the item the customer receives in a BOGO deal.
        BogoGetImageUrl:
          type: string
          format: uri
          description: If `Type` is `BOGO`, the "get" product image URL.
        BogoGetDiscountAmount:
          type: number
          format: decimal
          description: Flat discount amount on the "get" item in a BOGO deal.
        BogoGetDiscountCurrency:
          type: string
          description: Currency code for the BOGO get discount amount (ISO 4217).
        BogoGetDiscountPercent:
          type: number
          format: float
          description: Discount percentage on the "get" item in a BOGO deal.
        PurchaseLimitQuantity:
          type: integer
          description: Maximum number of times the deal can be applied per order.
        DateCreated:
          type: string
          format: date-time
          description: Date the deal was created.
        DateLastUpdated:
          type: string
          format: date-time
          description: Date the deal was last updated.
        DiscountType:
          type: string
          description: How the discount is calculated.
          enum:
          - FIXED
          - PERCENT
          - PERCENT_RANGE
          - PERCENT_MAXIMUM
          example: FIXED
        DiscountAmount:
          type: string
          description: The flat discount amount, when DiscountType is FIXED.
          example: '5.00'
        DiscountMaximumPercent:
          type: number
          format: float
          description: Maximum discount percentage, when `DiscountType` is `PERCENT_MAXIMUM`.
        DiscountPercentRangeStart:
          type: number
          format: float
          description: Lower bound of the discount range, when `DiscountType` is `PERCENT_RANGE`.
        DiscountPercentRangeEnd:
          type: number
          format: float
          description: Upper bound of the discount range, when `DiscountType` is `PERCENT_RANGE`.
        DiscountCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the discount amount.
          example: USD
        MinimumPurchaseAmount:
          type: number
          format: decimal
          description: Minimum amount the consumer needs to spend for the deal to apply.
        MinimumPurchaseAmountCurrency:
          type: string
          description: Currency of the deal's minimum purchase amount (ISO 4217).
        MaximumSavingsAmount:
          type: number
          format: decimal
          description: Maximum amount a consumer can save when the deal applies.
        MaximumSavingsCurrency:
          type: string
          description: Currency of the deal's maximum savings (ISO 4217).
        DiscountPercent:
          type: string
          description: The discount percentage, when DiscountType is PERCENT.
          example: ''
        Gift:
          type: string
          description: Gift offered, when `Type` is `GIFT_WITH_PURCHASE`.
        RebateAmount:
          type: number
          format: decimal
          description: Rebate amount, when `Type` is `REBATE`.
        RebateCurrency:
          type: string
          description: Currency of the rebate amount (ISO 4217).
        DefaultPromoCode:
          type: string
          description: Default promo code partners can promote for this deal.
        Products:
          type: array
          description: The products this deal applies to, when Scope is PRODUCT.
          items:
            type: object
            properties:
              ProductName:
                type: string
                description: The name of the product.
              ProductImageURL:
                type: string
                description: URL of the product image.
              ProductBeforePriceAmount:
                type: string
                description: The product's price before the deal is applied.
              ProductAfterPriceAmount:
                type: string
                description: The product's price after the deal is applied.
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this deal in the impact.com API.
          example: /Advertisers/<AccountSID>/Deals/1
    DealCreate:
      type: object
      required:
      - CampaignId
      - Name
      - Scope
      - Type
      properties:
        CampaignId:
          type: string
          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:
          type: string
          description: What the deal applies to.
          example: PRODUCT
        Type:
          type: string
          description: The type of deal.
          example: GENERAL_SALE
        Description:
          type: string
          description: A description of the deal that may be shown to partners.
          example: ''
        StartDate:
          type: string
          description: The date and time the deal becomes active.
          example: ''
        EndDate:
          type: string
          description: The date and time the deal expires.
          example: ''
        DefaultPromoCode:
          type: string
          description: The default promo code partners can promote for this deal.
          example: APlusAnvils
        DiscountType:
          type: string
          description: How the discount is calculated.
          example: FIXED
        DiscountAmount:
          type: string
          description: The flat discount amount, when DiscountType is FIXED.
          example: '5.00'
        DiscountCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the discount amount.
          example: USD
        DiscountPercent:
          type: string
          description: The discount percentage, when DiscountType is PERCENT.
          example: ''
        BogoBuyName:
          type: string
          description: Name of the item the customer must buy in a BOGO deal.
          example: ''
        BogoBuyQuantity:
          type: string
          description: Quantity the customer must buy in a BOGO deal.
          example: '0'
        BogoGetDiscountType:
          type: string
          description: How the discount on the "get" item is calculated in a BOGO deal.
          example: ''
        Gift:
          type: string
          description: The gift offered, when Type is GIFT_WITH_PURCHASE.
          example: ''
        RebateAmount:
          type: string
          description: The rebate amount, when Type is REBATE.
          example: ''
        RebateCurrency:
          type: string
          description: Three-letter ISO 4217 currency code for the rebate amount.
          example: ''
        SynchAdsPromoCodes:
          type: boolean
          description: Whether to synchronize promo codes with ads.
          example: 'false'
    DealUpdate:
      type: object
      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`."
      properties:
        Description:
          type: string
          description: A description of the deal that may be shown to partners.
          example: Updated description.
        StartDate:
          type: string
          description: The date and time the deal becomes active.
          example: '2026-01-01T00:00:00-08:00'
        EndDate:
          type: string
          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`.
    DealStatusResponse:
      type: object
      properties:
        Status:
          type: string
          description: Indicates whether the operation was successful.
          example: OK
        Uri:
          type: string
          description: The unique reference to the affected deal.
          example: /Advertisers/<AccountSID>/Deals/1
