Associates

using DirectScale.Disco.Extension.Hooks.Associates;

GetSecondaryTitle

Get the Associate's Secondary title that shows on their Detail page

public class GetSecondaryTitle : IHook<GetSecondaryTitleHookRequest, GetSecondaryTitleHookResponse>
{
  public GetSecondaryTitle() { }
  
  public GetSecondaryTitleHookResponse Invoke(GetSecondaryTitleHookRequest request, Func<GetSecondaryTitleHookRequest, GetSecondaryTitleHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetSecondaryTitleHookRequest, GetSecondaryTitleHookResponse>, GetSecondaryTitle>();
{
  "AssociateId": 0
}
{
  "Title": "string",
}


GetAssociateServiceAutoshipSettings

Enables the service to automatically create an AutoShip. For example, you can set the default shipping method and it allows you to change what item gets set to AutoShip.

public class GetAssociateServiceAutoshipSettings : IHook<GetAssociateServiceAutoshipSettingsHookRequest, GetAssociateServiceAutoshipSettingsHookResponse>
{
  public GetAssociateServiceAutoshipSettings() { }
  
  public GetAssociateServiceAutoshipSettingsHookResponse Invoke(GetAssociateServiceAutoshipSettingsHookRequest request, Func<GetAssociateServiceAutoshipSettingsHookRequest, GetAssociateServiceAutoshipSettingsHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetAssociateServiceAutoshipSettingsHookRequest, GetAssociateServiceAutoshipSettingsHookResponse>, GetAssociateServiceAutoshipSettings>();
{
  "AssociateId": 0,
  "Service": {
    "SubscriptionId": 0,
    "ItemId": 0,
    "Period": 0,
    "PeriodType": 0,
    "GracePeriod": 0,
    "CreateAutoship": false,
    "YearlyRenewal": false
  }
}
{
  "AutoshipSettings": {
    "ShipMethodId": 0,
    "OverriddenAutoshipItemId": 0
  }
}


OnNotificationEvent

Override the Log Notification Event that sends emails through Corporate Admin.

public class OnNotificationEvent : IHook<OnNotificationEventHookRequest, OnNotificationEventHookResponse>
{
  public OnNotificationEvent() { }
  
  public OnNotificationEventHookResponse Invoke(OnNotificationEventHookRequest request, Func<OnNotificationEventHookRequest, OnNotificationEventHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<OnNotificationEventHookRequest, OnNotificationEventHookResponse>, OnNotificationEvent>();
{
  "Notification": {
    "AssociateId": 0,
    "EventType": 0,
    "EventValue": {},
    "EntryDate": "0001-01-01T00:00:00",
    "EventDate": "0001-01-01T00:00:00"
  }
}
{
  "NotificationEvent": {
    "SendEmail": false,
    "EmailAddress": "string",
    "Subject": "string",
    "Body": "string"
  }
}


UpdateAssociate

Override editing an Associate record. By default, the Edit Associate page validates, updates the record, and notifies the system of the change.

⚠Do not remove the asterisk (*) from the Tax field.

public class UpdateAssociate : IHook<UpdateAssociateHookRequest, UpdateAssociateHookResponse>
{
  public UpdateAssociate() { }
  
  public UpdateAssociateHookResponse Invoke(UpdateAssociateHookRequest request, Func<UpdateAssociateHookRequest, UpdateAssociateHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<UpdateAssociateHookRequest, UpdateAssociateHookResponse>, UpdateAssociate>();
{
  "OldAssociateInfo": {
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "Address": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "AcceptTerms": false,
    "AssociateBaseType": 0,
    "AssociateType": 0,
    "PriceGroup": 0,
    "AssociateTypeName": "string",
    "BackOfficeId": "string",
    "BirthDate": "0001-01-01T00:00:00",
    "CompanyName": "string",
    "DormantDate": "0001-01-01T00:00:00",
    "EmailAddress": "string",
    "Name": "string string",
    "DisplayFirstName": "string",
    "DisplayLastName": "string",
    "LegalFirstName": "string",
    "LegalLastName": "string",
    "RomanizedFirstName": "string",
    "RomanizedLastName": "string",
    "PrimaryPhone": "string",
    "SecondaryPhone": "string",
    "LanguageCode": "string",
    "ShipAttention": "string",
    "ShipPhone": "string",
    "SignupDate": "0001-01-01T00:00:00",
    "UpgradeDate": "0001-01-01T00:00:00",
    "SignupMethod": "string",
    "TaxExempt": false,
    "TaxId": "string",
    "TaxResaleNo": "string",
    "TeamId": 0,
    "TextNumber": "string",
    "ExternalId": "string",
    "StatusId": 0,
    "Void": false,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    }
  },
  "UpdatedAssociateInfo": {
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "Address": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "AcceptTerms": false,
    "AssociateBaseType": 0,
    "AssociateType": 0,
    "PriceGroup": 0,
    "AssociateTypeName": "string",
    "BackOfficeId": "string",
    "BirthDate": "0001-01-01T00:00:00",
    "CompanyName": "string",
    "DormantDate": "0001-01-01T00:00:00",
    "EmailAddress": "string",
    "Name": "string string",
    "DisplayFirstName": "string",
    "DisplayLastName": "string",
    "LegalFirstName": "string",
    "LegalLastName": "string",
    "RomanizedFirstName": "string",
    "RomanizedLastName": "string",
    "PrimaryPhone": "string",
    "SecondaryPhone": "string",
    "LanguageCode": "string",
    "ShipAttention": "string",
    "ShipPhone": "string",
    "SignupDate": "0001-01-01T00:00:00",
    "UpgradeDate": "0001-01-01T00:00:00",
    "SignupMethod": "string",
    "TaxExempt": false,
    "TaxId": "string",
    "TaxResaleNo": "string",
    "TeamId": 0,
    "TextNumber": "string",
    "ExternalId": "string",
    "StatusId": 0,
    "Void": false,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    }
  }
}
{}


GetAssociateTreeLabel

Override the Corporate Admin Associate's Tree labels and colors.

The default labels and colors are set to:

  • Active - #F0AD4E
  • Nonactive - #D9534F
  • Retail - #15A7B4
public class GetAssociateTreeLabel : IHook<GetAssociateTreeLabelHookRequest, GetAssociateTreeLabelHookResponse>
{
  public GetAssociateTreeLabel() { }
  
  public GetAssociateTreeLabelHookResponse Invoke(GetAssociateTreeLabelHookRequest request, Func<GetAssociateTreeLabelHookRequest, GetAssociateTreeLabelHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetAssociateTreeLabelHookRequest, GetAssociateTreeLabelHookResponse>, GetAssociateTreeLabel>();
{
  "Associate": {
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "Address": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "AcceptTerms": false,
    "AssociateBaseType": 0,
    "AssociateType": 0,
    "PriceGroup": 0,
    "AssociateTypeName": "string",
    "BackOfficeId": "string",
    "BirthDate": "0001-01-01T00:00:00",
    "CompanyName": "string",
    "DormantDate": "0001-01-01T00:00:00",
    "EmailAddress": "string",
    "Name": "string string",
    "DisplayFirstName": "string",
    "DisplayLastName": "string",
    "LegalFirstName": "string",
    "LegalLastName": "string",
    "RomanizedFirstName": "string",
    "RomanizedLastName": "string",
    "PrimaryPhone": "string",
    "SecondaryPhone": "string",
    "LanguageCode": "string",
    "ShipAttention": "string",
    "ShipPhone": "string",
    "SignupDate": "0001-01-01T00:00:00",
    "UpgradeDate": "0001-01-01T00:00:00",
    "SignupMethod": "string",
    "TaxExempt": false,
    "TaxId": "string",
    "TaxResaleNo": "string",
    "TeamId": 0,
    "TextNumber": "string",
    "ExternalId": "string",
    "StatusId": 0,
    "Void": false,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    }
  },
  "CommissionStats": null
}
{
  "TreeLabel": "string"
}


GetAssociatesStats

Gets multiple Associate stats for a period.

public class GetAssociatesStats : IHook<GetAssociatesStatsHookRequest, GetAssociatesStatsHookResponse>
{
  public GetAssociatesStats() { }
  
  public GetAssociatesStatsHookResponse Invoke(GetAssociatesStatsHookRequest request, Func<GetAssociatesStatsHookRequest, GetAssociatesStatsHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetAssociatesStatsHookRequest, GetAssociatesStatsHookResponse>, GetAssociatesStats>();
{
  "AssociateIds": null,
  "Date": "0001-01-01T00:00:00"
}
{
  "Stats": null
}


GetCommissionChecks

Hook for getting the summary of commission checks for a particular commission period. A commission check is the total amount paid on that commission run. It's usually done electronically, but some clients could choose to print these checks.

public class GetCommissionChecks : IHook<GetCommissionChecksHookRequest, GetCommissionChecksHookResponse>
{
  public GetCommissionChecks() { }
  
  public GetCommissionChecksHookResponse Invoke(GetCommissionChecksHookRequest request, Func<GetCommissionChecksHookRequest, GetCommissionChecksHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetCommissionChecksHookRequest, GetCommissionChecksHookResponse>, GetCommissionChecks>();
{
  "AssociateId": 0,
  "PaymentTypeFilter": [],
  "PageSize": 0,
  "PageNumber": 0
}
{
  "Checks": [],
  "TotalChecks": 0,
  "PaymentTypeFilters": []
}


GetCommissionCheckDetails

Hook for getting the detail for a particular commission check.

public class GetCommissionCheckDetails : IHook<GetCommissionCheckDetailsHookRequest, GetCommissionCheckDetailsHookResponse>
{
  public GetCommissionCheckDetails() { }
  
  public GetCommissionCheckDetailsHookResponse Invoke(GetCommissionCheckDetailsHookRequest request, Func<GetCommissionCheckDetailsHookRequest, GetCommissionCheckDetailsHookResponse> func)      
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetCommissionCheckDetailsHookRequest, GetCommissionCheckDetailsHookResponse>, GetCommissionCheckDetails>();
{
  "TransactionNumber": "string"
}
{
  "DatePaid": "0001-01-01T00:00:00",
  "MerchantId": 0,
  "TransactionNumber": "string",
  "CheckNumber": 0,
  "AmountPaid": 0.0,
  "AssociateId": 0,
  "Details": []
}


UpdateAux

Hook for updating auxiliary Associate data, such as the Webalias, AboutMe, SocialInfo and CorporateCommunication.

public class UpdateAux : IHook<UpdateAuxHookRequest, UpdateAuxHookResponse>
{
  public UpdateAux() { }
  
  public UpdateAuxHookResponse Invoke(UpdateAuxHookRequest request, Func<UpdateAuxHookRequest, UpdateAuxHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<UpdateAuxHookRequest, UpdateAuxHookResponse>, UpdateAux>();
{
  "UpdatedAssociateAuxInfo": {
    "AboutMe": "string",
    "AssociateId": 0,
    "CorporateCommunication": false,
    "CorporateCommunicationText": false,
    "Username": "string",
    "Webalias": "string",
    "Social" : {
       "AssociateId": 0,
       "Facebook": "string",
       "LinkedIn": "string",
       "Pinterest": "string",
       "Twitter": "string",
       "YoutTube": "string"
      }
   }
}
{}


UpdateVolume

Hook for when the volume is updated in the system for a specific Associate.

public class UpdateAssociateStats : IHook<UpdateVolumeHookRequest, UpdateVolumeHookResponse>
{
  public UpdateAssociateStats() { }
  
  public UpdateVolumeHookResponse Invoke(UpdateVolumeHookRequest request, Func<UpdateVolumeHookRequest, UpdateVolumeHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<UpdateVolumeHookRequest, UpdateVolumeHookResponse>, UpdateAssociateStats>();
{
  "VolumeSource": {
    "ProcessTime": "0001-01-01T00:00:00",
    "AssociateId": 0,
    "SourceDate":  "0001-01-01T00:00:00",
    "CorporateCommunicationText": false,
    "SourceId": 0,
    "Webalias": "string",
   }
}
{}


GetUsername

using DirectScale.Disco.Extension.Hooks;

public class GetUsername : IHook<GetUsernameHookRequest, GetUsernameHookResponse>
    {
        public GetUsername() { }

        public GetUsernameHookResponse Invoke(GetUsernameHookRequest request, Func<GetUsernameHookRequest, GetUsernameHookResponse> func)
        {
            return func(request);
        }
    }
services.AddTransient<IHook<GetUsernameHookRequest, GetUsernameHookResponse>, GetUsername>();
{
  "Username": "string"
}
{
  "Username": "string"
}