@@ -53,7 +53,7 @@ import 'package:woosignal/models/response/setting_option_batch.dart';
5353import 'package:woosignal/models/response/product_batch.dart' ;
5454
5555/// WooSignal Package version
56- const String wooSignalVersion = "3.4 .0" ;
56+ const String wooSignalVersion = "3.6 .0" ;
5757
5858class WooSignal {
5959 WooSignal ._privateConstructor ();
@@ -169,7 +169,7 @@ class WooSignal {
169169 if (after != null ) payload["after" ] = after;
170170 if (before != null ) payload["before" ] = before;
171171 if (order != null ) payload["order" ] = order;
172- if (orderBy != null ) payload["order_by " ] = orderBy;
172+ if (orderBy != null ) payload["orderby " ] = orderBy;
173173 if (slug != null ) payload["slug" ] = slug;
174174 if (status != null ) payload["status" ] = status;
175175 if (type != null ) payload["type" ] = type;
@@ -592,6 +592,8 @@ class WooSignal {
592592 String ? search,
593593 String ? after,
594594 String ? before,
595+ String ? modifiedAfter,
596+ String ? modifiedBefore,
595597 List <int >? exclude,
596598 List <int >? include,
597599 int ? offset,
@@ -612,6 +614,8 @@ class WooSignal {
612614 if (search != null ) payload["search" ] = search;
613615 if (after != null ) payload["after" ] = after;
614616 if (before != null ) payload["before" ] = before;
617+ if (modifiedAfter != null ) payload["modified_after" ] = modifiedAfter;
618+ if (modifiedBefore != null ) payload["modified_before" ] = modifiedBefore;
615619 if (exclude != null ) payload["exclude" ] = exclude;
616620 if (include != null ) payload["include" ] = include;
617621 if (offset != null ) payload["offset" ] = offset;
@@ -1020,14 +1024,17 @@ class WooSignal {
10201024 }
10211025
10221026 /// https://woosignal.com/docs/api/1.0/coupons#create-a-coupon
1023- Future <Coupon ?> createCoupon ({
1024- required String ? code,
1025- required String ? discountType,
1026- required String ? amount,
1027- required bool ? individualUse,
1028- required bool ? excludeSaleItems,
1029- required String ? minimumAmount,
1030- }) async {
1027+ Future <Coupon ?> createCoupon (
1028+ {required String ? code,
1029+ required String ? discountType,
1030+ required String ? amount,
1031+ required bool ? individualUse,
1032+ required bool ? excludeSaleItems,
1033+ required String ? minimumAmount,
1034+ int ? usageLimit,
1035+ List <int >? productIds,
1036+ List <String >? emailRestrictions,
1037+ String ? description}) async {
10311038 Map <String , dynamic > payload = {};
10321039 if (code != null ) payload['code' ] = code;
10331040 if (discountType != null ) payload['discount_type' ] = discountType;
@@ -1037,6 +1044,11 @@ class WooSignal {
10371044 payload['exclude_sale_items' ] = excludeSaleItems;
10381045 }
10391046 if (minimumAmount != null ) payload['minimum_amount' ] = minimumAmount;
1047+ if (usageLimit != null ) payload['usage_limit' ] = usageLimit;
1048+ if (productIds != null ) payload['product_ids' ] = productIds;
1049+ if (emailRestrictions != null )
1050+ payload['email_restrictions' ] = emailRestrictions;
1051+ if (description != null ) payload['description' ] = description;
10401052
10411053 return await _wooSignalRequest <Coupon ?>(
10421054 method: "post" ,
0 commit comments