Skip to content

Coupons

Gilbert Kimutai edited this page Feb 20, 2019 · 1 revision

Create a coupon

       val coupon = Coupon()
       coupon.code = code
       coupon.description = description

       woocommerce.CouponRepository().create(coupon).enqueue(object : Callback<Coupon> {
            override fun onResponse(call: Call<Coupon>, response: Response<Coupon>) {
                val couponResponse = response.body()
                stopShowingLoading()
                finish()
            }

            override fun onFailure(call: Call<Coupon>, t: Throwable) {
                stopShowingLoading()
            }
        })
Clone this wiki locally