/** * Pipedrive API v2 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosInstance } from 'axios'; import { RequestArgs, BaseAPI } from '../base'; import { AddAdditionalDiscountRequestBody } from '../models'; import { AddAdditionalDiscountResponse } from '../models'; import { AddConvertDealToLeadResponse } from '../models'; import { AddDealFollowerRequest } from '../models'; import { AddDealRequest } from '../models'; import { AddFollowerResponse } from '../models'; import { DeleteAdditionalDiscountResponse } from '../models'; import { DeleteDealResponse } from '../models'; import { DeleteFollowerResponse } from '../models'; import { GetAdditionalDiscountsResponse } from '../models'; import { GetConvertResponse1 } from '../models'; import { GetDealSearchResponse } from '../models'; import { GetDealsResponse } from '../models'; import { GetFollowerChangelogsResponse } from '../models'; import { GetFollowersResponse } from '../models'; import { UpdateAdditionalDiscountRequestBody } from '../models'; import { UpdateAdditionalDiscountResponse } from '../models'; import { UpdateDealRequest } from '../models'; import { UpsertDealResponse } from '../models'; /** * DealsApi - axios parameter creator * @export */ export declare const DealsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Adds a new deal. * @summary Add a new deal * @param {AddDealRequest} [AddDealRequest] * @throws {RequiredError} */ addDeal: (AddDealRequest?: AddDealRequest) => Promise; /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal * @param {number} id The ID of the deal * @param {AddDealFollowerRequest} [AddDealFollowerRequest] * @throws {RequiredError} */ addDealFollower: (id: number, AddDealFollowerRequest?: AddDealFollowerRequest) => Promise; /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead * @param {number} id The ID of the deal to convert * @throws {RequiredError} */ convertDealToLead: (id: number) => Promise; /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal * @param {number} id The ID of the deal * @param {string} discount_id The ID of the discount * @throws {RequiredError} */ deleteAdditionalDiscount: (id: number, discount_id: string) => Promise; /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal * @param {number} id The ID of the deal * @throws {RequiredError} */ deleteDeal: (id: number) => Promise; /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal * @param {number} id The ID of the deal * @param {number} follower_id The ID of the following user * @throws {RequiredError} */ deleteDealFollower: (id: number, follower_id: number) => Promise; /** * Lists discounts attached to a deal. * @summary List discounts added to a deal * @param {number} id The ID of the deal * @throws {RequiredError} */ getAdditionalDiscounts: (id: number) => Promise; /** * Returns data about all archived deals. * @summary Get all archived deals * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getArchivedDeals: (filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, limit?: number, cursor?: string) => Promise; /** * Returns the details of a specific deal. * @summary Get details of a deal * @param {number} id The ID of the deal * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @throws {RequiredError} */ getDeal: (id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean) => Promise; /** * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Deal conversion status * @param {number} id The ID of a deal * @param {string} conversion_id The ID of the conversion * @throws {RequiredError} */ getDealConversionStatus: (id: number, conversion_id: string) => Promise; /** * Lists users who are following the deal. * @summary List followers of a deal * @param {number} id The ID of the deal * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDealFollowers: (id: number, limit?: number, cursor?: string) => Promise; /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal * @param {number} id The ID of the deal * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDealFollowersChangelog: (id: number, limit?: number, cursor?: string) => Promise; /** * Returns data about all not archived deals. * @summary Get all deals * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDeals: (filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string) => Promise; /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal * @param {number} id The ID of the deal * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody] * @throws {RequiredError} */ postAdditionalDiscount: (id: number, AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody) => Promise; /** * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ searchDeals: (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string) => Promise; /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal * @param {number} id The ID of the deal * @param {string} discount_id The ID of the discount * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] * @throws {RequiredError} */ updateAdditionalDiscount: (id: number, discount_id: string, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody) => Promise; /** * Updates the properties of a deal. * @summary Update a deal * @param {number} id The ID of the deal * @param {UpdateDealRequest} [UpdateDealRequest] * @throws {RequiredError} */ updateDeal: (id: number, UpdateDealRequest?: UpdateDealRequest) => Promise; }; /** * DealsApi - functional programming interface * @export */ export declare const DealsApiFp: (configuration?: Configuration) => { /** * Adds a new deal. * @summary Add a new deal * @param {AddDealRequest} [AddDealRequest] * @throws {RequiredError} */ addDeal(AddDealRequest?: AddDealRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal * @param {number} id The ID of the deal * @param {AddDealFollowerRequest} [AddDealFollowerRequest] * @throws {RequiredError} */ addDealFollower(id: number, AddDealFollowerRequest?: AddDealFollowerRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead * @param {number} id The ID of the deal to convert * @throws {RequiredError} */ convertDealToLead(id: number): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal * @param {number} id The ID of the deal * @param {string} discount_id The ID of the discount * @throws {RequiredError} */ deleteAdditionalDiscount(id: number, discount_id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal * @param {number} id The ID of the deal * @throws {RequiredError} */ deleteDeal(id: number): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal * @param {number} id The ID of the deal * @param {number} follower_id The ID of the following user * @throws {RequiredError} */ deleteDealFollower(id: number, follower_id: number): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Lists discounts attached to a deal. * @summary List discounts added to a deal * @param {number} id The ID of the deal * @throws {RequiredError} */ getAdditionalDiscounts(id: number): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns data about all archived deals. * @summary Get all archived deals * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getArchivedDeals(filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, limit?: number, cursor?: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns the details of a specific deal. * @summary Get details of a deal * @param {number} id The ID of the deal * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @throws {RequiredError} */ getDeal(id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Deal conversion status * @param {number} id The ID of a deal * @param {string} conversion_id The ID of the conversion * @throws {RequiredError} */ getDealConversionStatus(id: number, conversion_id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Lists users who are following the deal. * @summary List followers of a deal * @param {number} id The ID of the deal * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDealFollowers(id: number, limit?: number, cursor?: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal * @param {number} id The ID of the deal * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDealFollowersChangelog(id: number, limit?: number, cursor?: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns data about all not archived deals. * @summary Get all deals * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} [include_fields] Optional comma separated string array of additional fields to include * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @param {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ getDeals(filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal * @param {number} id The ID of the deal * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody] * @throws {RequiredError} */ postAdditionalDiscount(id: number, AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ searchDeals(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal * @param {number} id The ID of the deal * @param {string} discount_id The ID of the discount * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] * @throws {RequiredError} */ updateAdditionalDiscount(id: number, discount_id: string, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Updates the properties of a deal. * @summary Update a deal * @param {number} id The ID of the deal * @param {UpdateDealRequest} [UpdateDealRequest] * @throws {RequiredError} */ updateDeal(id: number, UpdateDealRequest?: UpdateDealRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; }; /** * DealsApi - factory interface * @export */ export declare const DealsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Adds a new deal. * @summary Add a new deal * @param {DealsApiAddDealRequest} requestParameters Request parameters. * @throws {RequiredError} */ addDeal(requestParameters?: DealsApiAddDealRequest): Promise; /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal * @param {DealsApiAddDealFollowerRequest} requestParameters Request parameters. * @throws {RequiredError} */ addDealFollower(requestParameters: DealsApiAddDealFollowerRequest): Promise; /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead * @param {DealsApiConvertDealToLeadRequest} requestParameters Request parameters. * @throws {RequiredError} */ convertDealToLead(requestParameters: DealsApiConvertDealToLeadRequest): Promise; /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal * @param {DealsApiDeleteAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} */ deleteAdditionalDiscount(requestParameters: DealsApiDeleteAdditionalDiscountRequest): Promise; /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal * @param {DealsApiDeleteDealRequest} requestParameters Request parameters. * @throws {RequiredError} */ deleteDeal(requestParameters: DealsApiDeleteDealRequest): Promise; /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal * @param {DealsApiDeleteDealFollowerRequest} requestParameters Request parameters. * @throws {RequiredError} */ deleteDealFollower(requestParameters: DealsApiDeleteDealFollowerRequest): Promise; /** * Lists discounts attached to a deal. * @summary List discounts added to a deal * @param {DealsApiGetAdditionalDiscountsRequest} requestParameters Request parameters. * @throws {RequiredError} */ getAdditionalDiscounts(requestParameters: DealsApiGetAdditionalDiscountsRequest): Promise; /** * Returns data about all archived deals. * @summary Get all archived deals * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters. * @throws {RequiredError} */ getArchivedDeals(requestParameters?: DealsApiGetArchivedDealsRequest): Promise; /** * Returns the details of a specific deal. * @summary Get details of a deal * @param {DealsApiGetDealRequest} requestParameters Request parameters. * @throws {RequiredError} */ getDeal(requestParameters: DealsApiGetDealRequest): Promise; /** * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Deal conversion status * @param {DealsApiGetDealConversionStatusRequest} requestParameters Request parameters. * @throws {RequiredError} */ getDealConversionStatus(requestParameters: DealsApiGetDealConversionStatusRequest): Promise; /** * Lists users who are following the deal. * @summary List followers of a deal * @param {DealsApiGetDealFollowersRequest} requestParameters Request parameters. * @throws {RequiredError} */ getDealFollowers(requestParameters: DealsApiGetDealFollowersRequest): Promise; /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal * @param {DealsApiGetDealFollowersChangelogRequest} requestParameters Request parameters. * @throws {RequiredError} */ getDealFollowersChangelog(requestParameters: DealsApiGetDealFollowersChangelogRequest): Promise; /** * Returns data about all not archived deals. * @summary Get all deals * @param {DealsApiGetDealsRequest} requestParameters Request parameters. * @throws {RequiredError} */ getDeals(requestParameters?: DealsApiGetDealsRequest): Promise; /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal * @param {DealsApiPostAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} */ postAdditionalDiscount(requestParameters: DealsApiPostAdditionalDiscountRequest): Promise; /** * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {DealsApiSearchDealsRequest} requestParameters Request parameters. * @throws {RequiredError} */ searchDeals(requestParameters: DealsApiSearchDealsRequest): Promise; /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal * @param {DealsApiUpdateAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} */ updateAdditionalDiscount(requestParameters: DealsApiUpdateAdditionalDiscountRequest): Promise; /** * Updates the properties of a deal. * @summary Update a deal * @param {DealsApiUpdateDealRequest} requestParameters Request parameters. * @throws {RequiredError} */ updateDeal(requestParameters: DealsApiUpdateDealRequest): Promise; }; /** * Request parameters for addDeal operation in DealsApi. * @export * @interface DealsApiAddDealRequest */ export interface DealsApiAddDealRequest { /** * * @type {AddDealRequest} * @memberof DealsApiAddDeal */ readonly AddDealRequest?: AddDealRequest; } /** * Request parameters for addDealFollower operation in DealsApi. * @export * @interface DealsApiAddDealFollowerRequest */ export interface DealsApiAddDealFollowerRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiAddDealFollower */ readonly id: number; /** * * @type {AddDealFollowerRequest} * @memberof DealsApiAddDealFollower */ readonly AddDealFollowerRequest?: AddDealFollowerRequest; } /** * Request parameters for convertDealToLead operation in DealsApi. * @export * @interface DealsApiConvertDealToLeadRequest */ export interface DealsApiConvertDealToLeadRequest { /** * The ID of the deal to convert * @type {number} * @memberof DealsApiConvertDealToLead */ readonly id: number; } /** * Request parameters for deleteAdditionalDiscount operation in DealsApi. * @export * @interface DealsApiDeleteAdditionalDiscountRequest */ export interface DealsApiDeleteAdditionalDiscountRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiDeleteAdditionalDiscount */ readonly id: number; /** * The ID of the discount * @type {string} * @memberof DealsApiDeleteAdditionalDiscount */ readonly discount_id: string; } /** * Request parameters for deleteDeal operation in DealsApi. * @export * @interface DealsApiDeleteDealRequest */ export interface DealsApiDeleteDealRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiDeleteDeal */ readonly id: number; } /** * Request parameters for deleteDealFollower operation in DealsApi. * @export * @interface DealsApiDeleteDealFollowerRequest */ export interface DealsApiDeleteDealFollowerRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiDeleteDealFollower */ readonly id: number; /** * The ID of the following user * @type {number} * @memberof DealsApiDeleteDealFollower */ readonly follower_id: number; } /** * Request parameters for getAdditionalDiscounts operation in DealsApi. * @export * @interface DealsApiGetAdditionalDiscountsRequest */ export interface DealsApiGetAdditionalDiscountsRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiGetAdditionalDiscounts */ readonly id: number; } /** * Request parameters for getArchivedDeals operation in DealsApi. * @export * @interface DealsApiGetArchivedDealsRequest */ export interface DealsApiGetArchivedDealsRequest { /** * If supplied, only deals matching the specified filter are returned * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly filter_id?: number; /** * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @type {string} * @memberof DealsApiGetArchivedDeals */ readonly ids?: string; /** * If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly owner_id?: number; /** * If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly person_id?: number; /** * If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly org_id?: number; /** * If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly pipeline_id?: number; /** * If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly stage_id?: number; /** * Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @type {'open' | 'won' | 'lost' | 'deleted'} * @memberof DealsApiGetArchivedDeals */ readonly status?: 'open' | 'won' | 'lost' | 'deleted'; /** * If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @type {string} * @memberof DealsApiGetArchivedDeals */ readonly updated_since?: string; /** * If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @type {string} * @memberof DealsApiGetArchivedDeals */ readonly updated_until?: string; /** * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @type {'id' | 'update_time' | 'add_time'} * @memberof DealsApiGetArchivedDeals */ readonly sort_by?: 'id' | 'update_time' | 'add_time'; /** * The sorting direction. Supported values: `asc`, `desc`. * @type {'asc' | 'desc'} * @memberof DealsApiGetArchivedDeals */ readonly sort_direction?: 'asc' | 'desc'; /** * Optional comma separated string array of additional fields to include * @type {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} * @memberof DealsApiGetArchivedDeals */ readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'; /** * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @type {string} * @memberof DealsApiGetArchivedDeals */ readonly custom_fields?: string; /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @type {number} * @memberof DealsApiGetArchivedDeals */ readonly limit?: number; /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} * @memberof DealsApiGetArchivedDeals */ readonly cursor?: string; } /** * Request parameters for getDeal operation in DealsApi. * @export * @interface DealsApiGetDealRequest */ export interface DealsApiGetDealRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiGetDeal */ readonly id: number; /** * Optional comma separated string array of additional fields to include * @type {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} * @memberof DealsApiGetDeal */ readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'; /** * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @type {string} * @memberof DealsApiGetDeal */ readonly custom_fields?: string; /** * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @type {boolean} * @memberof DealsApiGetDeal */ readonly include_option_labels?: boolean; /** * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @type {boolean} * @memberof DealsApiGetDeal */ readonly include_labels?: boolean; } /** * Request parameters for getDealConversionStatus operation in DealsApi. * @export * @interface DealsApiGetDealConversionStatusRequest */ export interface DealsApiGetDealConversionStatusRequest { /** * The ID of a deal * @type {number} * @memberof DealsApiGetDealConversionStatus */ readonly id: number; /** * The ID of the conversion * @type {string} * @memberof DealsApiGetDealConversionStatus */ readonly conversion_id: string; } /** * Request parameters for getDealFollowers operation in DealsApi. * @export * @interface DealsApiGetDealFollowersRequest */ export interface DealsApiGetDealFollowersRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiGetDealFollowers */ readonly id: number; /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @type {number} * @memberof DealsApiGetDealFollowers */ readonly limit?: number; /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} * @memberof DealsApiGetDealFollowers */ readonly cursor?: string; } /** * Request parameters for getDealFollowersChangelog operation in DealsApi. * @export * @interface DealsApiGetDealFollowersChangelogRequest */ export interface DealsApiGetDealFollowersChangelogRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiGetDealFollowersChangelog */ readonly id: number; /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @type {number} * @memberof DealsApiGetDealFollowersChangelog */ readonly limit?: number; /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} * @memberof DealsApiGetDealFollowersChangelog */ readonly cursor?: string; } /** * Request parameters for getDeals operation in DealsApi. * @export * @interface DealsApiGetDealsRequest */ export interface DealsApiGetDealsRequest { /** * If supplied, only deals matching the specified filter are returned * @type {number} * @memberof DealsApiGetDeals */ readonly filter_id?: number; /** * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. * @type {string} * @memberof DealsApiGetDeals */ readonly ids?: string; /** * If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetDeals */ readonly owner_id?: number; /** * If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetDeals */ readonly person_id?: number; /** * If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetDeals */ readonly org_id?: number; /** * If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetDeals */ readonly pipeline_id?: number; /** * If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. * @type {number} * @memberof DealsApiGetDeals */ readonly stage_id?: number; /** * Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @type {'open' | 'won' | 'lost' | 'deleted'} * @memberof DealsApiGetDeals */ readonly status?: 'open' | 'won' | 'lost' | 'deleted'; /** * If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @type {string} * @memberof DealsApiGetDeals */ readonly updated_since?: string; /** * If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @type {string} * @memberof DealsApiGetDeals */ readonly updated_until?: string; /** * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. * @type {'id' | 'update_time' | 'add_time'} * @memberof DealsApiGetDeals */ readonly sort_by?: 'id' | 'update_time' | 'add_time'; /** * The sorting direction. Supported values: `asc`, `desc`. * @type {'asc' | 'desc'} * @memberof DealsApiGetDeals */ readonly sort_direction?: 'asc' | 'desc'; /** * Optional comma separated string array of additional fields to include * @type {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'} * @memberof DealsApiGetDeals */ readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'; /** * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. * @type {string} * @memberof DealsApiGetDeals */ readonly custom_fields?: string; /** * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id * @type {boolean} * @memberof DealsApiGetDeals */ readonly include_option_labels?: boolean; /** * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @type {boolean} * @memberof DealsApiGetDeals */ readonly include_labels?: boolean; /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @type {number} * @memberof DealsApiGetDeals */ readonly limit?: number; /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} * @memberof DealsApiGetDeals */ readonly cursor?: string; } /** * Request parameters for postAdditionalDiscount operation in DealsApi. * @export * @interface DealsApiPostAdditionalDiscountRequest */ export interface DealsApiPostAdditionalDiscountRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiPostAdditionalDiscount */ readonly id: number; /** * * @type {AddAdditionalDiscountRequestBody} * @memberof DealsApiPostAdditionalDiscount */ readonly AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody; } /** * Request parameters for searchDeals operation in DealsApi. * @export * @interface DealsApiSearchDealsRequest */ export interface DealsApiSearchDealsRequest { /** * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @type {string} * @memberof DealsApiSearchDeals */ readonly term: string; /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @type {'custom_fields' | 'notes' | 'title'} * @memberof DealsApiSearchDeals */ readonly fields?: 'custom_fields' | 'notes' | 'title'; /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @type {boolean} * @memberof DealsApiSearchDeals */ readonly exact_match?: boolean; /** * Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. * @type {number} * @memberof DealsApiSearchDeals */ readonly person_id?: number; /** * Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. * @type {number} * @memberof DealsApiSearchDeals */ readonly organization_id?: number; /** * Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. * @type {'open' | 'won' | 'lost'} * @memberof DealsApiSearchDeals */ readonly status?: 'open' | 'won' | 'lost'; /** * Supports including optional fields in the results which are not provided by default * @type {'deal.cc_email'} * @memberof DealsApiSearchDeals */ readonly include_fields?: 'deal.cc_email'; /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @type {number} * @memberof DealsApiSearchDeals */ readonly limit?: number; /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} * @memberof DealsApiSearchDeals */ readonly cursor?: string; } /** * Request parameters for updateAdditionalDiscount operation in DealsApi. * @export * @interface DealsApiUpdateAdditionalDiscountRequest */ export interface DealsApiUpdateAdditionalDiscountRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiUpdateAdditionalDiscount */ readonly id: number; /** * The ID of the discount * @type {string} * @memberof DealsApiUpdateAdditionalDiscount */ readonly discount_id: string; /** * * @type {UpdateAdditionalDiscountRequestBody} * @memberof DealsApiUpdateAdditionalDiscount */ readonly UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody; } /** * Request parameters for updateDeal operation in DealsApi. * @export * @interface DealsApiUpdateDealRequest */ export interface DealsApiUpdateDealRequest { /** * The ID of the deal * @type {number} * @memberof DealsApiUpdateDeal */ readonly id: number; /** * * @type {UpdateDealRequest} * @memberof DealsApiUpdateDeal */ readonly UpdateDealRequest?: UpdateDealRequest; } /** * DealsApi - object-oriented interface * @export * @class DealsApi * @extends {BaseAPI} */ export declare class DealsApi extends BaseAPI { /** * Adds a new deal. * @summary Add a new deal * @param {DealsApiAddDealRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ addDeal(requestParameters?: DealsApiAddDealRequest): Promise; /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal * @param {DealsApiAddDealFollowerRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ addDealFollower(requestParameters: DealsApiAddDealFollowerRequest): Promise; /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead * @param {DealsApiConvertDealToLeadRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ convertDealToLead(requestParameters: DealsApiConvertDealToLeadRequest): Promise; /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal * @param {DealsApiDeleteAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ deleteAdditionalDiscount(requestParameters: DealsApiDeleteAdditionalDiscountRequest): Promise; /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal * @param {DealsApiDeleteDealRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ deleteDeal(requestParameters: DealsApiDeleteDealRequest): Promise; /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal * @param {DealsApiDeleteDealFollowerRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ deleteDealFollower(requestParameters: DealsApiDeleteDealFollowerRequest): Promise; /** * Lists discounts attached to a deal. * @summary List discounts added to a deal * @param {DealsApiGetAdditionalDiscountsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getAdditionalDiscounts(requestParameters: DealsApiGetAdditionalDiscountsRequest): Promise; /** * Returns data about all archived deals. * @summary Get all archived deals * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getArchivedDeals(requestParameters?: DealsApiGetArchivedDealsRequest): Promise; /** * Returns the details of a specific deal. * @summary Get details of a deal * @param {DealsApiGetDealRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getDeal(requestParameters: DealsApiGetDealRequest): Promise; /** * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Deal conversion status * @param {DealsApiGetDealConversionStatusRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getDealConversionStatus(requestParameters: DealsApiGetDealConversionStatusRequest): Promise; /** * Lists users who are following the deal. * @summary List followers of a deal * @param {DealsApiGetDealFollowersRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getDealFollowers(requestParameters: DealsApiGetDealFollowersRequest): Promise; /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal * @param {DealsApiGetDealFollowersChangelogRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getDealFollowersChangelog(requestParameters: DealsApiGetDealFollowersChangelogRequest): Promise; /** * Returns data about all not archived deals. * @summary Get all deals * @param {DealsApiGetDealsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ getDeals(requestParameters?: DealsApiGetDealsRequest): Promise; /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal * @param {DealsApiPostAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ postAdditionalDiscount(requestParameters: DealsApiPostAdditionalDiscountRequest): Promise; /** * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {DealsApiSearchDealsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ searchDeals(requestParameters: DealsApiSearchDealsRequest): Promise; /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal * @param {DealsApiUpdateAdditionalDiscountRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ updateAdditionalDiscount(requestParameters: DealsApiUpdateAdditionalDiscountRequest): Promise; /** * Updates the properties of a deal. * @summary Update a deal * @param {DealsApiUpdateDealRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof DealsApi */ updateDeal(requestParameters: DealsApiUpdateDealRequest): Promise; }