PartnerShare
品牌主
营销方式
联盟增长找外部推广者来卖你的产品 推荐营销(老带新计划)让老用户带来新用户
使用案例
AI 工具站教程测评带来订阅转化 IP 代理服务站追踪首单、续费与佣金 电商独立站用分销和内容测评提升转化 指纹浏览器触达跨境和多账号运营人群
推广者 推广市场
导航站
跨境电商导航 AIGC 导航 全球 IP 代理导航 精选产品
价格
资源
博客增长方法、渠道拆解与产品更新 帮助中心接入文档、账户设置与常见问题 最新资讯出海营销动态与行业热点
品牌主
营销方式 联盟增长 推荐营销(老带新计划) 使用案例 AI 工具站 IP 代理服务站 电商独立站 指纹浏览器
推广者 推广市场
导航站
跨境电商导航 AIGC 导航 全球 IP 代理导航 精选产品
价格
资源
博客 帮助中心 最新资讯

选择入口

请选择适合您的身份入口。

管理产品和联盟计划 品牌主 创建产品、设置佣金规则并管理推广转化。 创建品牌主账号→ 发现好产品赚取佣金 推广者 发现高佣产品,一键获取专属推广链接。 免费入驻推广市场→ 发布产品资讯获取曝光 内容发布方 提交产品并发布资讯,获取中文内容曝光。 进入内容发布平台→

预约 1v1 演示

产品顾问将在 1 个工作日内与你约定 30 分钟在线演示,带你搭好第一个推广计划。

提交后我们会尽快与你联系。

想先自己体验?免费注册 →

提交即表示你同意 PartnerShare 为安排产品演示而联系你。

微信扫码联系

使用微信扫描二维码添加企业微信,产品顾问会尽快与你联系。

PartnerShare 企业微信二维码 PartnerShare Telegram 二维码 保存图片到本地 CHAT ON TELEGRAM
✓

申请已提交

我们会尽快联系你,安排演示和接入建议。你也可以先注册账号体验产品。

Skip to content

Getting Started

4
  • How to Launch Your Affiliate Program on PartnerShare
  • How to Create a Referral Program
  • What Is Referral Marketing / “Old-Bring-New” Program
  • What is Affiliate Marketing?
合作伙伴管理 - PartnerShare

Campaign Operations

5
  • Checking Partner Withdrawal Status
  • Withdrawal Methods Supported for Partners
  • Affiliate Management
  • Product Management
  • Campaign Management
支付与交易 - ParterShare

Payments&Transactions

2
  • Auto-Payout
  • Commission Settlement
技术集成 - PartnerShare

Account Management

2
  • Business Certification Prompts
  • Team Management
技术集成 - PartnerShare

Technical Integration

5
  • Embedding PartnerShare into Your Product
  • Conversion Event Postback
  • Click-Tracking SDK Integration
  • API Authentication & Signature Mechanism
  • PartnerShare Product-Authorized Login Integration Guide
常见问题 - PartnerShare

Frequently Asked Questions

2
  • Withdrawal FAQ
  • Legacy Help Center Entrance
快速入门 - PartnerShare

Changelog

2
  • Changelog – 2026.03.05
  • Changelog – 2026.05.15
View Categories
  • 帮助中心
  • Technical Integration
  • PartnerShare Product-Authorized Login Integration Guide

PartnerShare Product-Authorized Login Integration Guide

PartnerShare Integration Guide

Product-authorized login integration guide

For cross-product partnership/promotion scenarios, PartnerShare provides unified handling of authorization relay, referral-relationship maintenance, auth-code exchange, signup-event attribution, and commission settlement — letting the promoting product and the promoted product achieve user interoperability and a closed growth loop at low cost.

Key concepts: authorization relay, promotion attribution, automatic signup/login, commission settlement

1. Overview

Capability positioning PartnerShare’s product-authorized promotion login is a standardized authorization-relay capability designed for cross-product partnership/promotion scenarios. After a user completes authorization in the “promoting product,” that product submits the user’s authorization info to PartnerShare. PartnerShare then automatically generates a redirect link carrying the referral relationship, along with a one-time auth code. The “promoted product” exchanges the auth code for the user’s info to complete automatic signup or login, and reports the signup event back using ps_ref — completing the full loop from user redirect → authorized login → signup attribution → promotion commission settlement.

Once integrated, neither side needs to separately build capabilities for promoter-account maintenance, auth-code exchange, source identification, attribution stats, or commission settlement — significantly lowering development cost, integration-testing cost, operational cost, and user-conversion drop-off for cross-product promotion partnerships.


2. Core concepts

To make the integration flow easier to follow, this document uses the following concepts consistently:

ConceptDescription
Promoting productThe party that initiates authorization and drives users to the other product. The user is typically already logged into the promoting product; after authorizing, the promoting product redirects the user to the promoted product.
Promoted productThe party that receives the user and completes signup or login. The promoted product exchanges the auth code with PartnerShare for the user’s info, and reports a signup event once signup is complete.
PartnerShareThe authorization-relay and promotion-attribution platform. Responsible for generating auth codes, maintaining referral relationships, returning referral links, validating auth codes, receiving signup events, and supporting downstream commission settlement.
Auth code x_auth_codeA one-time, short-lived code generated by PartnerShare, used by the promoted product’s server to exchange for the authorized user’s info. It must not be used as a long-term login credential.
Referral invite code ps_refThe promotion-attribution identifier generated/maintained by PartnerShare, passed to the promoted product via the referral link, used for signup-event postback and promotion-effectiveness attribution.
Authorized user user_keyThe unique identifier for the authorized user, returned by PartnerShare. The promoted product should build its local user-binding relationship based on user_key.
Promotion link (referral link)The redirect link PartnerShare returns to the promoting product, typically pointing to the promoted product’s landing page, carrying ps_ref and x_auth_code.
Signup eventThe event the promoted product reports back to PartnerShare after completing automatic signup or the first valid conversion, used for downstream promotion attribution, data stats, and commission settlement.

3. Prerequisites

Before integrating product-authorized promotion login, complete the following preparation:

3.1 Register a PartnerShare brand-owner dashboard account #

First register and log into the PartnerShare brand-owner dashboard: https://share.partnershare.com/nueshawu

3.2 Complete basic product configuration #

Create and save a product in the PartnerShare dashboard, completing basic product info, reward rules, tracking integration, and API configuration as needed.

3.3 Fill in the Promotion URL #

Be sure to fill in the Promotion URL in the product’s basic configuration. This is the landing page address the user is ultimately redirected to on the promoted product. When PartnerShare generates the referral link, it automatically appends ps_ref and x_auth_code parameters to this address.

3.4 Create an affiliate-program campaign #

The promoted product needs to first create an affiliate-program campaign in the PartnerShare dashboard. This campaign handles promoter onboarding, referral-relationship creation, attribution stats, and downstream commission settlement — and is a prerequisite for generating a valid promotion landing link in the product-authorized login flow.

3.5 Confirm the affiliate-program campaign is created and active #

After creating the affiliate campaign, confirm it has been generated under the corresponding product, that the campaign type is “Affiliate Program,” and that the campaign is in “Active” status. Promoters will apply to promote based on this campaign, and the promoted product will use it to handle referral relationships, attribution stats, and downstream commission settlement. If the campaign hasn’t started, is paused, or has ended, referral-link generation, signup attribution, or commission settlement may fail.

Key pre-check items The Promotion URL, the affiliate-program campaign, and the campaign’s status are the key configuration items affecting authorized redirects and signup attribution. Before integration testing, we recommend confirming these are configured and in normal status first.


4. Flow diagram

(See the flow diagram image on the original page for the product-authorized promotion login flow.)


5. Data conventions

5.1 Request conventions #

Unless otherwise noted, all endpoints in this document follow these request conventions:

ItemConvention
HTTP MethodPOST
Content-Typeapplication/json
Request formatRaw JSON
Calling methodWe recommend server-side calls, to avoid exposing API keys or sensitive parameters on the frontend

Request example: #

json #

{
  "product_key": "your_product_key",
  "target_product_key": "target_product_key",
  "user_id": "your_user_id"
}

5.2 Response conventions #

Unless otherwise noted, all endpoint responses are JSON, with this base structure:

json #

{
  "code": 0,
  "message": "success",
  "data": {}
}
FieldTypeDescription
codeintStatus code, 0 = success, non-zero = failure
messagestringDescription of the response
dataobject / array / nullResponse data, structure varies by endpoint

Success response example: #

json #

{
  "code": 0,
  "message": "success",
  "data": {
    "code": "AUTH_CODE_EXAMPLE",
    "redirect_url": "https://example.com/landing?ps_ref=xxx&x_auth_code=AUTH_CODE_EXAMPLE"
  }
}

Failure response example: #

json #

{
  "code": 1000004,
  "message": "API Key or signature cannot be empty",
  "data": null
}

5.3 URL parameter conventions #

Once PartnerShare returns the referral link, when it ultimately redirects to the promoted product’s landing page, the URL carries these parameters:

ParameterTypeDescription
ps_refstringReferral invite code, used for signup-event postback and promotion attribution
x_auth_codestringOne-time auth code, used by the promoted product’s server to exchange for the authorized user’s info

Example:

text #

https://example.com/landing?ps_ref=abc123&x_auth_code=AUTH_CODE_EXAMPLE

5.4 Key field conventions #

FieldTypeDescription
product_keystringThe promoting product’s identifier
target_product_keystringThe promoted product’s identifier
user_idstringThe user’s unique identifier within the promoting product
x_auth_codestringOne-time auth code, used to exchange for the authorized user’s info
ps_refstringReferral invite code, used for signup-event attribution
user_keystringThe unique authorized-user identifier returned by PartnerShare; the promoted product should build its local user-binding relationship based on this field

6. Signature mechanism

To keep API calls secure, PartnerShare’s open API requires signature validation via API Key and API Secret. All signature parameters must be generated server-side — never expose the API Secret in a browser, mobile app, or mini-program frontend. Reference: https://www.partnershare.net/help/api/signature

6.1 Getting your API Key and API Secret #

In the PartnerShare dashboard, go to: Product Management → select the integrated product → Developer Integration, to get the API Key and API Secret.

6.2 Request headers #

When calling the endpoint, include the following in the request headers:

HeaderRequiredDescription
X-Api-KeyYesThe API Key PartnerShare assigned to the product
X-Api-TimestampYesCurrent second-precision timestamp
X-Api-SignYesSignature generated per the signing rules
Content-TypeYesFixed as application/json

6.3 Signing rules #

Signature generation rules:

  1. Collect all field names in the current request parameters.
  2. Lowercase all field names.
  3. Sort the field names naturally.
  4. Join the sorted field names with &.
  5. Append timestamp and api_secret to the joined result.
  6. Compute SHA256 on the final string to get the hex signature.

Signature string format: #

text #

field1&field2&field3 + timestamp + api_secret

Example request parameters: #

json #

{
  "product_key": "your_product_key",
  "target_product_key": "target_product_key",
  "user_id": "user_10001",
  "extra": {
    "locale": "zh"
  }
}

Field names included in the signature: #

text #

product_key
target_product_key
user_id
extra

Sorted and joined: #

text #

extra&product_key&target_product_key&user_id

Assume: #

text #

timestamp = 1776677721
api_secret = your_api_secret

Final string to be signed: #

text #

extra&product_key&target_product_key&user_id1776677721your_api_secret

SHA256 this string to get X-Api-Sign.

6.4 JavaScript signing example #

javascript #

function makeSign(params, timestamp, apiSecret) {
  const keys = Object.keys(params)
    .map((key) => key.toLowerCase())
    .sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));

  const signString = keys.join('&') + timestamp + apiSecret;

  return CryptoJS.SHA256(signString).toString(CryptoJS.enc.Hex);
}

6.5 Go signing example #

go #

package main

import (
    "crypto/sha256"
    "fmt"
    "sort"
    "strings"
)

func MakeSign(params map[string]interface{}, timestamp string, apiSecret string) string {
    keys := make([]string, 0, len(params))
    for key := range params {
        keys = append(keys, strings.ToLower(key))
    }

    sort.Strings(keys)

    signString := strings.Join(keys, "&") + timestamp + apiSecret
    sum := sha256.Sum256([]byte(signString))

    return fmt.Sprintf("%x", sum)
}

6.6 PHP signing example #

php #

<?php

function makeSign(array $params, string $timestamp, string $apiSecret): string
{
    $keys = array_map('strtolower', array_keys($params));
    sort($keys, SORT_NATURAL);

    $signString = implode('&', $keys) . $timestamp . $apiSecret;

    return hash('sha256', $signString);
}

6.7 Notes #

  • Use a second-precision timestamp for X-Api-Timestamp.
  • X-Api-Sign must be generated server-side.
  • api_secret is only for server-side signing — never expose it in frontend code.
  • Field names must be lowercased before sorting.
  • The current signing rule only uses parameter field names in the calculation — not field values.

7. Endpoint list

All endpoints in this document share this prefix:

text #

/api/open/v1

Request host for all endpoints:

text #

https://api-service.partnershare.net

The full request URL = host + prefix + path, e.g. https://api-service.partnershare.net/api/open/v1/oauth/authorize.

Unless otherwise noted, all endpoints require the authentication headers described in “Signature Mechanism.”

HeaderRequiredDescription
Content-TypeYesapplication/json recommended.
X-Api-KeyYesThe API Key PartnerShare assigned to the product.
X-Api-TimestampYesSecond-precision timestamp.
X-Api-SignYesSHA256 signature per the signing rules.

7.1 Generate a promotion authorization link #

Description After a user completes authorization, the promoting product calls this endpoint to submit the user’s authorization info to PartnerShare. PartnerShare generates a one-time auth code and returns a referral link carrying ps_ref and x_auth_code.

This endpoint suits cases where the promoting product wants to get the redirect URL first, then control the redirect itself.

Request info #

ItemValue
MethodPOST
Path/api/open/v1/oauth/authorize
Content-Typeapplication/json
CallerThe promoting product’s server

Request parameters #

ParameterTypeRequiredDescription
product_keystringYesThe promoting product’s key.
target_product_keystringYesThe promoted product’s key.
user_idstringYesA stable, unique user identifier within the promoting product.
extraobjectNoExtended user info passed by the promoting product, which the promoted product can use to complete the user’s profile.

Request example #

json #

{
  "product_key": "your_product_key",
  "target_product_key": "target_product_key",
  "user_id": "source_user_001",
  "extra": {
    "user_name": "Demo User",
    "email": "demo@example.com",
    "locale": "zh"
  }
}

Response parameters #

FieldTypeDescription
codestringThe one-time auth code — i.e., the x_auth_code in the redirect URL.
redirect_urlstringThe promoted product’s landing page URL, already carrying ps_ref and x_auth_code.

Response example #

json #

{
  "code": 0,
  "message": "success",
  "data": {
    "code": "2fwth3pfj8",
    "redirect_url": "https://target.example.com/landing?ps_ref=INVITE_CODE&x_auth_code=2fwth3pfj8"
  }
}

Notes #

  • product_key must match the product associated with the current API Key.
  • The promoted product’s landing page must receive and retain both ps_ref and x_auth_code.
  • x_auth_code is a one-time, short-lived code — do not save it as a long-term login credential.

7.2 Authorize and redirect directly #

Description The promoting product can use this endpoint to let PartnerShare handle authorization and directly return a 302 redirect, targeting the promoted product’s landing page with ps_ref and x_auth_code attached.

This suits cases where the promoting product wants the user redirected immediately on click. If the promoting product wants to get the redirect link first and control the redirect itself, use POST /api/open/v1/oauth/authorize instead.

Request info #

ItemValue
MethodGET
Path/api/open/v1/oauth/authorizeAndRedirect
CallerThe promoting product’s server or the redirect entry point

Request parameters #

ParameterTypeRequiredDescription
product_keystringYesThe promoting product’s key.
target_product_keystringYesThe promoted product’s key.
user_idstringYesA stable, unique user identifier within the promoting product.
extrastringNoExtended user info, as a JSON string.

Request example #

http #

GET /api/open/v1/oauth/authorizeAndRedirect?product_key=your_product_key&target_product_key=target_product_key&user_id=source_user_001

Success response #

http #

HTTP/1.1 302 Found
Location: https://target.example.com/landing?ps_ref=INVITE_CODE&x_auth_code=2fwth3pfj8

Failure response #

json #

{
  "code": 1000001,
  "message": "The authorization target product does not exist",
  "data": null
}

7.3 Get user info via auth code #

Description After the promoted product’s landing page receives x_auth_code, it calls this endpoint to exchange it with PartnerShare for the authorized user’s info. Once exchanged, the promoted product can use the returned user_key to complete local account binding, automatic signup, or login.

Request info #

ItemValue
MethodPOST
Path/api/open/v1/oauth/getUserByAuthorizationCode
Content-Typeapplication/json
CallerThe promoted product’s server

Request parameters #

ParameterTypeRequiredDescription
codestringYesThe x_auth_code received on the promoted product’s landing page.

Request example #

json #

{
  "code": "2fwth3pfj8"
}

Response parameters #

FieldTypeDescription
user_keystringThe unique authorized-user identifier generated by PartnerShare.
user_namestringThe authorized user’s display name.
refstringThe promoting product’s name.
ref_product_keystringThe promoting product’s key.
localestringThe user’s language preference.
extraobjectExtended user info passed by the promoting product.

Response example #

json #

{
  "code": 0,
  "message": "success",
  "data": {
    "user_key": "uk_abc123xyz",
    "user_name": "Demo User",
    "ref": "Source Product",
    "ref_product_key": "source_product_key",
    "locale": "zh",
    "extra": {
      "user_name": "Demo User",
      "email": "demo@example.com",
      "locale": "zh"
    }
  }
}

Notes #

  • code can only be successfully exchanged once — it becomes invalid immediately after.
  • code has an expiration; once expired, the authorization flow must be restarted.
  • The product associated with the current API Key must match the auth code’s intended promoted product.
  • The promoted product should use user_key to build its local user-binding relationship.
  • This endpoint does not return the promoting product’s internal raw user ID.

7.4 Get a debug auth code #

Description This endpoint generates a test auth code for use during integration testing, letting the promoted product verify landing-page parameter reception, server-side code exchange, automatic signup, login, and signup-event postback.

This endpoint is for debugging only — do not rely on it in production business flows.

Request info #

ItemValue
MethodPOST
Path/api/open/v1/oauth/getDebugAuthCode
Content-Typeapplication/json
CallerThe integrating party’s server

Request parameters #

ParameterTypeRequiredDescription
source_product_keystringYesThe promoting product’s key.
target_product_keystringYesThe promoted product’s key.
user_idstringYesTest user ID.
extraobjectNoExtended test-user info.

Request example #

json #

{
  "product_key": "your_product_key",
  "target_product_key": "target_product_key",
  "user_id": "debug_user_001",
  "extra": {
    "user_name": "OAuth Debug User",
    "email": "debug_user@example.com",
    "locale": "zh"
  }
}

Response parameters #

FieldTypeDescription
codestringThe debug auth code.
redirect_urlstringThe referral link carrying the debug auth code.

Response example #

json #

{
  "code": 0,
  "message": "success",
  "data": {
    "code": "debug_code_example",
    "redirect_url": "https://target.example.com/landing?ps_ref=INVITE_CODE&x_auth_code=debug_code_example"
  }
}

7.5 Report a signup event #

Description After the promoted product completes automatic signup or confirms a valid conversion, it calls this endpoint to report the signup event to PartnerShare. PartnerShare completes attribution based on the referral invite code, and uses it for downstream commission settlement. Reference: https://www.partnershare.net/help/api/event-report

In the product-authorized login flow, the ps_ref received on the promoted product’s landing page must be submitted as invite_code when reporting.

Request info #

ItemValue
MethodPOST
Path/api/open/v1/track/conversion
Content-Typeapplication/json
CallerThe promoted product’s server

Request parameters #

ParameterTypeRequiredDescription
event_namestringYesEvent name. Always use signup for a signup event.
invited_user_idstringYesThe local, unique user identifier within the promoted product.
invite_codestringYesThe referral invite code — the value of ps_ref from the landing page URL.
invited_user_namestringNoThe user’s display name within the promoted product.
click_idstringNoClick ID. If the integrator is unsure of ps_ref‘s attribution type, it can be passed here the same as invite_code.

Request example #

json #

{
  "event_name": "signup",
  "invited_user_id": "local_user_10001",
  "invited_user_name": "Demo User",
  "invite_code": "INVITE_CODE"
}

Compatible variant: #

json #

{
  "event_name": "signup",
  "invited_user_id": "local_user_10001",
  "invited_user_name": "Demo User",
  "invite_code": "INVITE_CODE",
  "click_id": "INVITE_CODE"
}

Response parameters #

FieldTypeDescription
conversion_idintThe conversion event ID.
campaign_idintThe referral campaign ID.
affiliate_idintThe attributed promoter account ID.
event_typeintEvent type. 1 for a signup event.
event_namestringEvent name. signup for a signup event.
statusintThe conversion event’s status.

Response example #

json #

{
  "code": 0,
  "message": "Signup event reported successfully",
  "data": {
    "conversion_id": 10001,
    "campaign_id": 20001,
    "affiliate_id": 30001,
    "event_type": 1,
    "event_name": "signup",
    "status": 1
  }
}

Notes #

  • invite_code must come from the ps_ref value in the landing-page URL.
  • We recommend passing a stable, unique local user ID for invited_user_id within the promoted product.
  • Signup events should be reported only after the local user is successfully created or the signup is confirmed valid.
  • The same promoted product + invited_user_id combination cannot report a signup event more than once.
  • If a payment event needs to be reported later, it can be reported as a purchase event using the same invited_user_id once the signup event has succeeded.

7.6 Recommended call sequence #

  1. The promoting product calls POST /api/open/v1/oauth/authorize to get the referral link.
  2. The promoting product redirects the user to redirect_url.
  3. The promoted product’s landing page receives ps_ref and x_auth_code.
  4. The promoted product’s server calls POST /api/open/v1/oauth/getUserByAuthorizationCode to exchange for user info.
  5. The promoted product completes local automatic signup or login based on user_key.
  6. The promoted product calls POST /api/open/v1/track/conversion, reporting the signup event with ps_ref passed as invite_code.

8. FAQ (Technical Integration — Product-Authorized Login)

8.1 Why does the API say “API Key or signature cannot be empty”? #

This usually means the authentication fields are missing from the request headers. Confirm your request includes:

HeaderDescription
X-Api-KeyThe API Key PartnerShare assigned to the product
X-Api-TimestampSecond-precision timestamp
X-Api-SignSignature generated per the signing rules

Also confirm the header names are spelled correctly, and that the signature logic runs server-side.

8.2 Why does the API say “invalid signature”? #

Common causes include: #

  • Wrong API Secret used
  • The timestamp isn’t second-precision
  • The field names included in the signature are incomplete
  • Field names weren’t lowercased
  • Inconsistent field-name sorting

8.3 Why does generating a promotion authorization link fail? #

Common causes include: #

  • product_key doesn’t exist or doesn’t belong to the current API Key
  • target_product_key doesn’t exist
  • The promoted product hasn’t completed basic configuration
  • The promoted product hasn’t filled in a Promotion URL
  • There’s no available affiliate-program campaign under the promoted product
  • The affiliate-program campaign isn’t active

We recommend checking the product configuration, Promotion URL, and campaign status in the PartnerShare dashboard first.

8.4 Why doesn’t the referral link carry ps_ref or x_auth_code? #

Common causes include: #

  • The promoted product hasn’t correctly configured a Promotion URL
  • The Promotion URL itself is malformed
  • The affiliate-program campaign isn’t available
  • The referral relationship wasn’t successfully created
  • The business side re-constructed the URL during redirect, causing parameter loss

We recommend redirecting using the redirect_url returned by PartnerShare directly, rather than rewriting the link on the business side.

8.5 What parameters does the promoted product’s landing page need to receive? #

At minimum: #

ParameterDescription
x_auth_codeOne-time auth code, used server-side to exchange for user info
ps_refReferral invite code, used for signup-event postback and attribution

x_auth_code should be submitted to the promoted product’s server as soon as possible for exchange; ps_ref needs to be retained through to the signup-event postback stage.

8.6 Why does exchanging user info via auth code fail? #

Common causes include: #

  • x_auth_code has expired
  • x_auth_code has already been successfully exchanged
  • The product associated with the current API Key isn’t the promoted product tied to this auth code
  • The wrong field name was passed — the exchange endpoint expects code, not x_auth_code
  • The authorization flow didn’t fully generate an auth code

Correct request example:

json #

{
  "code": "the x_auth_code received on the landing page"
}

8.7 Can an auth code be reused? #

No. x_auth_code is a one-time, short-lived code — it becomes invalid immediately after successfully exchanging for user info.

The promoted product should consume the auth code server-side and avoid duplicate submissions from the frontend.

8.8 Can the auth code be saved as a login credential? #

No. x_auth_code is only for a one-time exchange for the authorized user’s info — it should not be saved as a long-term login credential, session token, or unique user identifier.

The promoted product should use the user_key returned by PartnerShare to build its local user-binding relationship.

8.9 How should the promoted product handle user_key? #

We recommend building a unique binding relationship between user_key and the promoted product’s local user ID.

Recommended logic: #

  1. Look up whether a local user is already bound to this user_key.
  2. If one exists, log that user in directly.
  3. If not, create a local user and save the user_key binding.
  4. On subsequent visits by the same authorized user, reuse this binding.

8.10 Why isn’t attribution completed after the signup event is reported? #

Common causes include: #

  • invite_code wasn’t passed
  • invite_code doesn’t use the ps_ref received on the landing page
  • ps_ref was lost somewhere in the signup flow
  • The promoted product didn’t report the event after signup succeeded
  • The current affiliate-program campaign isn’t available
  • The signup event was reported more than once and treated by the system as a duplicate conversion

In the product-authorized login flow, ps_ref must be passed as invite_code when reporting the signup event.

8.11 What parameters should the signup-event postback include? #

Recommended: #

json #

{
  "event_name": "signup",
  "invited_user_id": "local_user_10001",
  "invited_user_name": "Demo User",
  "invite_code": "INVITE_CODE"
}

Field reference: #

ParameterDescription
event_nameAlways signup
invited_user_idThe local, unique user identifier within the promoted product
invited_user_nameThe user’s display name within the promoted product (optional)
invite_codeThe ps_ref received on the landing page

8.12 What’s the relationship between ps_ref and invite_code? #

ps_ref is the parameter name carried in the referral link’s URL; invite_code is the field name in the signup-event postback endpoint.

In the product-authorized login flow, the relationship is:

text #

invite_code = ps_ref

In other words, once the promoted product’s landing page receives ps_ref, it must submit that same value as invite_code when reporting the signup event to PartnerShare.

8.13 If signup spans multiple pages, how do I avoid losing ps_ref? #

We recommend saving ps_ref to your server-side session, a short-lived cache, or a secure cookie as soon as the landing page receives it, and retrieving it when signup succeeds for the event postback.

We don’t recommend relying only on frontend page parameters to carry the value across multiple pages, since redirects, page refreshes, or third-party login flows can easily cause it to be lost.

8.14 Why does the signup event say “this conversion event already exists”? #

This means a signup event for the same invited_user_id under the same promoted product has already been reported.

We recommend the integrator implement idempotency handling:

  • Only report a signup event once per local user.
  • Prevent duplicate clicks on the frontend signup button.
  • Prevent duplicate triggers on the backend’s signup-success callback.

8.15 Can the debug auth-code endpoint be used in production? #

Not recommended. /api/open/v1/oauth/getDebugAuthCode is mainly for verifying code exchange, automatic signup, login, and signup-event postback during integration testing.

For production, use one of these instead:

text #

POST /api/open/v1/oauth/authorize
GET /api/open/v1/oauth/authorizeAndRedirect

8.16 Does the promoting product need to create its own promoter account or referral link? #

No. The first time an authorized-promotion login flow occurs between a promoting product and a promoted product, PartnerShare automatically creates or reuses the corresponding referral relationship and generates the referral link.

The promoting product only needs to call the authorization endpoint to get redirect_url.

8.17 Can the promoted product still control its own signup and login logic? #

Yes. PartnerShare is only responsible for authorization relay, referral-relationship maintenance, auth-code exchange, and signup-event attribution.

The promoted product remains responsible for its own local account creation, user binding, login-state generation, and business permission control.

8.18 Can the code-exchange endpoint be called directly from the frontend? #

Not recommended. The code-exchange endpoint requires an API Key and signature, and the API Secret must never be exposed in the frontend.

We recommend calling the code-exchange endpoint from the promoted product’s server, with the frontend only responsible for submitting x_auth_code to its own server.

8.19 What can be passed in the extra field? #

extra is used to pass supplementary user info the promoting product wants to provide to the promoted product, e.g.:

json #

{
  "user_name": "Demo User",
  "email": "demo@example.com",
  "locale": "zh"
}

We recommend only passing what’s necessary to complete automatic signup or login — avoid passing sensitive data or anything outside the scope of what the user authorized.

8.20 How do I check whether the integration is end-to-end complete? #

Check in this order: #

  1. The promoting product can successfully get redirect_url.
  2. redirect_url contains ps_ref and x_auth_code.
  3. The promoted product’s landing page can read both parameters.
  4. The promoted product’s server can exchange x_auth_code for user info.
  5. The promoted product can complete automatic signup or login based on user_key.
  6. After signup succeeds, ps_ref can be reported as invite_code in the signup-event postback.
  7. The corresponding attribution and promotion data appears in the PartnerShare dashboard.

Updated on 26/08/2026

Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
API Authentication & Signature Mechanism
大纲
  • 3.1 Register a PartnerShare brand-owner dashboard account
  • 3.2 Complete basic product configuration
  • 3.3 Fill in the Promotion URL
  • 3.4 Create an affiliate-program campaign
  • 3.5 Confirm the affiliate-program campaign is created and active
  • 5.1 Request conventions
    • Request example:
    • json
  • 5.2 Response conventions
    • json
    • Success response example:
    • json
    • Failure response example:
    • json
  • 5.3 URL parameter conventions
    • text
  • 5.4 Key field conventions
  • 6.1 Getting your API Key and API Secret
  • 6.2 Request headers
  • 6.3 Signing rules
    • Signature string format:
    • text
    • Example request parameters:
    • json
    • Field names included in the signature:
    • text
    • Sorted and joined:
    • text
    • Assume:
    • text
    • Final string to be signed:
    • text
  • 6.4 JavaScript signing example
    • javascript
  • 6.5 Go signing example
    • go
  • 6.6 PHP signing example
    • php
  • 6.7 Notes
    • text
    • text
  • 7.1 Generate a promotion authorization link
    • Request info
    • Request parameters
    • Request example
    • json
    • Response parameters
    • Response example
    • json
    • Notes
  • 7.2 Authorize and redirect directly
    • Request info
    • Request parameters
    • Request example
    • http
    • Success response
    • http
    • Failure response
    • json
  • 7.3 Get user info via auth code
    • Request info
    • Request parameters
    • Request example
    • json
    • Response parameters
    • Response example
    • json
    • Notes
  • 7.4 Get a debug auth code
    • Request info
    • Request parameters
    • Request example
    • json
    • Response parameters
    • Response example
    • json
  • 7.5 Report a signup event
    • Request info
    • Request parameters
    • Request example
    • json
    • Compatible variant:
    • json
    • Response parameters
    • Response example
    • json
    • Notes
  • 7.6 Recommended call sequence
  • 8.1 Why does the API say "API Key or signature cannot be empty"?
  • 8.2 Why does the API say "invalid signature"?
    • Common causes include:
  • 8.3 Why does generating a promotion authorization link fail?
    • Common causes include:
  • 8.4 Why doesn't the referral link carry ps_ref or x_auth_code?
    • Common causes include:
  • 8.5 What parameters does the promoted product's landing page need to receive?
    • At minimum:
  • 8.6 Why does exchanging user info via auth code fail?
    • Common causes include:
    • json
  • 8.7 Can an auth code be reused?
  • 8.8 Can the auth code be saved as a login credential?
  • 8.9 How should the promoted product handle user_key?
    • Recommended logic:
  • 8.10 Why isn't attribution completed after the signup event is reported?
    • Common causes include:
  • 8.11 What parameters should the signup-event postback include?
    • Recommended:
    • json
    • Field reference:
  • 8.12 What's the relationship between ps_ref and invite_code?
    • text
  • 8.13 If signup spans multiple pages, how do I avoid losing ps_ref?
  • 8.14 Why does the signup event say "this conversion event already exists"?
  • 8.15 Can the debug auth-code endpoint be used in production?
    • text
  • 8.16 Does the promoting product need to create its own promoter account or referral link?
  • 8.17 Can the promoted product still control its own signup and login logic?
  • 8.18 Can the code-exchange endpoint be called directly from the frontend?
  • 8.19 What can be passed in the extra field?
    • json
  • 8.20 How do I check whether the integration is end-to-end complete?
    • Check in this order:
PartnerShare

帮出海 SaaS 找到推广者、跑起联盟、放大用户推荐。先免费接入,跑出数据再升级。 Find promoters, run affiliate, and turn user referrals into a tracked growth channel. Start free, upgrade after data.

产品 Product

  • 联盟增长Affiliate growth
  • 邀返系统Referral program
  • 推广市场Marketplace
  • 价格Pricing

资源 Resources

  • 博客Blog
  • 帮助中心Help center
  • 最新资讯Latest news

导航站 Directory

  • 跨境电商导航Cross-border Ecommerce Directory
  • AIGC 导航AIGC Directory
  • 全球 IP 代理导航Global IP Proxy Directory
  • 精选产品Featured Products

联系方式 Contact

联系Contact business@partnershare.net
PartnerShare 公众号二维码
in XHS

版权所有© 广州标品科技创新有限公司, SAASBASE PTE. LTD. 丨 粤ICP备2022116046号 © Guangzhou Biaopin Technology Innovation Co., Ltd., SAASBASE PTE. LTD. · ICP 2022116046

服务协议Terms of Service 隐私政策Privacy