# Orders from your checkout

> Connect WooCommerce, PayPal, ClickFunnels, SamCart, ThriveCart, Kajabi or any checkout with one address. Each order lands on the buyer's profile.

Source: https://sporetag.com/docs/checkout-orders
Section: Measure

If you sell through WooCommerce, PayPal, ClickFunnels, SamCart, ThriveCart or Kajabi, your checkout can send each order to Sporetag the moment it is paid. You copy one address into the checkout. Nothing to install.

Each order counts the same way a [Stripe](https://sporetag.com/docs/stripe-connector) sale does: it lands on the buyer's [profile](https://sporetag.com/docs/customer-profiles), adds to revenue, shows in the [attribution report](https://sporetag.com/docs/attribution-report), and goes to your ad accounts when you [send results to them](https://sporetag.com/docs/send-results-to-ad-accounts). Refunds come off, and a subscription's later payments count as renewals for the same buyer.

Connecting works on every plan. Counting orders in Customers, revenue and your ad accounts is on Solo, Studio, Agency and Custom. On Free, the sheet still shows that each order arrived.

## Connect

1. Open your site, then **Settings**, then **Integrations**.
2. Under **Sales from your checkout**, click **Connect** next to your checkout.
3. Copy the address in the sheet and paste it where the sheet says. The steps for your checkout are right there.
4. Leave the sheet open. It says **Waiting for your first order**, then turns green with the order number when the first one arrives: "Connected. We got order #1234."

Someone else runs your checkout? Click **Send to my web person**. It opens an email with the address and the steps, from your own email.

Rather we did it? On WooCommerce, ClickFunnels, SamCart and Kajabi, click **Set it up for me** in the sheet. Invite our email as an admin (on WooCommerce, as a WordPress Administrator), then click **I invited you**. We paste the address into your checkout and email you when it works. You can remove our access in the same place afterward. It is not offered on PayPal, since we never ask for a way into your money, or on ThriveCart and Any checkout.

The address is secret. Anyone who has it can send orders to your site, so keep it private. To stop it, open the sheet and click **Disconnect**. The address stops at once. Connect again for a new one.

## Each checkout

### WooCommerce

In WordPress: **WooCommerce**, **Settings**, **Advanced**, **Webhooks**, then **Add webhook**. Set **Status** to **Active**, **Topic** to **Order updated**, paste the address into **Delivery URL** and the secret from the sheet into **Secret**, and click **Save webhook**.

- **Checked how:** WooCommerce signs each order with the secret (the `X-WC-Webhook-Signature` header). An order without the right signature is refused.
- When you save, WooCommerce checks the address. The sheet then says **WooCommerce reached us**.
- Counts an order once it is paid (Processing or Completed). Refunds come off as you make them.
- The UTMs and landing page WooCommerce's order attribution kept go on the profile.
- Using the [Sporetag WordPress plugin](https://sporetag.com/docs/install-wordpress) too? The same order is counted once.

### PayPal

In PayPal: click your name, **Account Settings**, **Notifications**, then **Update** next to **Instant payment notifications**. Click **Choose IPN Settings**, paste the address into **Notification URL**, pick **Receive IPN messages (Enabled)**, and click **Save**.

- **Checked how:** Sporetag sends each message back to PayPal, which confirms it sent it. No PayPal app or keys are needed.
- PayPal sends to one address. If another tool already uses it, ask your web person before you change it.
- A subscription's first payment counts as an order, the next ones as renewals. Refunds and reversals come off.

### ClickFunnels

In ClickFunnels: **Workspace Settings**, **Webhooks**, then add a new one. Paste the address into its **URL** box and pick the events `orders/invoice.paid` and `orders/invoice.refunded`.

- **Checked how:** the secret address. For a second check, paste the secret ClickFunnels shows for the endpoint into the sheet (**For your web person: add ClickFunnels' secret**). From then on, every order must carry ClickFunnels' signature.
- Renewal invoices count as renewals. A full refund comes off; ClickFunnels does not say how much a part refund was, so it shows on the profile with no amount.
- The UTMs and landing page ClickFunnels kept for the contact go on the profile.
- Test orders show in the sheet and are not counted.

### SamCart

In SamCart: **Apps**, search for **Webhooks**, **Install**. Paste the address into **Notify URL** and click **Connect**. Then **+ Add New Rule**, keep **Global Rule**, pick **Send NotifyURL Post for Orders** and the trigger **Order completed**, and click **Add Rule**. For refunds and renewals, add two rules with **Send NotifyURL Post**: **Product refunded** and **Subscription charged**.

- **Checked how:** the secret address. SamCart does not sign its webhooks.
- SamCart's orders do not say a currency, so they count in your [reporting currency](https://sporetag.com/docs/profit-and-currency), or US dollars if you have not set one.

### ThriveCart

In ThriveCart: **Settings**, **API & Webhooks**, then **Webhooks & notifications**. Add a webhook named Sporetag and paste the address as its URL.

- **Checked how:** the secret address. ThriveCart also sends your account's secret word; Sporetag does not ask for it, so there is one thing to copy, and never keeps it.
- To check it works, place an order in a product's test mode. It shows in the sheet and is not counted.
- Subscription payments count as renewals. Refunds come off.

### Kajabi

In Kajabi: **Settings**, **Third Party Integrations and Webhooks**, the **Webhooks** tab, then **Create Webhook**. Pick **Payment Succeeded**, paste the address under **Endpoint URL**, and click **Add Webhook**. Kajabi's webhooks are on its Growth and Pro plans.

- **Checked how:** the secret address. Kajabi does not sign its webhooks.
- Kajabi sends no refunds and does not say whether a payment is a subscription's first or a later one, so each payment counts as an order.

## Any checkout

Any tool that can send a webhook works, including Zapier and Make. Connect **Any checkout**, and send a `POST` to the address as JSON or a form when an order is paid.

| Field | Needed | What it holds |
| --- | --- | --- |
| `order_id` | Yes | Your id for the order. The same id twice counts once. |
| `value` | Yes | What the order is worth, without tax. `total` works too. |
| `currency` | | Three letters, such as `USD`. US dollars when missing. |
| `email` | | The buyer's email. Without an email, phone or `customer_id`, the order is not kept. |
| `phone`, `name` | | The buyer's phone and name. |
| `customer_id` | | Your id for the buyer. |
| `products` | | A list, or names split by commas. |
| `created_at` | | When it was paid: an ISO time or Unix seconds. Now when missing. |
| `type` | | `order` (the default), `renewal` or `refund`. |
| `payment_id` | For a renewal | The id of this payment, so each renewal counts once. |
| `refund_id` | | For a refund, its own id. `value` is the amount refunded. |
| `utm_source`, `utm_campaign`, `utm_content`, `utm_term` | | Where the buyer came from. |
| `landing_url` | | The first page they saw. Click ids in it are read. |
| `gclid`, `fbclid`, `ttclid`, `msclkid` and the other click ids | | The ad click, for your ad accounts. |
| `st_id` | | The Sporetag visitor id (the `_st_id` cookie), which ties the order to the visit. |
| `test` | | `true` for a test. It shows in the sheet and is not counted. |

```bash
curl -X POST "YOUR_ADDRESS" \
  -H "Content-Type: application/json" \
  -d '{"order_id":"1042","value":49,"currency":"USD","email":"buyer@example.com","products":["Course"]}'
```

**Checked how:** the secret address.

## How orders tie to visits

A checkout knows the buyer's email, not their visit. Sporetag ties the order to the visits before it when the buyer gave the same email on your site, in a form Sporetag reads or through `sporetag('identify', ...)`, and the site is in [90-day tracking](https://sporetag.com/docs/tracking-modes). UTMs and click ids the checkout kept (WooCommerce, ClickFunnels, or your own fields) count too. An order that is not tied still counts in revenue, under Direct.

## Good to know

- Each order counts once, however often the checkout sends it. Sporetag keys it by the checkout and its order id.
- An order already counted another way, such as the [Stripe connector](https://sporetag.com/docs/stripe-connector) reading the same charge, is not counted again when the checkout sends the charge id (ThriveCart and SamCart do).
- Orders from before you connect are not read. Each checkout sends new orders only.
- Sporetag keeps the order number and when the last one came, to show in the sheet. Names and emails go only on the buyer's profile.
