Hi,
I noticed coupon_code returned from coupon.fetch has the value of id and not of the coupon code. I think it's because coupon_code is used as the idField for the Coupon model (here).
var coupon = recurly.Coupon();
coupon.coupon_code = 'off20';
coupon.fetch(function(err, response) {
if (err) return res.status(400).json(err);
console.assert(response.coupon_code, 'off20'); // false
});
I think this piece is responsible. It looks like when setting id (in . inflate()), the value of id is also assigned to the idField, which is coupon_code.