diff --git a/src/OrderCloud.SDK/Generated/Models.cs b/src/OrderCloud.SDK/Generated/Models.cs
index f2faa01..ebdb37e 100644
--- a/src/OrderCloud.SDK/Generated/Models.cs
+++ b/src/OrderCloud.SDK/Generated/Models.cs
@@ -39,12 +39,67 @@ public class AccessTokenBasic : OrderCloudModel
}
public class AddedPromo : OrderCloudModel
{
- /// ID of the added promo. Can only contain characters Aa-Zz, 0-9, -, and _.
- public string ID { get => GetProp("ID"); set => SetProp("ID", value); }
/// ID of the line item. Can only contain characters Aa-Zz, 0-9, -, and _.
public string LineItemID { get => GetProp("LineItemID"); set => SetProp("LineItemID", value); }
/// Amount of the added promo.
public decimal Amount { get => GetProp("Amount"); set => SetProp("Amount", value); }
+ /// ID of the added promo. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 2.
+ public string ID { get => GetProp("ID"); set => SetProp("ID", value); }
+ /// If true, certain eligible expression requirements must be met, and the PromotionDiscount will be applied at the line item level.
+ public bool LineItemLevel { get => GetProp("LineItemLevel"); set => SetProp("LineItemLevel", value); }
+ /// Must be unique. Entered by buyer when adding promo to order.
+ [Required]
+ public string Code { get => GetProp("Code"); set => SetProp("Code", value); }
+ /// Name of the added promo. Max length 100 characters. Searchable: priority level 2. Sortable: priority level 1.
+ public string Name { get => GetProp("Name"); set => SetProp("Name", value); }
+ /// Limit the total number of orders this promotion can be applied to across all users.
+ public int? RedemptionLimit { get => GetProp("RedemptionLimit"); set => SetProp("RedemptionLimit", value); }
+ /// Limit the total number of orders this promotion can be applied to per user.
+ public int? RedemptionLimitPerUser { get => GetProp("RedemptionLimitPerUser"); set => SetProp("RedemptionLimitPerUser", value); }
+ /// The number of times this promotion has been applied to an order.
+ [ApiReadOnly]
+ public int RedemptionCount { get => GetProp("RedemptionCount"); set => SetProp("RedemptionCount", value); }
+ /// Can only be used when LineItemLevel is true and ItemLimitPerOrder does not have a value. When defined the ValueExpression will be the discount applied to each qualifying quantity of eligible items. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
+ public int? QuantityLimitPerOrder { get => GetProp("QuantityLimitPerOrder"); set => SetProp("QuantityLimitPerOrder", value); }
+ /// Can only be used when LineItemLevel is true and QuantityLimitPerOrder does not have a value. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
+ public int? ItemLimitPerOrder { get => GetProp("ItemLimitPerOrder"); set => SetProp("ItemLimitPerOrder", value); }
+ /// Comma delimited list of properties to sort by. Can only be used when ItemLimitPerOrder is true. Used to determine the order in which the promotion is applied to the specified limit of items. Use ! to reverse sort order on a property.
+ public string ItemSortBy { get => GetProp("ItemSortBy"); set => SetProp("ItemSortBy", value); }
+ /// Description of the added promo. Max length 2000 characters. Searchable: priority level 4.
+ public string Description { get => GetProp("Description"); set => SetProp("Description", value); }
+ /// Terms, conditions, and other legal jargon.
+ public string FinePrint { get => GetProp("FinePrint"); set => SetProp("FinePrint", value); }
+ /// Start date of the added promo. Sortable.
+ public DateTimeOffset? StartDate { get => GetProp("StartDate"); set => SetProp("StartDate", value); }
+ /// Expiration date of the added promo. Sortable.
+ public DateTimeOffset? ExpirationDate { get => GetProp("ExpirationDate"); set => SetProp("ExpirationDate", value); }
+ /// The expression evaluated to determine if an item or order is eligible for a promotion. See Rules Engine documentation for formatting details.
+ [Required]
+ public string EligibleExpression { get => GetProp("EligibleExpression"); set => SetProp("EligibleExpression", value); }
+ /// The expression evaluated to determine the discount amount of an eligible promotion. See Rules Engine documentation for formatting details.
+ public string ValueExpression { get => GetProp("ValueExpression"); set => SetProp("ValueExpression", value); }
+ /// If true, the promotion can be applied to an order that already other promotions applied, as long as they can also be combined.
+ public bool CanCombine { get => GetProp("CanCombine"); set => SetProp("CanCombine", value); }
+ /// Allow promo to be used by all buyers in your Marketplace without creating explicit assignments.
+ public bool AllowAllBuyers { get => GetProp("AllowAllBuyers"); set => SetProp("AllowAllBuyers", value); }
+ /// ID of the organization that owns the Promotion. Only the Marketplace Owner can override the OwnerID on create.
+ public string OwnerID { get => GetProp("OwnerID"); set => SetProp("OwnerID", value); }
+ /// Auto apply of the added promo. Sortable.
+ public bool AutoApply { get => GetProp("AutoApply", false); set => SetProp("AutoApply", value); }
+ /// Active of the added promo. Sortable.
+ public bool Active { get => GetProp("Active", true); set => SetProp("Active", value); }
+ /// Use integration of the added promo.
+ public bool UseIntegration { get => GetProp("UseIntegration"); set => SetProp("UseIntegration", value); }
+ /// Used to control the order in which promotions are applied when calling the auto apply endpoint.
+ public int? Priority { get => GetProp("Priority"); set => SetProp("Priority", value); }
+ /// Container for extended (custom) properties of the added promo.
+ public dynamic xp { get => GetProp("xp", new ExpandoObject()); set => SetProp("xp", value); }
+ }
+ /// Specific type of the xp property. If not using a custom type, use the non-generic AddedPromo class instead.
+ public class AddedPromo : AddedPromo
+ {
+ /// Container for extended (custom) properties of the added promo.
+ public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); }
}
public class Address : OrderCloudModel
{
@@ -2823,16 +2878,84 @@ public class RefreshPromosResponse : OrderCloudModel
/// Promotions that were removed due to ineligibility or other reason.
public IList PromosRemoved { get => GetProp>("PromosRemoved", new List()); set => SetProp>("PromosRemoved", value); }
}
+ /// Specific type of the PromosAdded property. If not using a custom type, specify AddedPromo.
+ /// Specific type of the PromosRemoved property. If not using a custom type, specify RemovedPromo.
+ public class RefreshPromosResponse : RefreshPromosResponse
+ where TPromosAdded : AddedPromo
+ where TPromosRemoved : RemovedPromo
+ {
+ /// Promotions that were auto-applied.
+ public new IList PromosAdded { get => GetProp>("PromosAdded", new List()); set => SetProp>("PromosAdded", value); }
+ /// Promotions that were removed due to ineligibility or other reason.
+ public new IList PromosRemoved { get => GetProp>("PromosRemoved", new List()); set => SetProp>("PromosRemoved", value); }
+ }
public class RemovedPromo : OrderCloudModel
{
/// Error code of the removed promo.
public string ErrorCode { get => GetProp("ErrorCode"); set => SetProp("ErrorCode", value); }
- /// ID of the removed promo. Can only contain characters Aa-Zz, 0-9, -, and _.
- public string ID { get => GetProp("ID"); set => SetProp("ID", value); }
- /// ID of the line item. Can only contain characters Aa-Zz, 0-9, -, and _.
- public string LineItemID { get => GetProp("LineItemID"); set => SetProp("LineItemID", value); }
/// Reason of the removed promo.
public string Reason { get => GetProp("Reason"); set => SetProp("Reason", value); }
+ /// ID of the line item. Can only contain characters Aa-Zz, 0-9, -, and _.
+ public string LineItemID { get => GetProp("LineItemID"); set => SetProp("LineItemID", value); }
+ /// Amount of the removed promo.
+ public decimal Amount { get => GetProp("Amount"); set => SetProp("Amount", value); }
+ /// ID of the removed promo. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 2.
+ public string ID { get => GetProp("ID"); set => SetProp("ID", value); }
+ /// If true, certain eligible expression requirements must be met, and the PromotionDiscount will be applied at the line item level.
+ public bool LineItemLevel { get => GetProp("LineItemLevel"); set => SetProp("LineItemLevel", value); }
+ /// Must be unique. Entered by buyer when adding promo to order.
+ [Required]
+ public string Code { get => GetProp("Code"); set => SetProp("Code", value); }
+ /// Name of the removed promo. Max length 100 characters. Searchable: priority level 2. Sortable: priority level 1.
+ public string Name { get => GetProp("Name"); set => SetProp("Name", value); }
+ /// Limit the total number of orders this promotion can be applied to across all users.
+ public int? RedemptionLimit { get => GetProp("RedemptionLimit"); set => SetProp("RedemptionLimit", value); }
+ /// Limit the total number of orders this promotion can be applied to per user.
+ public int? RedemptionLimitPerUser { get => GetProp("RedemptionLimitPerUser"); set => SetProp("RedemptionLimitPerUser", value); }
+ /// The number of times this promotion has been applied to an order.
+ [ApiReadOnly]
+ public int RedemptionCount { get => GetProp("RedemptionCount"); set => SetProp("RedemptionCount", value); }
+ /// Can only be used when LineItemLevel is true and ItemLimitPerOrder does not have a value. When defined the ValueExpression will be the discount applied to each qualifying quantity of eligible items. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
+ public int? QuantityLimitPerOrder { get => GetProp("QuantityLimitPerOrder"); set => SetProp("QuantityLimitPerOrder", value); }
+ /// Can only be used when LineItemLevel is true and QuantityLimitPerOrder does not have a value. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending.
+ public int? ItemLimitPerOrder { get => GetProp("ItemLimitPerOrder"); set => SetProp("ItemLimitPerOrder", value); }
+ /// Comma delimited list of properties to sort by. Can only be used when ItemLimitPerOrder is true. Used to determine the order in which the promotion is applied to the specified limit of items. Use ! to reverse sort order on a property.
+ public string ItemSortBy { get => GetProp("ItemSortBy"); set => SetProp("ItemSortBy", value); }
+ /// Description of the removed promo. Max length 2000 characters. Searchable: priority level 4.
+ public string Description { get => GetProp("Description"); set => SetProp("Description", value); }
+ /// Terms, conditions, and other legal jargon.
+ public string FinePrint { get => GetProp("FinePrint"); set => SetProp("FinePrint", value); }
+ /// Start date of the removed promo. Sortable.
+ public DateTimeOffset? StartDate { get => GetProp("StartDate"); set => SetProp("StartDate", value); }
+ /// Expiration date of the removed promo. Sortable.
+ public DateTimeOffset? ExpirationDate { get => GetProp("ExpirationDate"); set => SetProp("ExpirationDate", value); }
+ /// The expression evaluated to determine if an item or order is eligible for a promotion. See Rules Engine documentation for formatting details.
+ [Required]
+ public string EligibleExpression { get => GetProp("EligibleExpression"); set => SetProp("EligibleExpression", value); }
+ /// The expression evaluated to determine the discount amount of an eligible promotion. See Rules Engine documentation for formatting details.
+ public string ValueExpression { get => GetProp("ValueExpression"); set => SetProp("ValueExpression", value); }
+ /// If true, the promotion can be applied to an order that already other promotions applied, as long as they can also be combined.
+ public bool CanCombine { get => GetProp("CanCombine"); set => SetProp("CanCombine", value); }
+ /// Allow promo to be used by all buyers in your Marketplace without creating explicit assignments.
+ public bool AllowAllBuyers { get => GetProp("AllowAllBuyers"); set => SetProp("AllowAllBuyers", value); }
+ /// ID of the organization that owns the Promotion. Only the Marketplace Owner can override the OwnerID on create.
+ public string OwnerID { get => GetProp("OwnerID"); set => SetProp("OwnerID", value); }
+ /// Auto apply of the removed promo. Sortable.
+ public bool AutoApply { get => GetProp("AutoApply", false); set => SetProp("AutoApply", value); }
+ /// Active of the removed promo. Sortable.
+ public bool Active { get => GetProp("Active", true); set => SetProp("Active", value); }
+ /// Use integration of the removed promo.
+ public bool UseIntegration { get => GetProp("UseIntegration"); set => SetProp("UseIntegration", value); }
+ /// Used to control the order in which promotions are applied when calling the auto apply endpoint.
+ public int? Priority { get => GetProp("Priority"); set => SetProp("Priority", value); }
+ /// Container for extended (custom) properties of the removed promo.
+ public dynamic xp { get => GetProp("xp", new ExpandoObject()); set => SetProp("xp", value); }
+ }
+ /// Specific type of the xp property. If not using a custom type, use the non-generic RemovedPromo class instead.
+ public class RemovedPromo : RemovedPromo
+ {
+ /// Container for extended (custom) properties of the removed promo.
+ public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); }
}
public class SearchIngestion : OrderCloudModel
{
diff --git a/src/OrderCloud.SDK/Generated/Resources.cs b/src/OrderCloud.SDK/Generated/Resources.cs
index 803126c..88213df 100644
--- a/src/OrderCloud.SDK/Generated/Resources.cs
+++ b/src/OrderCloud.SDK/Generated/Resources.cs
@@ -1057,6 +1057,9 @@ public interface ICartResource
/// Refresh promotions on the cart. Re-calculates promotion discounts, removes promotions that are no longer valid, and adds eligible promotions where AutoApply=true (up to limit of 100)
/// Optional. Use to provide an existing token instead of authenticating implicitly.
Task RefreshPromotionsAsync(string accessToken = null);
+ /// Refresh promotions on the cart. Re-calculates promotion discounts, removes promotions that are no longer valid, and adds eligible promotions where AutoApply=true (up to limit of 100)
+ /// Optional. Use to provide an existing token instead of authenticating implicitly.
+ Task RefreshPromotionsAsync(string accessToken = null) where TRefreshPromosResponse : RefreshPromosResponse;
/// Update cart FromUser. Only FirstName, LastName, and Email can be updated. Primarily used to facilitate guest checkout scenarios.
/// The object that will be partially serialized to JSON and sent in the request body.
/// Optional. Use to provide an existing token instead of authenticating implicitly.
@@ -4523,6 +4526,11 @@ public interface IOrdersResource
/// ID of the order.
/// Optional. Use to provide an existing token instead of authenticating implicitly.
Task RefreshPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null);
+ /// Refresh promotions on an order. Re-calculates promotion discounts, removes promotions that are no longer valid, and adds eligible promotions where AutoApply=true (up to limit of 100)
+ /// Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.
+ /// ID of the order.
+ /// Optional. Use to provide an existing token instead of authenticating implicitly.
+ Task RefreshPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) where TRefreshPromosResponse : RefreshPromosResponse;
/// Validate an order in its current state.
/// Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.
/// ID of the order.
@@ -7089,7 +7097,8 @@ internal CartResource(OrderCloudClient client) : base(client) { }
public Task DeletePromotionAsync(string promoCode, string accessToken = null) => Request("v1", "cart", "promotions", promoCode).WithOAuthBearerToken(accessToken).DeleteAsync();
public Task ApplyPromotionsAsync(string accessToken = null) => ApplyPromotionsAsync(accessToken);
public Task ApplyPromotionsAsync(string accessToken = null) where TOrder : Order => Request("v1", "cart", "applypromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
- public Task RefreshPromotionsAsync(string accessToken = null) => Request("v1", "cart", "refreshpromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
+ public Task RefreshPromotionsAsync(string accessToken = null) => RefreshPromotionsAsync(accessToken);
+ public Task RefreshPromotionsAsync(string accessToken = null) where TRefreshPromosResponse : RefreshPromosResponse => Request("v1", "cart", "refreshpromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
public Task PatchFromUserAsync(PartialUser partialUser, string accessToken = null) => PatchFromUserAsync(partialUser, accessToken);
public Task PatchFromUserAsync(PartialUser partialUser, string accessToken = null) where TOrder : Order => Request("v1", "cart", "fromuser").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialUser)).ReceiveJson();
public Task> ListPaymentsAsync(string search = null, string searchOn = null, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) => ListPaymentsAsync(search, searchOn, sortBy, page, pageSize, filters, accessToken);
@@ -7772,7 +7781,8 @@ internal OrdersResource(OrderCloudClient client) : base(client) { }
public Task RemovePromotionAsync(OrderDirection direction, string orderID, string promoCode, string accessToken = null) where TOrder : Order => Request("v1", "orders", direction, orderID, "promotions", promoCode).WithOAuthBearerToken(accessToken).DeleteAsync().ReceiveJson();
public Task ApplyPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) => ApplyPromotionsAsync(direction, orderID, accessToken);
public Task ApplyPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) where TOrder : Order => Request("v1", "orders", direction, orderID, "applypromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
- public Task RefreshPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) => Request("v1", "orders", direction, orderID, "refreshpromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
+ public Task RefreshPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) => RefreshPromotionsAsync(direction, orderID, accessToken);
+ public Task RefreshPromotionsAsync(OrderDirection direction, string orderID, string accessToken = null) where TRefreshPromosResponse : RefreshPromosResponse => Request("v1", "orders", direction, orderID, "refreshpromotions").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson();
public Task ValidateAsync(OrderDirection direction, string orderID, string accessToken = null) => Request("v1", "orders", direction, orderID, "validate").WithOAuthBearerToken(accessToken).PostAsync(null);
}
diff --git a/src/OrderCloud.SDK/OrderCloud.SDK.csproj b/src/OrderCloud.SDK/OrderCloud.SDK.csproj
index 189a096..1a2f6dd 100644
--- a/src/OrderCloud.SDK/OrderCloud.SDK.csproj
+++ b/src/OrderCloud.SDK/OrderCloud.SDK.csproj
@@ -4,7 +4,7 @@
netstandard2.0;net461
True
- 0.18.6
+ 0.18.7
OrderCloud.SDK
OrderCloud SDK
Todd Menier