Programmatic Method
By default Rewardful will generate a commission for every payment made by a referred customer. (Learn more)
If you have certain invoices (for example, an initial setup fee) that you do not want to pay a commission for, you can tell Rewardful to ignore these invoice by adding rewardful: false
to the invoice's metadata before the invoice is paid.
Here's an example using Ruby, but the exact same concept applies no matter what programming language you're using:
# Fetch the customer to invoice.
customer = Stripe::Customer.retrieve('cus_ABC123')
# Create an Invoice Item for the setup fee.
Stripe::InvoiceItem.create(
customer: customer,
description: 'Setup fee',
amount: 5000,
currency: 'USD'
)
# Create the invoice with `{ rewardful: false }` metadata.
invoice = Stripe::Invoice.create(
customer: customer,
metadata: { rewardful: false }
)
# Collect payment (charge the credit card).
invoice.pay
When Stripe processes a payment, Rewardful will look at the following Stripe objects and skip the commission if rewardful: false
is present on any of them:
Customer
Subscription
Invoice
Charge
Note that invoice metadata can only be added through the Stripe API. It's not possible to add the metadata through the Stripe dashboard.
For further information, please refer to these Stripe API Reference sections: