To generate an installation link, you can use the shopifyInstallationLink query. The query will return a URL that you can send to your merchant. The query takes one variable, storeCanonicalDomain.

storeCanonicalDomain is the domain of the Shopify store you want to install the app on, for example, test-store.myshopify.com. The domain provided here can be either the canonical domain or the storefront domain.

query shopifyInstallationLink($storeCanonicalDomain: String!) {
  shopifyApp {
    installationLink(storeCanonicalDomain: $storeCanonicalDomain) {
      canonicalDomain
      url
    }
  }
}

Note that the returned canonicalDomain value should be used to identify the store for subsequent requests. In cases where you provided the storefront domain as the input, the returned canonicalDomain value may differ.

Checking installation status

Once the merchant has finished installing the Rye app using your installation link, Rye will send out a SHOPIFY_APP_CONNECTED webhook if you have configured webhooks inside the Rye console. You can set up webhook delivery by following the instructions here.

The SHOPIFY_APP_CONNECTED webhook looks like this:

{
  "id": "hg9b8xyc-a128-4659-9c84-e3b376607977",
  "developerId": "xDasf23Jk4LKlxOq",
  "createdAt": "2023-06-27T12:00:09Z",
  "type": "SHOPIFY_APP_CONNECTED",
  "data": {
    "shopDomain": "rye.myshopify.com",
  }
}

The shopDomain field in the webhook payload will contain the canonical domain of the associated Shopify store. This will match the canonicalDomain value returned inside the installationLink payload.

Polling

Once the installation link is generated, you can check the status of the installation by using the integratedShopifyStore query. The query takes one input argument, canonicalDomain. The value used for the canonicalDomain input should be the same as the canonicalDomain returned inside the installationLink payload.

query GetIntegratedStoreDomain($canonicalDomain: String!) {
  integratedShopifyStore(canonicalDomain: $canonicalDomain) {
    canonicalDomain
  }
}

Here, canonicalDomain will return null until the store is integrated. Stores are considered to be “integrated” when the merchant has finished installing the Rye app.

Propose a commission rate

This feature is currently only available with authorization from us. If you would like access to this feature, you can request authorization by emailing support@rye.com.

By default Rye sets the commission rate for Shopify merchants to 25%. If you want to propose a different commission rate, you can use the proposeShopifyMerchantCommission mutation. The mutation takes an input with two fields, ratePercent and canonicalDomain. ratePercent is the commission rate you want to propose. canonicalDomain is the canonical domain of the Shopify store you want to propose the commission rate for.

mutation setCommissionRateForMerchant {
  proposeShopifyMerchantCommission(input: {
    canonicalDomain: "test.myshopify.com",
    ratePercent: 5
  }) {
    commissionProposal {
      createdAt
      ratePercent
    }
  }
}