createCoupon method

Future<CouponResponse> createCoupon({
  1. required CreateCouponRequest body,
  2. required String token,
})

Create coupon POST /v1/billing/coupons

Implementation

Future<CouponResponse> createCoupon({required CreateCouponRequest body, required String token}) async {
  final path = '/v1/billing/coupons';
  final res = await _request(
'POST',
    path,
    body: body.toJson(),
    token: token,
  );
  return CouponResponse.fromJson(Map<String, dynamic>.from(res as Map));
}