Keap Free Trial Discounts API
Keap Free Trial Discounts API — 7 operations across 4 paths on the Keap REST v2 contract, read from Keap's own published OpenAPI 3.1 document.
Keap Free Trial Discounts API — 7 operations across 4 paths on the Keap REST v2 contract, read from Keap's own published OpenAPI 3.1 document.
openapi: 3.1.0
info:
title: Keap Free Trial Discounts API
description: Keap Public API Documentation
termsOfService: https://www.thryv.com/terms-of-use
contact:
name: Keap
url: https://developer.keap.com/get-support
email: api.keap@thryv.com
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: v2
servers:
- url: https://api.infusionsoft.com/crm
tags:
- name: Free Trial Discounts
paths:
/rest/v2/discounts/freeTrials:
get:
tags:
- Free Trial Discounts
summary: List all Subscription Free Trial Discounts
description: Retrieves a list of Subscription Free Trial Discounts
operationId: listFreeTrialDiscounts
parameters:
- name: filter
in: query
description: 'Filter to apply, allowed fields are:
- (Integer) `free_trial_days`
- (Boolean) `hide_price`
- (String) `subscription_plan_id`
You will need to apply the `==` operator to check the equality of one of the filters with your
searched
word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples:
- `filter=free_trial_days%3D%3D14`
- `filter=hide_price%3D%3DTrue`
- `filter=subscription_plan_id%3D%3DmySubscriptionPlanId`
- `filter=free_trial_days%3D%3D14%3Bhide_price%3D%3DFalse`
'
required: false
schema:
type: string
- name: page_token
in: query
description: Page token
required: false
schema:
type: string
- name: order_by
in: query
description: 'Attribute and direction to order items.
One of the following fields:
- `free_trial_days`
- `hide_price`
- `id`
- `name`
- `subscription_plan_id`
One of the following directions:
- `asc`
- `desc`'
required: false
schema:
type: string
- name: page_size
in: query
description: Total number of items to return per page
required: false
schema:
type: integer
format: int32
maximum: 1000
minimum: 0
example: 0
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListFreeTrialDiscountsResponse'
post:
tags:
- Free Trial Discounts
summary: Create a Subscription Free Trial Discount
description: Creates a Subscription Free Trial Discount
operationId: createFreeTrialDiscount
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFreeTrialDiscountRequest'
required: true
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/FreeTrialDiscount'
/rest/v2/discounts/freeTrials/{discount_id}/criteria:
post:
tags:
- Free Trial Discounts
summary: Create a Subscription Free Trial Discount Criteria
description: Creates a Subscription Free Trial Discount Criteria
operationId: createFreeTrialDiscountCriteria
parameters:
- name: discount_id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFreeTrialDiscountCriteria'
required: true
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/DiscountCriteria'
/rest/v2/discounts/freeTrials/{discount_id}:
get:
tags:
- Free Trial Discounts
summary: Retrieve a Subscription Free Trial Discount
description: Retrieves a Subscription Free Trial Discount
operationId: getFreeTrialDiscount
parameters:
- name: discount_id
in: path
required: true
schema:
type: string
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FreeTrialDiscount'
delete:
tags:
- Free Trial Discounts
summary: Delete a Subscription Free Trial Discount
description: Deletes a specified Subscription Free Trial Discount
operationId: deleteFreeTrialDiscount
parameters:
- name: discount_id
in: path
required: true
schema:
type: string
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'204':
description: No Content
patch:
tags:
- Free Trial Discounts
summary: Update a Subscription Free Trial Discount
description: Updates a Subscription Free Trial Discount
operationId: updateFreeTrialDiscount
parameters:
- name: discount_id
in: path
required: true
schema:
type: string
- name: update_mask
in: query
description: An optional list of properties to be updated. If set, only the provided properties
will be updated and others will be skipped.
required: false
schema:
type: array
items:
type: string
enum:
- name
- description
- free_trial_days
- hide_price
- subscription_plan_id
- criteria
uniqueItems: true
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateFreeTrialDiscountRequest'
required: true
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FreeTrialDiscount'
/rest/v2/discounts/freeTrials/{discount_id}/criteria/{criteria_id}:
delete:
tags:
- Free Trial Discounts
summary: Delete a Subscription Free Trial Discount Criteria
description: Deletes a specified Subscription Free Trial Discount Criteria
operationId: deleteFreeTrialDiscountCriteria
parameters:
- name: discount_id
in: path
required: true
schema:
type: string
- name: criteria_id
in: path
required: true
schema:
type: string
responses:
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'501':
description: Method Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'405':
description: Method Not Allowed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'204':
description: No Content
components:
schemas:
CreateFreeTrialDiscountCriteria:
type: object
properties:
type:
type: string
description: 'Type of criteria: DATE_RANGE, PROMO_CODE, PRODUCT, SUBSCRIPTION_PLAN, or ORDER_TOTAL'
enum:
- DATE_RANGE
- PROMO_CODE
- PRODUCT
- SUBSCRIPTION_PLAN
- ORDER_TOTAL
example: DATE_RANGE
code:
type: string
description: Promotional code for PROMO_CODE criteria
example: SUMMER2024
range_start_time:
type: string
format: date-time
description: Start date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-01-01T00:00:00Z'
range_end_time:
type: string
format: date-time
description: End date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-12-31T23:59:59Z'
product_id:
type: string
description: Product ID for PRODUCT criteria
example: 456
product_quantity_min:
type: integer
format: int32
description: Minimum product quantity for PRODUCT criteria
example: 1
product_quantity_max:
type: integer
format: int32
description: Maximum product quantity for PRODUCT criteria
example: 10
plan_id:
type: string
description: Subscription plan ID for SUBSCRIPTION_PLAN criteria
example: 789
subscription_quantity:
type: integer
format: int32
description: Subscription quantity for SUBSCRIPTION_PLAN criteria
example: 1
total_amount:
type: number
format: double
description: Total amount threshold for ORDER_TOTAL criteria
example: 100.0
operator:
type: string
description: 'Comparison operator for ORDER_TOTAL criteria: LESS_THAN or GREATER_THAN'
enum:
- LESS_THAN
- GREATER_THAN
example: GREATER_THAN
CreateFreeTrialDiscountRequest:
type: object
properties:
name:
type: string
description: Name of the discount
example: 30-Day Free Trial
description:
type: string
description: Description of the discount
example: Try our premium plan free for 30 days
criteria:
type: array
description: List of criteria that must be met for this discount to apply
items:
$ref: '#/components/schemas/CreateFreeTrialDiscountCriteria'
hide_price:
type: boolean
description: Whether to hide the price during the trial period
example: true
subscription_plan_id:
type: string
description: ID of the subscription plan this trial applies to
example: 789
free_trial_days:
type: integer
format: int32
description: Number of free trial days. Must be a positive number. Defaults to 0.
example: 30
required:
- name
- subscription_plan_id
DiscountCriteria:
type: object
properties:
type:
type: string
description: 'Type of criteria: DATE_RANGE, PROMO_CODE, PRODUCT, SUBSCRIPTION_PLAN, or ORDER_TOTAL'
enum:
- DATE_RANGE
- PROMO_CODE
- PRODUCT
- SUBSCRIPTION_PLAN
- ORDER_TOTAL
example: DATE_RANGE
code:
type: string
description: Promotional code for PROMO_CODE criteria
example: SUMMER2024
criteria_id:
type: string
description: Unique identifier for this criteria
example: 501
range_start_time:
type: string
format: date-time
description: Start date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-01-01T00:00:00Z'
range_end_time:
type: string
format: date-time
description: End date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-12-31T23:59:59Z'
product_id:
type: string
description: Product ID for PRODUCT criteria
example: 456
product_quantity_min:
type: integer
format: int32
description: Minimum product quantity for PRODUCT criteria
example: 1
product_quantity_max:
type: integer
format: int32
description: Maximum product quantity for PRODUCT criteria
example: 10
plan_id:
type: string
description: Subscription plan ID for SUBSCRIPTION_PLAN criteria
example: 789
subscription_quantity:
type: integer
format: int32
description: Subscription quantity for SUBSCRIPTION_PLAN criteria
example: 1
total_amount:
type: number
format: double
description: Total amount threshold for ORDER_TOTAL criteria
example: 100.0
operator:
type: string
description: 'Comparison operator for ORDER_TOTAL criteria: LESS_THAN or GREATER_THAN'
enum:
- LESS_THAN
- GREATER_THAN
example: GREATER_THAN
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
status:
type: string
details:
type: array
items:
$ref: '#/components/schemas/ErrorDetails'
ErrorDetails:
type: object
properties:
domain:
type: string
resource:
type: string
FreeTrialDiscount:
type: object
properties:
id:
type: string
description: Unique identifier for this free trial discount
example: 104
name:
type: string
description: Name of the discount
example: 30-Day Free Trial
description:
type: string
description: Description of the discount
example: Try our premium plan free for 30 days
criteria:
type: array
description: List of criteria that must be met for this discount to apply
items:
$ref: '#/components/schemas/FreeTrialDiscountCriteriaResponse'
hide_price:
type: boolean
description: Whether to hide the price during the trial period
example: true
subscription_plan_id:
type: string
description: ID of the subscription plan this trial applies to
example: 789
free_trial_days:
type: integer
format: int32
description: Number of days for the free trial period
example: 30
FreeTrialDiscountCriteriaResponse:
type: object
properties:
type:
type: string
description: 'Type of criteria: DATE_RANGE, PROMO_CODE, PRODUCT, SUBSCRIPTION_PLAN, or ORDER_TOTAL'
enum:
- DATE_RANGE
- PROMO_CODE
- PRODUCT
- SUBSCRIPTION_PLAN
- ORDER_TOTAL
example: DATE_RANGE
code:
type: string
description: Promotional code for PROMO_CODE criteria
example: SUMMER2024
criteria_id:
type: string
description: Unique identifier for this criteria
example: 501
range_start_time:
type: string
format: date-time
description: Start date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-01-01T00:00:00Z'
range_end_time:
type: string
format: date-time
description: End date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-12-31T23:59:59Z'
product_id:
type: string
description: Product ID for PRODUCT criteria
example: 456
product_quantity_min:
type: integer
format: int32
description: Minimum product quantity for PRODUCT criteria
example: 1
product_quantity_max:
type: integer
format: int32
description: Maximum product quantity for PRODUCT criteria
example: 10
plan_id:
type: string
description: Subscription plan ID for SUBSCRIPTION_PLAN criteria
example: 789
subscription_quantity:
type: integer
format: int32
description: Subscription quantity for SUBSCRIPTION_PLAN criteria
example: 1
total_amount:
type: number
format: double
description: Total amount threshold for ORDER_TOTAL criteria
example: 100.0
operator:
type: string
description: 'Comparison operator for ORDER_TOTAL criteria: LESS_THAN or GREATER_THAN'
enum:
- LESS_THAN
- GREATER_THAN
example: GREATER_THAN
ListFreeTrialDiscountsResponse:
type: object
properties:
discounts:
type: array
items:
$ref: '#/components/schemas/FreeTrialDiscount'
next_page_token:
type: string
UpdateFreeTrialDiscountCriteria:
type: object
properties:
type:
type: string
description: 'Type of criteria: DATE_RANGE, PROMO_CODE, PRODUCT, SUBSCRIPTION_PLAN, or ORDER_TOTAL'
enum:
- DATE_RANGE
- PROMO_CODE
- PRODUCT
- SUBSCRIPTION_PLAN
- ORDER_TOTAL
example: DATE_RANGE
code:
type: string
description: Promotional code for PROMO_CODE criteria
example: SUMMER2024
criteria_id:
type: string
description: Unique identifier for this criteria
example: 501
range_start_time:
type: string
format: date-time
description: Start date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-01-01T00:00:00Z'
range_end_time:
type: string
format: date-time
description: End date/time for DATE_RANGE criteria (ISO-8601 format)
example: '2024-12-31T23:59:59Z'
product_id:
type: string
description: Product ID for PRODUCT criteria
example: 456
product_quantity_min:
type: integer
format: int32
description: Minimum product quantity for PRODUCT criteria
example: 1
product_quantity_max:
type: integer
format: int32
description: Maximum product quantity for PRODUCT criteria
example: 10
plan_id:
type: string
description: Subscription plan ID for SUBSCRIPTION_PLAN criteria
example: 789
subscription_quantity:
type: integer
format: int32
description: Subscription quantity for SUBSCRIPTION_PLAN criteria
example: 1
total_amount:
type: number
format: double
description: Total amount threshold for ORDER_TOTAL criteria
example: 100.0
operator:
type: string
description: 'Comparison operator for ORDER_TOTAL criteria: LESS_THAN or GREATER_THAN'
enum:
- LESS_THAN
- GREATER_THAN
example: GREATER_THAN
required:
- criteria_id
UpdateFreeTrialDiscountRequest:
type: object
properties:
name:
type: string
description: Name of the discount
example: 30-Day Free Trial
description:
type: string
description: Description of the discount
example: Try our premium plan free for 30 days
criteria:
type: array
description: List of criteria that must be met for this discount to apply
items:
$ref: '#/components/schemas/UpdateFreeTrialDiscountCriteria'
free_trial_days:
type: integer
format: int32
description: Number of free trial days
example: 30
hide_price:
type: boolean
description: Whether to hide the price during the trial period
example: true
subscription_plan_id:
type: string
description: ID of the subscription plan this trial applies to
example: 789
securitySchemes:
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://accounts.infusionsoft.com/app/oauth/authorize
tokenUrl: https://api.infusionsoft.com/token
scopes: {}
security:
- oauth2: []