# Referrals for Shopify: the app

Install the app, link a program: codes become discounts, orders are credited, buyers invite their friends.

Bolt Claw's Shopify app connects a shop to a referral program with no code: partner
codes become discounts in the shop, paid orders are credited to the partner who sent
each customer, and a buyer a partner referred is asked to refer their own friends on
the thank-you page. Bolt Claw charges nothing for it.

The app is the recommended way. The [webhook way](https://boltclaw.ai/docs/referral-billing-shopify)
still works with no app at all, and the two never count a sale twice: both file an
order under the same id.

## Install and connect

1. Install **Bolt Claw Referrals** from the Shopify App Store. Shopify asks you to
   allow three things, and only these: read orders, manage discounts, and read Shopify
   Payments disputes.
2. Open the app in your Shopify admin and press **Connect to Bolt Claw**. A Bolt Claw
   tab opens; sign in, and choose the program this shop belongs to.
3. Back in Shopify, reload the app. It shows the program, and how many codes are in
   your shop.

A shop is linked to one program, and a program to one shop. To move the shop to
another program of yours, press **Link another program** in the app. A shop linked to
another Bolt Claw workspace is refused: unlink it there first (the program's
**Integration** tab), or uninstall the app and install it again.

The shop never learns who you are in Bolt Claw, and Bolt Claw's dashboard stays where
the program is run.

## Codes in your shop

Add the friend's discount first: on the program's **Rewards** tab, a rule under
**What the friend gets** with a discount, percent or amount off. Then every partner
code becomes a Shopify discount for every product:

| The friend's discount | In Shopify |
|---|---|
| Once | Once per customer |
| For N months | Once per customer, and N cycles of a subscription |
| Forever | Every order |

Codes are kept in step: a code you make in Bolt Claw is made in the shop at once, and a
code you switch off is switched off there. A code you had already made by hand in
Shopify with the same text is matched, not made twice, and keeps its own settings. Once
matched, it is kept in step too: switching the code off in Bolt Claw switches it off in
Shopify.
**Sync codes now** (in the app, or on the program's Integration tab) catches up after
an error, 50 codes at a time; through the API it is
`POST /v1/referrals/programs/{id}/shopify-codes`, which an AI assistant always asks
you about first.

## Credit with no code on your theme

An order is credited from, in order:

1. the cart attributes the app embed writes (`boltclaw_ref`, `boltclaw_click`);
2. the partner's `?via=` in the order's landing page address, which needs nothing on
   your theme;
3. a partner's discount code on the order.

To keep the code across visits, switch the app embed on: **Online Store**, **Themes**,
**Customize**, **App embeds**, **Bolt Claw referrals**. It loads Bolt Claw's tag with
the settings you choose there (the days a code is kept, and the friend's welcome bar)
and puts the partner's code on the cart.

**Consent.** With **Wait for the visitor's consent** on (the default), the code is
kept only once the visitor accepts marketing cookies in Shopify's own cookie banner
(Shopify's Customer Privacy API), and forgotten if they decline. Leave it on if you
sell in the EU or the UK.

## The thank-you page

Add the **Bolt Claw: invite your friends** block to your thank-you page in the
checkout editor. When a buyer a partner referred finishes their first order, it shows
"Give your friends 10% off" (your friend's discount, in words) with the buyer's own
link and a copy button. Anybody else sees nothing. It is drawn with Shopify's own
components: no iframe, no script on your checkout.

The program's **Invite after purchase** setting (on the Welcome tab) must be on.

## Refunds, disputes, uninstalling

A refund reverses what the sale earned, in full or in part. A dispute reverses the
whole sale when it is opened, and once more if it is lost (the second time changes
nothing). Uninstalling the app deletes Bolt Claw's access to the shop at once; the
program stops hearing from it, and every commission already earned stays.

## Privacy requests

Shopify sends every app three privacy requests, and Bolt Claw answers each:

- **A customer's data request** waits for you on the program's Integration tab, with
  everything Bolt Claw holds about them: your customer id, who referred them, their
  sales, refunds and rewards, and their referral link. Bolt Claw holds no name, email
  address, postal address or phone number. Give it to your customer within 30 days of
  Shopify's request, then mark it answered. Through the API:
  `GET /v1/referrals/programs/{id}/privacy-requests`,
  `GET /v1/referrals/privacy-requests/{id}` and
  `POST /v1/referrals/privacy-requests/{id}/answer`.
- **A customer's erasure** is done at once: the customer's ids and email fingerprint
  go, and so does the referral link they were given. The amounts their orders earned
  partners stay, against an anonymous record, because partners are still owed them.
- **The shop's erasure**, 48 hours after you uninstall, does the same for every
  customer the shop's orders brought, and deletes the app's connection to the shop.

Each is listed on the Integration tab with counts only.

<!-- https://boltclaw.ai/docs/referral-shopify as markdown. Generated from openapi.yaml; API version 1.22.0. -->
<!-- Every /docs page answers as markdown: add .md to its path, or send Accept: text/markdown. -->
