To reduce fraud in Product-Led Growth (PLG) workflows, Metronome supports spend threshold billing. This feature allows you to cap the amount a customer can spend before being charged, thereby limiting your exposure to uncollected revenue.After applying a spend threshold to a contract, watch for webhook notifications to be alerted when payments succeed or fail.
When you create a contract in Metronome, you can optionally configure a spend_threshold_configuration. This config dictates:
The threshold_amount for the customer’s contract: how much they can spend before a payment attempt is triggered
The payment_gate_config:
Configure whether to payment gate the release of the commit and what gateway to use. Select EXTERNAL if you are using a gateway Metronome does not currently support. See Use an external payment gate for details.
If using Stripe, configure PAYMENT_TYPE to dictate whether payment is sent as an invoice through Stripe Billing or directly as a paymentIntent to Stripe’s payment gateway.
If using Stripe, select your existing tax provider.
What product_id should be used to represent the commit: the product_id dictates what the customer sees on their incremental invoice
CONFIGURE BILLINGIf using Stripe as your payment gateway, ensure there is a valid Stripe billing configuration set on the contract. Additionally, set spend_threshold_configuration.is_enabled to true if you want Metronome to immediately evaluate the contract after its creation.
You can update or add a spend_threshold_configuration at any point by editing the user’s contract. Add spend threshold limits to existing, non-limited contracts or change existing limits on a contract (for example, after some period of successful payments).Note that these changes take effect immediately.Edit contracts in the Metronome app or with the Metronome API. This API call adds a spend threshold to a contract:
{ "customer_id": "52f5a554-b887-4899-b919-4eb7789c6bf3", "contract_id": "8a5529d3-f353-4231-bedf-7e83f5e9331d", "add_spend_threshold_configuration": { "commit": { "product_id": "d6be3bf4-1669-40c9-a8b1-388bb167ab16", "name": "threshold_charge", "description": "one time for the one time" }, "is_enabled": true, "payment_gate_config": { "payment_gate_type": "STRIPE", "stripe_config": { "payment_type": "INVOICE" } }, "threshold_amount": 100 }}
This API call updates an existing spend threshold:
If using the EXTERNAL option for payment_gate_type, you are responsible for facilitating payment and letting Metronome know the response. Follow this workflow:
Set the spend threshold config with payment_gate_type set to EXTERNAL
Listen for payment_gate.external_initiate that indicates Metronome is ready to receive the outcome of the payment
Save the workflow_id - you will need this to release the commit
Charge the customer in your payment gateway of choice