Bearing

Help · Use Bearing

Revenue from Lemon Squeezy

Each sale and each subscription payment of your Lemon Squeezy store in Bearing, with the source and the campaign of the visit it came from. Lemon Squeezy tells Bearing itself: nothing to code.

Bearing shows what your Lemon Squeezy store earns next to your visits, and for each payment the source and the campaign of the visit it came from: which post, which newsletter, which ad ends in a sale. Lemon Squeezy tells Bearing each payment itself, as it happens. You set it up once, in a few minutes.

What you need

  • Bearing installed on the site where your buy links are.
  • Access to your Lemon Squeezy store's Settings.
  • Nothing to code when your site links to Lemon Squeezy's checkout.

1. Copy the address in Bearing

  1. Open your site's Settings in Bearing, section Revenue (another payment system), and open Lemon Squeezy.
  2. Copy the address shown there. It belongs to this site only.

2. Have Lemon Squeezy tell Bearing

Lemon Squeezy calls it a webhook: an address it calls each time something happens in your store. Here, that address is Bearing's.

  1. In Lemon Squeezy, open Settings » Webhooks and click the + button.
  2. Callback URL: paste the address you copied.
  3. Signing secret: type a secret of your own, 6 to 40 letters and digits, and keep it at hand: you will paste the same one in Bearing. It proves to Bearing that a message comes from your store.
  4. Tick these events, and only these: order_created, order_refunded, subscription_created, subscription_payment_success, subscription_payment_refunded.
  5. Save.

A webhook belongs to one store: if you have several, create one in each. Lemon Squeezy keeps live and test mode apart: a webhook created in test mode only hears test sales (see below).

3. Paste the secret in Bearing

  1. Back in your site's Settings, under Lemon Squeezy, paste the same secret in Signing secret and click Connect.
  2. From the next sale, the section says when the last message arrived.

How a sale finds its source

  • A link to a product's checkout (an address on lemonsqueezy.com that contains /buy/, such as your product's share link): nothing to do. When a visitor clicks it on your site, Bearing adds the code of this visit to it, and Lemon Squeezy gives the code back with the payment.
  • A store on its own domain (shop.example.com): add data-bearing-checkout="lemonsqueezy" to the link, as below.
  • A checkout your developer creates through Lemon Squeezy's API: pass the visit token in checkout_data.custom.bearing_token, as below.
  • Subscriptions: the first payment takes the source of the visit; the renewals keep the source of the customer's first payment.
  • Without the code (a link shared outside your site, a script blocked), the sale is real revenue in Source unknown. Bearing never spreads it over your sources.
<a href="https://shop.example.com/checkout/buy/…" data-bearing-checkout="lemonsqueezy">Buy</a>
// In the browser, when the visitor starts to pay
const token = window.bearing && window.bearing.token ? window.bearing.token() : "";

// On your server, when you create the checkout (POST /v1/checkouts)
// attributes: { checkout_data: { custom: { bearing_token: token } } }

Try it without changing your numbers

Put your store in test mode in Lemon Squeezy and create the same webhook there: the same address, the same secret, the same events. Then buy one of your products in test mode, with the card 4242 4242 4242 4242, any future date and any code. The sale reaches Bearing as a try: nothing is counted, and your site's Settings show try received under Revenue (another payment system). You then know the whole path works.

What is counted, and what is not

  • The amount is what the customer paid, tax included, in the currency they paid in. Currencies are never added together.
  • A refund of a sale or of a renewal is taken off, in full or in part, once you make it in Lemon Squeezy.
  • Subscriptions and one-off sales are told apart in the Revenue card.
  • Nothing from before the first day Bearing measured your site: such a sale could be tied to no visit.
  • Payments do not count toward your plan.
  • Never the buyer's name, email, address or card. Bearing keeps the amount, the currency, the date, what was refunded, Lemon Squeezy's reference, and a one-way fingerprint of its customer number, to recognise two payments of the same customer.

Your recurring revenue (MRR) is still worked out from Stripe only. And one payment, one way in: do not also send these sales from your site's server, they would count twice.

If nothing arrives, or to stop

  • Your site's Settings say when the last message arrived, and when one was refused because the secret does not match: paste the same secret on both sides again.
  • In Lemon Squeezy, Settings » Webhooks shows each message sent, and lets you send one again.
  • Disconnect, in your site's Settings, makes Bearing forget the secret. Payments already recorded stay. Delete the webhook in Lemon Squeezy too.