> For the complete documentation index, see [llms.txt](https://docs.shoffi.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoffi.app/for-app-owners/adding-a-new-app.md).

# Adding a new app

{% hint style="info" %}
**Good to know:** While you manage multiple affiliate programs from the same dashboard, you set up each one separately. That lets you set different affiliate terms, such as commission rate, for each app.
{% endhint %}

## The new app form

Go to the `My Apps` page and click `Add a new app`. You will be redirected to the new app page.

### App settings

Set your app's settings based on your preferences. You can change them later from your dashboard.

### Affiliate terms

These are the contract details between an app and an affiliate. You can find a detailed explanation in [The affiliate terms](/for-app-owners/the-affiliate-terms.md#terms-breakdown).

### App details

* **App name:**\
  The exact name shown in the App Store.
* **App logo:**

  Upload your logo as a `.png` file. We recommend `125x125`.
* **Shopify App Store listing link:**

  Example: `https://apps.shopify.com/YourApp`
* **App support email:**

  Your affiliates will use this email if they want to contact you.
* **App category:**

  Your app category, as listed in the Shopify App Store. If you can't find the right one, choose `Other`.

### Authentication

* **Partner ID:**

  Find it under `Settings` → `Account information`.

![](/files/rWoaTl6OdiciQn2Z3pvp)

* **Partners API client access token:**

{% hint style="info" %}
**Important!** Shoffi requires API permissions for your app so we can detect installs from referral links and calculate earnings and commission rates correctly.

These permissions give us read-only access. We use it only to **read the information relevant to the Shoffi platform**.

**We don't read any data from before your Shoffi integration**.\
You can find more information about the [Partner API permissions here](https://shopify.dev/api/partner/getting-started#permissions).
{% endhint %}

When creating a new API client, please approve permissions to:

* View financials
* Manage apps

![](/files/6kIzqVpluoAvWZaI8kjB)

If it's your first time creating a Partner API key, follow [Shopify's guide](https://shopify.dev/api/partner/getting-started#create-an-api-client).

**App ID:**

* Go to your app page on the partner admin and copy it from the URL.

  For example:

  `https://partners.shopify.com/1111111/apps/1234567#/`

  **`1234567`** is your app ID.

### App resources (optional)

Add links to a public Google Drive, YouTube channel, or any other platform where your affiliate partners can find resources and tutorials to help them learn and promote the app.

## The app integration process

### Partners API connection

To submit the new app form, you must validate the connection to your Shopify Partners API. This confirms that the details you entered are correct. If a field is wrong or permissions are missing, you will get an error that explains what went wrong.

### Option 1: BigQuery integration

See [BigQuery integration](/for-app-owners/bigquery-integration.md) for a detailed guide.

When you connect BigQuery in Shoffi, use the **numeric GA4 Property ID** (digits only from GA4 Admin → Property details) — not the Measurement ID that starts with `G-`, and not a Shopify Partners app ID. The **Project ID** and **Property ID** must be a matched pair: the property’s BigQuery export must live in the same Google Cloud project you enter in Shoffi.

If something is slightly off (for example the Property ID), Shoffi’s automatic checks can often detect the correct property from your project and fix it — or show a banner on your Apps page with the exact step to fix.

### Option 2: POST request

When you have those values, you need to send the POST request with the following data:

**`api_key, shopName, appId, XFF`**

#### Variable explanations

* "**api\_key**":\
  Your Shoffi key is generated when you add a new app. You can find it by clicking `Edit app` on the `My Apps` page.
* "**shopName**":\
  The full shop domain currently logged in to the app, for example `newshop.myshopify.com`.
* "**appId**":\
  The ID of your Shopify app. To find it, go to your app page in the Partner Dashboard and copy it from the URL. For example, in `https://partners.shopify.com/1111111/apps/1234567#/`, `1234567` is your app ID. A Shopify appId is **digits only** - don't send the Shoffi app id here. If it contains any letters, Shoffi will reject the request with a "wrong appId" error.
* "**XFF**":\
  '`X-Forwarded-For`' header value

Here is what the POST request looks like:

{% tabs %}
{% tab title="Node.js" %}

```javascript
await fetch("https://platform.shoffi.app/v1/newMerchant", {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    api_key: "pk_xxxxxx",
    shopName: "xxxxxxx.myshopify.com",
    appId: "1111111",
    XFF: "11.1111.111.111"
  })
});
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST https://platform.shoffi.app/v1/newMerchant
   -H 'Content-Type: application/json'
   -d '{"api_key":"pk_xxxxxx",
   "shopName":"xxxxxxx.myshopify.com",
   "appId":"1111111",
   "XFF":"11.1111.111.111"}'
```

{% endtab %}
{% endtabs %}

#### Different languages

The code above shows a Shoffi POST request.\
You can use any other language, including Ruby or PHP, to send it.

If you are having trouble finding the value of the 'X-Forwarded-For' header, try searching for it under the request headers.\
Here are a few examples in different languages:

* **node:** `ctx.request.header['x-forwarded-for']`
* **ruby**: `request.env["HTTP_X_FORWARDED_FOR"]`
* **PHP**: `$_SERVER["HTTP_X_FORWARDED_FOR"]`

#### Testing the request

You can use your app's test key to test it on your test app or staging environment. Once you push your code to production, change the test key to the real one.

The response includes a `warnings` list that helps you catch mistakes before going live. You'll get a warning if you are still using the **test key**, or if the `XFF` value is wrong - for example missing, a placeholder like `0.0.0.0` or `11.1111.111.111`, the text `unknown`, or an IP sent together with a port. Use the merchant's real `x-forwarded-for` value (IPv4 or IPv6), without a port.

If a problem with your post-install call continues after your app is approved, Shoffi will also show an error on your `My Apps` page describing what to fix. Important: while the post-install call is sending a wrong IP, Shoffi can't match new referrals, so affiliate installs during that time won't be attributed - so it's worth fixing quickly.

#### Initiating the request

Once the POST request is added, you need to **open a new development store** from your Partner Dashboard and **install and open your app**. Once our system receives the request for the first time, the integration status will change to `Completed`, and your app will be ready for affiliates to use.

### Integration status

You can find the status of your app integration on the `My Apps` page.\
There are three different integration statuses:

1. **Incomplete**

   The Partner API connection was successful. We are waiting for the POST request.
2. **Under review**\
   POST request detected. We are now reviewing your app. This can take up to 48 hours.\
   If it has been more than 48 hours and your app is still under review, check the email address you used to sign up for Shoffi. We may have sent instructions about what needs to be fixed.
3. **Completed**

   Your app was approved and is now listed on Shoffi.
