AutoShips

using DirectScale.Disco.Extension.Hooks.Autoships;

ApplyAutoshipCouponCodes

Get Coupon codes that can be applied to a particular AutoShip order. Called when an AutoShip is processing.

public class ApplyAutoshipCouponCodes : IHook<ApplyAutoshipCouponCodesHookRequest, ApplyAutoshipCouponCodesHookResponse>
{
  public ApplyAutoshipCouponCodes() { }
  
  public ApplyAutoshipCouponCodesHookResponse Invoke(ApplyAutoshipCouponCodesHookRequest request, Func<ApplyAutoshipCouponCodesHookRequest, ApplyAutoshipCouponCodesHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<ApplyAutoshipCouponCodesHookRequest, ApplyAutoshipCouponCodesHookResponse>, ApplyAutoshipCouponCodes>();
{
  "Order": {
    "AssociateId": 0,
    "ShipToName": "string",
    "Attention": "string",
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "InvoiceDate": "0001-01-01T00:00:00",
    "CommissionDate": "0001-01-01T00:00:00",
    "ShipByDate": "0001-01-01T00:00:00",
    "ShipMethodId": 0,
    "WarehouseId": 0,
    "ShipPhone": "string",
    "PartyId": 0,
    "SpecialInstructions": "string",
    "OrderType": 0,
    "AssociateType": 0,
    "StoreId": 0,
    "CurrencyCode": "string",
    "CouponCodes": null,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "ShipTaxOverride": {
      "Shipping": 0.0,
      "Tax": 0.0,
      "HasShippingOverride": false,
      "HasTaxOverride": false
    },
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    }
  },
  "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"
    }
  },
  "OrderCoupons": null
}
{
  "CouponCodes": null
}


GetAutoships

Return all or just certain types of AutoShips. By default, the system gets all AutoShips except yearly renewals.

public class GetAutoships : IHook<GetAutoshipsHookRequest, GetAutoshipsHookResponse>
{
  public GetAutoships() { }
    
  public GetAutoshipsHookResponse Invoke(GetAutoshipsHookRequest request, Func<GetAutoshipsHookRequest, GetAutoshipsHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetAutoshipsHookRequest, GetAutoshipsHookResponse>, GetAutoships>();
{
  "AssociateId": 0,
  "IncludeServiceAutoships": false
}
{
  "Autoships": [
    {
      "AutoshipId": 0,
      "AssociateId": 0,
      "ShipAddress": {
        "Id": 0,
        "AddressLine1": "string",
        "AddressLine2": "string",
        "AddressLine3": "string",
        "City": "string",
        "State": "string",
        "PostalCode": "string",
        "CountryCode": "string"
      },
      "StartDate": "0001-01-01T00:00:00",
      "Frequency": 0,
      "LastProcessDate": "0001-01-01T00:00:00",
      "NextProcessDate": "0001-01-01T00:00:00",
      "LastChargeAmount": 0.0,
      "Status": "string",
      "ShipMethodId": 0,
      "PaymentMethodId": "string",
      "PaymentMerchantId": 0,
      "Custom": {
        "Field1": "string",
        "Field2": "string",
        "Field3": "string",
        "Field4": "string",
        "Field5": "string"
      },
      "AutoshipType": 0,
      "LineItems": [
        {
          "ItemId": 0,
          "Quantity": 0.0,
          "Cost": 0.0,
          "Disabled": false,
          "ExtendedPrice": 0.0,
          "ExtendedOriginalPrice": 0.0,
          "ExtendedBonus": 0.0,
          "ExtendedCV": 0.0,
          "ExtendedQV": 0.0,
          "ExtendedRewardPoints": 0.0,
          "ExtendedCost": 0.0,
          "ProductName": "string",
          "Description": "string",
          "Specifications": "string",
          "LanguageCode": "string",
          "SKU": "string",
          "Category": {
            "Id": 0,
            "Name": "string",
            "CategoryTranslations": [],
            "Description": "string",
            "DisplayIndex": 0.0,
            "ImageUrl": "string",
            "ParentId": 0,
            "ProductLineId": 0,
            "ShortDescription": "string",
            "StoreIds": [],
            "HasChildren": false
          },
          "ChargeShipping": false,
          "Height": 0.0,
          "Image": "string",
          "Length": 0.0,
          "LengthUOM": "string",
          "MPN": "string",
          "PackCount": 0.0,
          "PackageGroupId": 0,
          "TaxClassId": 0,
          "UnitOfMeasure": "string",
          "UPC": "string",
          "Weight": 0.0,
          "WeightUOM": "string",
          "Width": 0.0,
          "FlagBirthDefects": false,
          "HasKitGroups": false,
          "FlagCancer": false,
          "PriceGroup": 0,
          "Custom": {
            "Field1": "string",
            "Field2": "string",
            "Field3": "string",
            "Field4": "string",
            "Field5": "string"
          },
          "Images": [
            {
              "Description": "string",
              "Path": "string"
            }
          ],
          "Prices": [
            {
              "GroupId": 0,
              "Price": 0.0,
              "PriceCurrency": "string",
              "OriginalPrice": 0.0,
              "Bonus": 0.0,
              "CV": 0.0,
              "QV": 0.0,
              "RewardPoints": 0.0
            }
          ],
          "Options": [
            {
              "OptionId": 0,
              "Option": "string"
            }
          ],
          "ItemOptions": [
            {
              "OptionId": 0,
              "Option": "string",
              "OptionType": 0,
              "Values": [
                {
                  "Option": "string",
                  "SkuExt": "string"
                }
              ]
            }
          ],
          "Languages": [
            {
              "Description": "string",
              "LanguageCode": "string",
              "ProductName": "string",
              "SEOKeywords": "string",
              "Specifications": "string"
            }
          ],
          "OptionsMap": [
            {
              "Key": "string",
              "Checked": false,
              "ItemId": 0,
              "Image": "string",
              "ExtSku": "string"
            }
          ],
          "HasOptions": false,
          "Price": 0.0,
          "PriceCurrency": "string",
          "OriginalPrice": 0.0,
          "Bonus": 0.0,
          "CV": 0.0,
          "QV": 0.0,
          "RewardPoints": 0.0,
          "CouponsBeingUsed": 0,
          "PriceGroups": [
            0
          ]
        }
      ],
      "FrequencyString": "string",
      "TotalCV": 0.0,
      "TotalQV": 0.0,
      "CurrencyCode": "string",
      "SubTotal": 0.0
    }
  ]
}


GetAutoshipBackupPayment

A way for the AutoShip system to find a payment method, if there isn't one in the AutoShip order.

public class GetAutoshipBackupPayment : IHook<GetAutoshipBackupPaymentHookRequest, GetAutoshipBackupPaymentHookResponse>
 {
  public GetAutoshipBackupPayment() { }

  public GetAutoshipBackupPaymentHookResponse Invoke(GetAutoshipBackupPaymentHookRequest request, Func<GetAutoshipBackupPaymentHookRequest, GetAutoshipBackupPaymentHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<GetAutoshipBackupPaymentHookRequest, GetAutoshipBackupPaymentHookResponse>, GetAutoshipBackupPayment>();
{
  "AssociateId": 0,
  "BackupMerchantId": 0
}
{
  "PaymentMethod": {
    "PaymentId": 0,
    "PaymentMethodId": "string",
    "MerchantId": 0,
    "CurrencyCode": "string",
    "Name": "string",
    "Ending": "string",
    "Expires": "0001-01-01T00:00:00",
    "NameOnAccount": "string",
    "IconClass": "string",
    "CanDelete": false,
    "ProfileType": 0,
    "CanGetBalance": false,
    "AssociateId": 0
  }
}


CancelAutoship

Define ways to cancel AutoShips.

public class CancelAutoship : IHook<CancelAutoshipHookRequest, CancelAutoshipHookResponse>
{
  public CancelAutoship() { }
  
  public CancelAutoshipHookResponse Invoke(CancelAutoshipHookRequest request, Func<CancelAutoshipHookRequest, CancelAutoshipHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<CancelAutoshipHookRequest, CancelAutoshipHookResponse>, CancelAutoship>();
{
  "AutoshipInfo": {
    "AutoshipId": 0,
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "StartDate": "0001-01-01T00:00:00",
    "Frequency": 0,
    "LastProcessDate": "0001-01-01T00:00:00",
    "NextProcessDate": "0001-01-01T00:00:00",
    "LastChargeAmount": 0.0,
    "Status": "string",
    "ShipMethodId": 0,
    "PaymentMethodId": "string",
    "PaymentMerchantId": 0,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "AutoshipType": 0,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "FrequencyString": "string",
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "CurrencyCode": "string",
    "SubTotal": 0.0
  },
  "Message": "string"
}
{ }


ShouldRetryAutoshipOrder

Tells the system how often and for how long you should keep trying to charge an AutoShip order. For example, you can set it to try every five days for the next two months. The default range is the day after and the next two days from that.

public class ShouldRetryAutoshipOrder : IHook<ShouldRetryAutoshipOrderHookRequest, ShouldRetryAutoshipOrderHookResponse>
{
  public ShouldRetryAutoshipOrder() { }
  
  public ShouldRetryAutoshipOrderHookResponse Invoke(ShouldRetryAutoshipOrderHookRequest request, Func<ShouldRetryAutoshipOrderHookRequest, ShouldRetryAutoshipOrderHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<ShouldRetryAutoshipOrderHookRequest, ShouldRetryAutoshipOrderHookResponse>, ShouldRetryAutoshipOrder>();
{
  "RetryDate": "0001-01-01T00:00:00",
  "Order": {
    "BackofficeId": "string",
    "LastModifiedDate": "0001-01-01T00:00:00",
    "BillPhone": "string",
    "CommissionDate": "0001-01-01T00:00:00",
    "AssociateId": 0,
    "Email": "string",
    "InvoiceDate": "0001-01-01T00:00:00",
    "LocalInvoiceNumber": 0,
    "Name": "string",
    "OrderDate": "0001-01-01T00:00:00",
    "OrderType": 0,
    "OrderNumber": 0,
    "SpecialInstructions": "string",
    "Status": "string",
    "TotalBonus": 0.0,
    "TotalCost": 0.0,
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "Void": false,
    "BillAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "PartyId": 0,
    "IsPaid": false,
    "IsShipped": false,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "CanRerun": false,
    "LineItems": [],
    "Packages": [],
    "Totals": [],
    "Payments": [],
    "OrderCoupons": [],
    "USDSubTotal": 0.0,
    "USDTotal": 0.0,
    "IsMoveable": {
      "IsOrderMovable": false,
      "MessageType": 0,
      "Message": "string"
    }
  },
  "Autoship": {
    "AutoshipId": 0,
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "StartDate": "0001-01-01T00:00:00",
    "Frequency": 0,
    "LastProcessDate": "0001-01-01T00:00:00",
    "NextProcessDate": "0001-01-01T00:00:00",
    "LastChargeAmount": 0.0,
    "Status": "string",
    "ShipMethodId": 0,
    "PaymentMethodId": "string",
    "PaymentMerchantId": 0,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "AutoshipType": 0,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "FrequencyString": "string",
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "CurrencyCode": "string",
    "SubTotal": 0.0
  }
}
{
  "RetryRule": {
    "Charge": false,
    "AssociateStatusId": 0,
    "SendEmail": null,
    "Cancel": null,
    "NotificationCount": null
  }
}


ShouldChargeAutoship

Determine when an Associate's AutoShip should create an order. For example, you can create logic so AutoShips doesn't get created on the last day of the period. By default, AutoShip's NextProcessDate is less than or equal to today.

public class ShouldChargeAutoship : IHook<ShouldChargeAutoshipHookRequest, ShouldChargeAutoshipHookResponse>
{
  public ShouldChargeAutoship() { }
    
  public ShouldChargeAutoshipHookResponse Invoke(ShouldChargeAutoshipHookRequest request, Func<ShouldChargeAutoshipHookRequest, ShouldChargeAutoshipHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<ShouldChargeAutoshipHookRequest, ShouldChargeAutoshipHookResponse>, ShouldChargeAutoship>();
{
  "Now": "0001-01-01T00:00:00",
  "Autoship": {
    "AutoshipId": 0,
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "StartDate": "0001-01-01T00:00:00",
    "Frequency": 0,
    "LastProcessDate": "0001-01-01T00:00:00",
    "NextProcessDate": "0001-01-01T00:00:00",
    "LastChargeAmount": 0.0,
    "Status": "string",
    "ShipMethodId": 0,
    "PaymentMethodId": "string",
    "PaymentMerchantId": 0,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "AutoshipType": 0,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "FrequencyString": "string",
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "CurrencyCode": "string",
    "SubTotal": 0.0
  }
}
{
  "RetryRule": {
    "Charge": false,
    "AssociateStatusId": 0,
    "SendEmail": null,
    "Cancel": null,
    "NotificationCount": null
  }
}

Works with:



DailyRun

Runs AutoShips and retries AutoShip orders.

public class DailyRun : IHook<DailyRunHookRequest, DailyRunHookResponse>
{
  public DailyRun() { }
    
  public DailyRunHookResponse Invoke(DailyRunHookRequest request, Func<DailyRunHookRequest, DailyRunHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<DailyRunHookRequest, DailyRunHookResponse>, DailyRun>();

📝Sidenote

The API endpoint /command/Corporate.Company.DailyRun calls the Client Extension DailyRun



CreateAutoship

Hook for the CreateAutoship() function. Used when an AutoShip is created.

public class CreateAutoship : IHook<CreateAutoshipHookRequest, CreateAutoshipHookResponse>
{
  public CreateAutoship() { }

  public CreateAutoshipHookResponse Invoke(CreateAutoshipHookRequest request, Func<CreateAutoshipHookRequest, CreateAutoshipHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<CreateAutoshipHookRequest, CreateAutoshipHookResponse>, CreateAutoship>();
{
  "AutoshipInfo": {
    "AutoshipId": 0,
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "StartDate": "0001-01-01T00:00:00",
    "Frequency": 0,
    "LastProcessDate": "0001-01-01T00:00:00",
    "NextProcessDate": "0001-01-01T00:00:00",
    "LastChargeAmount": 0.0,
    "Status": "string",
    "ShipMethodId": 0,
    "PaymentMethodId": "string",
    "PaymentMerchantId": 0,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "AutoshipType": 0,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "FrequencyString": "string",
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "CurrencyCode": "string",
    "SubTotal": 0.0
  }
}
{
  "AutoshipId": 0
}


UpdateAutoship

Hook for the UpdateAutoship() function. Used when an AutoShip is updated.

public class UpdateAutoship : IHook<UpdateAutoshipHookRequest, UpdateAutoshipHookResponse>
{
  public UpdateAutoship() { }

  public UpdateAutoshipHookResponse Invoke(UpdateAutoshipHookRequest request, Func<UpdateAutoshipHookRequest, UpdateAutoshipHookResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<UpdateAutoshipHookRequest, UpdateAutoshipHookResponse>, UpdateAutoship>();
{
  "AutoshipInfo": {
    "AutoshipId": 0,
    "AssociateId": 0,
    "ShipAddress": {
      "Id": 0,
      "AddressLine1": "string",
      "AddressLine2": "string",
      "AddressLine3": "string",
      "City": "string",
      "State": "string",
      "PostalCode": "string",
      "CountryCode": "string"
    },
    "StartDate": "0001-01-01T00:00:00",
    "Frequency": 0,
    "LastProcessDate": "0001-01-01T00:00:00",
    "NextProcessDate": "0001-01-01T00:00:00",
    "LastChargeAmount": 0.0,
    "Status": "string",
    "ShipMethodId": 0,
    "PaymentMethodId": "string",
    "PaymentMerchantId": 0,
    "Custom": {
      "Field1": "string",
      "Field2": "string",
      "Field3": "string",
      "Field4": "string",
      "Field5": "string"
    },
    "AutoshipType": 0,
    "LineItems": [
      {
        "ItemId": 0,
        "Quantity": 0.0,
        "Cost": 0.0,
        "Disabled": false,
        "ExtendedPrice": 0.0,
        "ExtendedOriginalPrice": 0.0,
        "ExtendedBonus": 0.0,
        "ExtendedCV": 0.0,
        "ExtendedQV": 0.0,
        "ExtendedRewardPoints": 0.0,
        "ExtendedCost": 0.0,
        "ProductName": "string",
        "Description": "string",
        "Specifications": "string",
        "LanguageCode": "string",
        "SKU": "string",
        "Category": {
          "Id": 0,
          "Name": "string",
          "CategoryTranslations": [],
          "Description": "string",
          "DisplayIndex": 0.0,
          "ImageUrl": "string",
          "ParentId": 0,
          "ProductLineId": 0,
          "ShortDescription": "string",
          "StoreIds": [],
          "HasChildren": false
        },
        "ChargeShipping": false,
        "Height": 0.0,
        "Image": "string",
        "Length": 0.0,
        "LengthUOM": "string",
        "MPN": "string",
        "PackCount": 0.0,
        "PackageGroupId": 0,
        "TaxClassId": 0,
        "UnitOfMeasure": "string",
        "UPC": "string",
        "Weight": 0.0,
        "WeightUOM": "string",
        "Width": 0.0,
        "FlagBirthDefects": false,
        "HasKitGroups": false,
        "FlagCancer": false,
        "PriceGroup": 0,
        "Custom": {
          "Field1": "string",
          "Field2": "string",
          "Field3": "string",
          "Field4": "string",
          "Field5": "string"
        },
        "Images": [
          {
            "Description": "string",
            "Path": "string"
          }
        ],
        "Prices": [
          {
            "GroupId": 0,
            "Price": 0.0,
            "PriceCurrency": "string",
            "OriginalPrice": 0.0,
            "Bonus": 0.0,
            "CV": 0.0,
            "QV": 0.0,
            "RewardPoints": 0.0
          }
        ],
        "Options": [
          {
            "OptionId": 0,
            "Option": "string"
          }
        ],
        "ItemOptions": [
          {
            "OptionId": 0,
            "Option": "string",
            "OptionType": 0,
            "Values": [
              {
                "Option": "string",
                "SkuExt": "string"
              }
            ]
          }
        ],
        "Languages": [
          {
            "Description": "string",
            "LanguageCode": "string",
            "ProductName": "string",
            "SEOKeywords": "string",
            "Specifications": "string"
          }
        ],
        "OptionsMap": [
          {
            "Key": "string",
            "Checked": false,
            "ItemId": 0,
            "Image": "string",
            "ExtSku": "string"
          }
        ],
        "HasOptions": false,
        "Price": 0.0,
        "PriceCurrency": "string",
        "OriginalPrice": 0.0,
        "Bonus": 0.0,
        "CV": 0.0,
        "QV": 0.0,
        "RewardPoints": 0.0,
        "CouponsBeingUsed": 0,
        "PriceGroups": [
          0
        ]
      }
    ],
    "FrequencyString": "string",
    "TotalCV": 0.0,
    "TotalQV": 0.0,
    "CurrencyCode": "string",
    "SubTotal": 0.0
  }
}
{
  "AutoshipId": 0
}