The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.
This API helps you to create a new coupon.
required String code,
required String discountType,
required String amount,
required bool individualUse,
required bool excludeSaleItems,
required String minimumAmount,
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
Coupon coupon = await WooSignal.instance.createCoupon({
code,
discountType,
amount,
individualUse,
excludeSaleItems,
minimumAmount,
});
Coupon instance
Represents the following object - WooCommerce Coupon
This API lets you retrieve and view a specific coupon by ID.
int id
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
Coupon coupon = await WooSignal.instance.retrieveCoupon(id: "coupon id");
Coupon instance
Represents the following object - WooCommerce Coupon
This API helps you to list all the coupons that have been created.
String context
int page
int perPage
String search
String after
String before
List<int> exclude
List<int> include
String order
String orderby
String code
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
List<Coupon> coupons = await WooSignal.instance.getCoupons();
List<Coupon> instance
Represents the following object - WooCommerce Coupon List
This API lets you make changes to a coupon.
int id,
{Map<String, dynamic> data}
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
Coupon coupon = await WooSignal.instance.updateCoupon(id: "coupon id", data: {});
Coupon instance
Represents the following object - WooCommerce Coupon
This API helps you delete a coupon.
int id
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
Coupon coupon = await WooSignal.instance.deleteCoupon(id: "coupon id");
Coupon instance
Represents the following object - WooCommerce Coupon
This API helps you to batch create, update and delete multiple coupons.
Map<String, dynamic> data
// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");
// Call API
CouponBatch couponBatch = await WooSignal.instance.batchCoupon(data: {});
CouponBatch instance
Represents the following object - WooCommerce CouponBatch