Docs

# Migrate from PartnerStack

Move your PartnerStack program to Affiligato: partners, referred customers and reward history, with your API keys. Old links credit while PartnerStack runs.

The import reads your PartnerStack account through PartnerStack’s API with the two keys it gives you, and brings everything over in one run that you can repeat. Your partners’ PartnerStack links keep crediting them for as long as your PartnerStack account still redirects them; after that, partners share their Affiligato links.

## What comes across

| From PartnerStack                               | In Affiligato                                                                                                                                                                         |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Partnerships, with the partner’s name and email | Partners. Approved ones are approved, pending ones wait for you, declined ones are rejected, archived ones are suspended. A partner with no name is named by their email.             |
| Each partner’s partner key                      | Kept as that partner’s code, in the form PartnerStack’s links hand to your site, so a click through their PartnerStack link credits them while PartnerStack still redirects it.       |
| Customers a partner referred                    | Customers of that partner, known by their email and by the id your payment provider gave them (Stripe’s `cus_…`, for example). Customers made by a test partner are left out.         |
| Rewards                                         | Commissions, amounts read in cents. Paid ones arrive paid, with the day PartnerStack paid them; approved ones approved; held and pending ones pending; declined ones arrive reversed. |

A reward PartnerStack sends with no currency arrives in US dollars, the currency PartnerStack’s API documents reward amounts in. A reward with no amount or no status is left out.

## What does not come across

* **Your groups and offers.** Verify shows the groups the keys reach; Affiligato does not recreate them. Set your commission terms in Affiligato; they apply to every sale from the move on.
* **Payout methods and payouts.** PartnerStack’s API does not share them. Only the paid history of each reward comes across; partners add a payout method in their portal.
* **Partner links on PartnerStack’s short domain** (`yourcompany.grsm.io/sam`). They live on PartnerStack and stop redirecting when you close your PartnerStack account. See [Keep the links working](https://affiligato.com/#keep-the-links-working).
* **A partner key whose encoded form holds `+` or `/`, or that is longer than 48 characters.** A key of letters, digits, `_`, `-` and `.` never holds them. The summary names each such partner: their PartnerStack link stops crediting them, so they share their Affiligato link instead.
* **Transactions** with no reward, and **clicks**, which start counting again in Affiligato.

## Before you start

1. [Create your program](https://affiligato.com/docs/getting-started/) in the currency your PartnerStack rewards are paid in.
2. [Install the tracking script](https://affiligato.com/docs/tracking-script/) on the site your partner links point to.
3. Connect the payment platform your sales come from, such as [Stripe](https://affiligato.com/docs/stripe/) or [Paddle](https://affiligato.com/docs/paddle/).
4. In PartnerStack, pay or decline the rewards that are due. See [Paid history](https://affiligato.com/#paid-history) for why.

## Move the program

1. ### Copy your PartnerStack API keys

   In PartnerStack, open **Settings → Integrations → PartnerStack API Keys**. Copy the **production** public key and secret key: customers made with test keys are test customers, which the import leaves out.

2. ### Verify the keys in Affiligato

   Under **Partners → Import → From another platform**, choose **PartnerStack**, paste the public key into **Public key** and the secret key into **Secret key**, and choose **Verify**: it shows the PartnerStack groups the keys reach.

3. ### Start the import

   Choose **Start import**. Partners come first, then customers, then commissions, each counted as new, updated or skipped. Closing the window does not stop it. When it is done, **Skipped, and why** names every row it left out and the reason.

4. ### When the import ends

   Affiligato keeps the keys encrypted while the import runs and deletes them when the run ends.

## Keep the links working

A PartnerStack link is on PartnerStack’s short domain, such as `https://yourcompany.grsm.io/sam`. PartnerStack redirects it to your site and adds the partner key, encoded, as `?ps_partner_key=` (and `?gspk=` on older programs). With the Affiligato script on your site, that visit credits the partner it belonged to.

This works only while PartnerStack still redirects the link. When you close your PartnerStack account, `grsm.io` links stop working, and partners need their Affiligato links from then on. Each partner finds theirs in the [partner portal](https://affiligato.com/docs/portal/dashboard/).

Once your sales are tracked through Affiligato, remove PartnerStack’s script, `partnerstack.js`, from your site.

## Paid history

Rewards PartnerStack marked paid arrive **paid**, and Affiligato never pays them again. Rewards PartnerStack approved but has not paid arrive **approved**, and Affiligato pays them in your next payout run; if PartnerStack pays them too, the partner is paid twice. So pay what is due in PartnerStack before your last import, and run the import again after that last PartnerStack payout: the rewards it paid move to paid.

A reward you decline in PartnerStack arrives **reversed**, so decline only what nobody should be paid.

## Renewals after the move

A renewal your payment platform bills to the same email, or to the same customer id, credits the partner who referred that customer, at your Affiligato terms. A limited recurring period, such as 12 months, counts from the customer’s first referral payment imported from PartnerStack, so the move does not restart it.

## Tell your partners

The import itself emails no one. Your [automations](https://affiligato.com/docs/app/messages/) still run: a partner who joined PartnerStack after you made a welcome or no-clicks automation gets it, as a new partner would. Partners sign in to your [partner portal](https://affiligato.com/docs/portal/dashboard/) with the email PartnerStack had for them, by an emailed link or Google, and find their history there. Send them a [campaign](https://affiligato.com/docs/app/messages/) that says:

* the program has moved to Affiligato, and where the portal is;
* their PartnerStack links keep working until a date you name, the day you close PartnerStack, and after it they must share their Affiligato link from the portal instead;
* they add a payout method in the portal to be paid from now on.

## Run it again

The import can run as often as you need while your PartnerStack account is open. Each run adds what is new since the last, updates what changed, and creates nothing twice. Agents can run it with the `import_program` tool, `source: "partnerstack"` and the keys as `credentials.public_key` and `credentials.secret_key`, then follow it with `import_status`.
