Help with Friendbuy and Membership 2 Pro

I'm trying to integrate Friendbuy, a referral program, into my website, which uses membership2 pro. The conversion tracker code requires an order id, amount, coupon code, and user email. So I'm wondering how membership2 can return those details. This is the conversion tracker code:

window['friendbuy'] = window['friendbuy'] || [];
window['friendbuy'].push(['track', 'order',
id: '', //INPUT ORDER ID
amount: '0.00', //INPUT ORDER AMOUNT
coupon_code: '', //OPTIONAL, coupon code if used for order
new_customer: '', //OPTIONAL, true if this is the customer's first purchase
email: '' //INPUT EMAIL

For further details, I would put this script in the head element of the order confirmation (thank you) page. My coding skills are very rusty. Can you guys help, please?