Search...
Menu

Shopify App Integration Guide

Integrating with Shopify in Two Steps

Follow the instructions below to complete the integration.

Step 1: Add Products

When you first register and subsequently add products, you can operate "Add Product" in the upper left corner.

Product Form Filling Guide

  • Product logo: The logo displayed in the PartnerShare promotion market.
  • Product name: The name displayed in the PartnerShare promotion market.
  • Settlement currency with PartnerShare: USD.
  • Product type: Shopify plugin
  • Shopify App Store Listing Link: e.g., https://apps.shopify.com/YourApp
  • Shopify Partner ID: Find it in the Shopify Partners backend under "Settings" -> "Partner API Clients".

Shopify Partner API Client Access Token

Important! PartnerShare platform requires API permissions for your application so we can determine if the installation was done via a promotion link and accurately calculate transaction and reward amounts.
These permissions grant us "read-only" access, and we only use this access to read information related to the PartnerShare platform.
We will not read any data prior to your integration with PartnerShare.
You can find more information about partner API permissions here.

If you are creating an API client access token for the first time, you can follow the guide and screenshots below to obtain the API client access token:

  1. In the Shopify Partners backend, find it under "Settings" -> "Partner API Clients".
  2. Create an API client and check the permissions for Financial Information and Manage Apps.
  3. Obtain the access token and fill it into the product information.




Shopify App ID

Find and copy it from the link on your application's partner management page.

For example:

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

1234567 is your application ID.

Verify API Connection

To successfully create the app and start promoting, you must verify the connection with the Shopify Partners API to ensure the details you entered are correct.

If the above steps are correct, click the verification link on Partnershare, and after passing, click submit. If prompted submission is successful, the first step of the integration is completed!

Step 2: POST Request

To complete the integration, you need to add a POST request to your application. This request will help us correctly match invited users to their respective partners.

This request must run each time a new store installs the application.

Add the Code to Your Application

When OAuth is completed, you will receive a request from Shopify containing the shop name and the "X-Forwarded-For" header.

When you have these values, you need to send a POST request containing the following data (four parameters in total):

  • conversion_token
  • shop_name
  • app_id
  • xff

Parameter Explanation

  • conversion_token: PartnerShare data return key. Path: PartnerShare backend -> Advanced Setting -> Integrated.
  • shop_name: The store name of the currently logged-in application. (Full name, e.g., newshop.myshopify.com).
  • app_id: Your Shopify application's ID. To find it, go to the app's partner management page and copy it from the URL link. For example: "https://partners.shopify.com/1111111/apps/1234567#/", 1234567 is your app ID.
  • xff: Shopify request header value 'X-Forwarded-For'.

Request Header Value Examples in Different Languages

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

Curl Request Example

shell Copy
curl -X POST https://api.partnershare.net/partner/conversion/new-merchant
   -H 'Content-Type: application/json'
   -d '{"conversion_token":"xxxxxx",
   "shop_name":"xxxxxxx.myshopify.com",
   "app_id":"1111111",
   "xff":"11.1111.111.111"}'

Node.js Request Example

node Copy
await fetch('https://api.partnershare.net/partner/conversion/new-merchant', { 
    method: 'POST', 
    headers: { 'Content-Type': 'application/json' }, 
    body: JSON.stringify({ conversion_token: "xxxxxx", shop_name: "xxxxx.myshopify.com", app_id: "111111", xff: "11.1111.111.111" }) 
})

Test the Request

You can test it directly on PartnerShare, and later you can contact our staff to clear the test data.

Initiate the Request

After adding the POST request, you need to open a new developer store from the application's partner management backend, install, and open your application. Once our system receives the request for the first time, the product integration status will change to "Under Review," and our account manager will contact you.

Integration Status

  • Integrating: The connection to the Partner API is successful. The POST request is still needed.
  • Under Review: We have received the POST request. Your application is under review, and our account manager will contact you once it is approved.
Previous
Transaction Flow
Next
Other
Last modified: 2024-07-26