question

msargent avatar image
msargent asked Frank Faustino answered

Tracking Metered Events Using Webhooks - Online vs In-Store?

Do webhooks send data for every single payment event that goes through Clover? Not just online transactions? I do not want to trigger metered events for in-store Clover POS orders that are made outside my custom eCommerce platform since that wouldn't be fair to merchants, charging them a transaction fee for an order that wasn't made through my service.

Some background:

I'm working on a custom eCommerce platform that hooks up to Clover through a REST API app. I also have a webhook script that is used to track both credit card and cash transactions. It is intended to track payments on online orders where each order will trigger a metered event based on a merchant's subscription to my app.

I understand that if a merchant has my app installed, data will be sent to my webhook URL for each payment that is made.

If the webhook sends me data for both online orders and in-store orders made at Clover POS terminals how do I distinguish between the two with the webhook data that consists of only (that I know of) appId, merchants (ids), object id, type and ts?
OrdersPaymentsWebhooks
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Frank Faustino avatar image
Frank Faustino answered
Webhooks subscribes to payments made on device and payments created using our Developer Pay API. Since webhooks only provide you with the payment's UUID, you'll need to fetch more information about the payment using the following endpoint: https://apisandbox.dev.clover.com/v3/merchants/mId/payments/payId

After fetching payment JSON data, you can differentiate payments made on a device by the "device" field, which will look like this:

{
	"device": {
		"id": "6ce31822-a312-4cb2-8aa3-67cefefd8cb8"
	}
}
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community