Configure onDealCreate and onDealUpdate

Marketplace Platform v2.3 deprecation:We’re continuing to improve the Marketplace Platform to deliver stronger security, better performance, and new capabilities. As part of this evolution, Marketplace Platform v2.3 will be deprecated. To learn the dates and next steps, see Migration guide.

onDealCreate

When a deal is created, the onDealCreate event is invoked and the registered callback method is executed.

Subscribe to the onDealCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onDealCreate": {
    "handler": "onDealCreateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onDealCreateCallback: function(payload) {
    console.log("Logging arguments from onDealCreate event: " + JSON.stringify(payload));
    }
  }

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onDealCreate event.

    • created_atstring

      Timestamp of when the actor is created in the Freshsales Suite system, specified in the UTC format.

    • deal_pipeline_idinteger

      Identifier of deal pipelines that the actor is part of.

    • emailstring

      Email address of the actor.

    • idinteger

      Identifier associated with the actor.

    • is_activeboolean

      Specifies whether the actor is verified.

      Possible values: true, false

    • is_forgottenboolean

      Specifies whether the specified data is deleted permanently from the Freshsales Suite system.

      Possible values: true, false

    • job_titlestring

      Designation of the actor.

    • languagestring

      Language of the actor; by default, language is en.

    • mobile_numberinteger

      Phone number of the actor.

    • namestring

      Name of the actor.

    • time_zonestring

      Time zone of the actor, specified in the UTC format.

    • typestring

      Category of the actor created.

    • updated_atstring

      Timestamp of when the actor is updated in the Freshsales Suite system, specified in the UTC format.

      For onContactCreate, this attribute value is the same as created_at.

    • uuidstring

      Universally unique identifier of the actor.

    • work_numberinteger

      Official phone number of the actor.

  • associationsobject

    All associated objects of the deal object, which specify additional information pertaining to the deal created.

    • campaignstring

      UTM campaign.

    • contactsarray

      Contacts associated with this deal.

    • creatorobject

      Details of the deal creator.

      • created_atstring

        Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.

      • deal_pipeline_idinteger

        Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.

        Identifier of the pipeline associated with the deal.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshsales Suite system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshsales Suite system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshsales Suite system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • currencyobject

      Details of the deal currency.

    • deal_payment_statusstring

      Status of the deal payment.

    • deal_pipelineobject

      Information pertaining to the deal pipeline.

    • deal_productstring

      Name of the product that the deal is associated with.

    • deal_reasonstring

      Reason why the deal was lost.

    • deal_stageobject

      Information pertaining to the deal stage.

    • deal_typestring

      Type of the deal.

    • ownerobject

      Details of the contact owner.

      • created_atstring

        Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.

      • deal_pipeline_idinteger

        Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.

        Identifier of the pipeline associated with the deal.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshsales Suite system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshsales Suite system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshsales Suite system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • productsarray

      Products associated with this deal.

    • sales_accountsarray of integers

      Sales accounts of the contact.

    • sourcestring

      Source details of the deal.

    • team_usersarray

      Collaborators who worked on a task related to the deal.

    • territorystring

      Location associated with the deal.

    • updaterobject

      Details of the deal updater. For the onDealCreate event, this value is null.

  • dealobject

    Details of the deal object created when the onDealCreate event is triggered.

    • active_sales_sequencesobject

      Active sales campaigns that this deal was part of.

    • ageobject

      Time elapsed (in days) since the creation of the deal.

    • amountobject

      Value of the deal.

    • base_currency_amountobject

      Deal amount converted to the base currency configured by admin.

    • campaign_idobject

      Identifier of the UTM campaign.

    • closed_dateobject

      Closed date of the deal.

    • completed_sales_sequencesobject

      Completed sales sequences that this deal was part of.

    • contact_idsarray

      Identifiers of contacts associated with this deal.

    • created_atobject

      Created timestamp.

    • creator_idobject

      Identifier of the user who initiated the deal.

    • currency_idobject

      Identifier of the currency associated with the deal.

    • custom_fieldsarray of strings

      Key value pairs containing the names and values of custom fields.

    • deal_payment_status_idobject

      Identifier of the deal payment status.

    • deal_pipeline_idinteger

      Identifier of the deal pipeline.

    • deal_prediction_tagobject

      Identifier of the user who updated the deal.

    • deal_product_idobject

      Identifier of the product that the deal is associated with.

    • deal_reason_idobject

      Identifier of the reason why the deal was lost.

    • deal_stage_idobject

      Identifier of the deal stage.

    • deal_type_idobject

      Identifier of the deal type.

    • expected_closeobject

      Expected close date of the deal.

    • expected_deal_valueobject

      Expected deal amount.

    • first_assigned_atobject

      First assigned timestamp of the deal.

    • idinteger

      Identifier of the deal.

    • import_csv_idobject

      Reference of all imports that this deal was part of.

    • import_idstring

      Identifier of the equivalent record in the external system from which it was imported.

    • is_deletedboolean

      Specifies whether the deal is deleted.

      Possible values: true, false

    • last_assigned_atobject

      Last assigned timestamp.

    • last_contacted_sales_activity_modeobject

      Last mode of sales activity rendered for the deal.

    • last_contacted_via_sales_activityobject

      Last contacted timestamp (through sales activity).

    • lead_source_idinteger

      Identifier of the source of the deal.

    • lost_fromstring

      Stage where the deal was lost.

    • nameobject

      Name of the deal.

    • owner_idobject

      User who owns the record.

    • probabilityinteger

      Probability of closing the deal.

    • product_idsarray

      Identifiers of products associated with this deal.

    • recent_noteobject

      Recently added note against the deal.

    • sales_account_idobject

      Identifier of the sales account associated with this deal.

    • source_additional_infoarray

      Meta information specified as a custom JSON object.

    • stage_updated_timeobject

      Timestamp when the deal stage was updated.

    • tagsobject

      Tags associated with this deal.

    • team_user_idsarray

      Identifiers of the collaborators who work on a task associated with the deal.

    • territory_idobject

      Identifier of the territory.

    • upcoming_activities_timeobject

      Timestamp for the next scheduled activity.

    • updated_atobject

      Updated timestamp.

    • updater_idobject

      Identifier of the user who updated the deal.

    • web_form_idobject

      Form through which this deal was captured.

    • won_fromobject

      Stage from which deal was won.

onDealUpdate

When a deal is updated, the onDealUpdate event is invoked and the registered callback method is executed.

Subscribe to the onDealUpdate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onDealUpdate": {
    "handler": "onDealUpdateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onDealUpdateCallback: function(payload) {
    console.log("Logging arguments from onDealUpdate event: " + JSON.stringify(payload));
    }
  }

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onDealUpdate event.

    • created_atstring

      Timestamp of when the actor is created in the Freshsales Suite system, specified in the UTC format.

    • deal_pipeline_idinteger

      Identifier of deal pipelines that the actor is part of.

    • emailstring

      Email address of the actor.

    • idinteger

      Identifier associated with the actor.

    • is_activeboolean

      Specifies whether the actor is verified.

      Possible values: true, false

    • is_forgottenboolean

      Specifies whether the specified data is deleted permanently from the Freshsales Suite system.

      Possible values: true, false

    • job_titlestring

      Designation of the actor.

    • languagestring

      Language of the actor; by default, language is en.

    • mobile_numberinteger

      Phone number of the actor.

    • namestring

      Name of the actor.

    • time_zonestring

      Time zone of the actor, specified in the UTC format.

    • typestring

      Category of the actor created.

    • updated_atstring

      Timestamp of when the actor is updated in the Freshsales Suite system, specified in the UTC format.

      For onContactCreate, this attribute value is the same as created_at.

    • uuidstring

      Universally unique identifier of the actor.

    • work_numberinteger

      Official phone number of the actor.

  • associationsobject

    All associated objects of the deal object, which specify additional information pertaining to the deal updated.

    • campaignstring

      UTM campaign.

    • contactsarray

      Contacts associated with this deal.

    • creatorobject

      Details of the deal creator.

      • created_atstring

        Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.

      • deal_pipeline_idinteger

        Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.

        Identifier of the pipeline associated with the deal.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshsales Suite system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshsales Suite system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshsales Suite system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • currencyobject

      Details of the deal currency.

    • deal_payment_statusstring

      Status of the deal payment.

    • deal_pipelineobject

      Information pertaining to the deal pipeline.

    • deal_productstring

      Name of the product that the deal is associated with.

    • deal_reasonstring

      Reason why the deal was lost.

    • deal_stageobject

      Information pertaining to the deal stage.

    • deal_typestring

      Type of the deal.

    • ownerobject

      Details of the deal owner.

      • created_atstring

        Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.

      • deal_pipeline_idinteger

        Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.

        Identifier of the pipeline associated with the deal.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshsales Suite system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshsales Suite system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshsales Suite system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • productsarray

      Products associated with this deal.

    • sales_accountsarray of integers

      Sales accounts of the contact.

    • sourcestring

      Source details of the deal.

    • team_usersarray

      Collaborators who worked on a task related to the deal.

    • territorystring

      Location associated with the deal.

    • updaterobject

      Details of the deal updater. For the onDealCreate event, this value is null.

      • created_atstring

        Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.

      • deal_pipeline_idinteger

        Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.

        Identifier of the pipeline associated with the deal.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshsales Suite system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshsales Suite system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshsales Suite system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • changesobject

      Information pertaining to the deal whose details are modified in the Freshsales Suite system.

      Changes that triggered the onDealUpdate event, specified as a JSON object of the following format:

      "changes": {
        "misc_changes": {},
        "model_changes": {
          //For non-array attributes
          "<deal.attribute that changed>": ["Old value", "New value"]
        },
        "system_changes": {}
      }
      • misc_changesobject

        List of all miscellaneous database parameters whose values have changed, along with the old and modified values.

      • model_changesobject

        List of all attributes whose values have changed, along with the old and modified values of the attributes.

      • system_changesobject

        List of all system-level parameters whose values have changed, along with the old and modified values.

    • dealobject

      Details of the deal object created when the onDealUpdate event is triggered.

      • active_sales_sequencesobject

        Active sales campaigns that this deal was part of.

      • ageobject

        Time elapsed (in days) since the creation of the deal.

      • amountobject

        Value of the deal.

      • base_currency_amountobject

        Deal amount converted to the base currency configured by admin.

      • campaign_idobject

        Identifier of the UTM campaign.

      • closed_dateobject

        Closed date of the deal.

      • completed_sales_sequencesobject

        Completed sales sequences that this deal was part of.

      • contact_idsarray

        Identifiers of contacts associated with this deal.

      • created_atobject

        Created timestamp.

      • creator_idobject

        Identifier of the user who initiated the deal.

      • currency_idobject

        Identifier of the currency associated with the deal.

      • custom_fieldsarray of strings

        Key value pairs containing the names and values of custom fields.

      • deal_payment_status_idobject

        Identifier of the deal payment status.

      • deal_pipeline_idinteger

        Identifier of the deal pipeline.

      • deal_prediction_tagobject

        Identifier of the user who updated the deal.

      • deal_product_idobject

        Identifier of the product that the deal is associated with.

      • deal_reason_idobject

        Identifier of the reason why the deal was lost.

      • deal_stage_idobject

        Identifier of the deal stage.

      • deal_type_idobject

        Identifier of the deal type.

      • expected_closeobject

        Expected close date of the deal.

      • expected_deal_valueobject

        Expected deal amount.

      • first_assigned_atobject

        First assigned timestamp of the deal.

      • idinteger

        Identifier of the deal.

      • import_csv_idobject

        Reference of all imports that this deal was part of.

      • import_idstring

        Identifier of the equivalent record in the external system from which it was imported.

      • is_deletedboolean

        Specifies whether the deal is deleted.

        Possible values: true, false

      • last_assigned_atobject

        Last assigned timestamp.

      • last_contacted_sales_activity_modeobject

        Last mode of sales activity rendered for the deal.

      • last_contacted_via_sales_activityobject

        Last contacted timestamp (through sales activity).

      • lead_source_idinteger

        Identifier of the source of the deal.

      • lost_fromstring

        Stage where the deal was lost.

      • nameobject

        Name of the deal.

      • owner_idobject

        User who owns the record.

      • probabilityinteger

        Probability of closing the deal.

      • product_idsarray

        Identifiers of products associated with this deal.

      • recent_noteobject

        Recently added note against the deal.

      • sales_account_idobject

        Identifier of the sales account associated with this deal.

      • source_additional_infoarray

        Meta information specified as a custom JSON object.

      • stage_updated_timeobject

        Timestamp when the deal stage was updated.

      • tagsobject

        Tags associated with this deal.

      • team_user_idsarray

        Identifiers of the collaborators who work on a task associated with the deal.

      • territory_idobject

        Identifier of the territory.

      • upcoming_activities_timeobject

        Timestamp for the next scheduled activity.

      • updated_atobject

        Updated timestamp.

      • updater_idobject

        Identifier of the user who updated the deal.

      • web_form_idobject

        Form through which this deal was captured.

      • won_fromobject

        Stage from which deal was won.