快工助手跨境电商知识与商机助手

v2.principal.get_shop_affiliate_performance

Shopee 官方资料 · Shopee Open Platform 接口参考 · 适合开发者

stable本次发布有变化全部展示

来自 Shopee 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
Shopee / profile.shopee.api_reference
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/shopeeaudience/developercategory/api_doctopic/apitopic/developer

资料正文

§1 v2.principal.get_shop_affiliate_performance

Queries affiliate performance data for the specified shops within the selected time range. Supports request granularity by day, week, month, quarter, year, or customize, and returns both overall summary metrics and shop-level detailed metrics with placed-order and confirmed-order views.

#

§2 Overview

Overview

FieldValue
ModuleBrandPortal
API typePrincipal
HTTP methodPOST
Path/api/v2/principal/get_shop_affiliate_performance
Production URLhttps://partner.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance
Sandbox URLhttps://partner.test-stable.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance
PermissionBrand Portal Service
#

§3 Request parameters

Request parameters

NameTypeRequiredSampleDescription
start_datestringYes2026-01-01Start date of the requested period in YYYY-MM-DD format. Limitations: - Must use the YYYY-MM-DD format.; - Must be a valid calendar date.; - Must not be later than end_date.; - Validation is based on the requested timezone.; - The earliest selectable date is calculated as: current day in timezone - 1 day - 2 years.; - The exact boundary rules depend on granularity: -- For customize, start_date must not be earlier than the earliest selectable date.; -- For day, start_date must equal end_date.; -- For week, start_date must be a Sunday.; -- For month, start_date must be the first day of the month.; -- For quarter, start_date must be the first day of the quarter.; -- For year, start_date must be the first day of the year.
end_datestringYes2026-01-01End date of the requested period in YYYY-MM-DD format. Limitations: - Must use the YYYY-MM-DD format. - Must be a valid calendar date. - Must not be earlier than start_date. - Validation is based on the requested timezone. - For customize, end_date must not be later than the day before the current day in the requested timezone. The inclusive date range from start_date to end_date must not exceed 366 days. - For day, end_date must equal start_date. - For week, end_date must be within the selected week range: from start_date (Sunday) to the end of that Sunday-to-Saturday week, or to the latest selectable day if the week extends beyond today. Formally: startDate ≤ endDate ≤ min(startDate + 6 days, today - 1 day). - For month, end_date must be within the selected month: from the 1st day of the month to the last calendar day of that month, or to the latest selectable day for the current month. Formally: startDate ≤ endDate ≤ min(month end, today - 1 day). - For quarter, end_date must be within the selected quarter: from the 1st day of the quarter to the last calendar day of that quarter, or to the latest selectable day for the current quarter. Formally: startDate ≤ endDate ≤ min(quarter end, today - 1 day). - For year, end_date must be within the selected year: from January 1st to December 31st of that year, or to the latest selectable day for the current year. Formally: startDate ≤ endDate ≤ min(Dec 31, today - 1 day).
timezonestringYesGMT+8Timezone used for date boundary calculation, selectable date validation, and timestamp conversion.; Limitations: - Enum values: ["GMT+7", "GMT+8", "GMT-3"]; - All date validation rules are evaluated in the requested timezone.
granularitystringYesdayAggregation granularity that determines the validation rules for the requested date range and the reporting period.; Limitations: - Supported values are customize, day, week, month, quarter, and year.; - customize is validated as a free date range and is internally queried as daily data.; - day represents a single calendar day.; - week requires a Sunday-based calendar week.; - month requires a calendar month range.; - quarter requires a calendar quarter range.; - year requires a calendar year range.; - Any other value is rejected as invalid_parameter.
shop_listobject[]NoList of shops to be queried. This field is optional. If omitted or passed as an empty array, the API will return data for all shops under the specified principal_id. Limitations: - If provided, must contain at most 50 shops. - If omitted or passed as [], all shops under the specified principal_id will be queried. - If provided as a non-empty array, all shops must belong to the specified principal_id. Duplicate shops are not allowed.
shop_list.shop_idint64Yes181050132Shop identifier of the target shop to be queried. Limitations: - Required for every shop object when shop_list is provided as a non-empty array. - Must belong to the specified principal_id.
shop_list.currencystringNoUSDCurrency used for amount-based metrics for the shop.; Limitations: - Optional for every shop object in shop_list.; - Supported values are LOCAL and USD.; - Invalid currency values are rejected as invalid_parameter.; - Defaults to USD when omitted.
#

§4 Response parameters

Response parameters

NameTypeRequiredSampleDescription
request_idstringd518f85d-e0af-41b8-aa72-2e43598031a1The identifier for an API request, used for troubleshooting and log tracing.
errorstringIndicate error type if any error happened. Empty string if no error.
messagestringIndicate error details if any error happened. Empty string if no error.
responseobjectBusiness response payload. See Business Response Parameters below.
response.summaryobject[]Aggregated summary metrics for the requested date range, representing the overall affiliate performance of the requested shop set.
response.summary.currencystringUSDCurrency code used for all amount-based metrics in the summary. Summary values are returned in USD.
response.summary.sales_placedfloat2638975.3032753896Total value of placed orders generated through affiliate marketing during the selected period.
response.summary.sales_confirmedfloat2614407.688750359Total value of confirmed orders generated through affiliate marketing during the selected period. Confirmed orders are either non-Cash On Delivery (non-COD) orders that have been paid for or COD orders that have been confirmed for shipping (usually 30 mins after placing the order).
response.summary.units_sold_placedint6420118Total number of items sold in placed orders generated through affiliate marketing during the selected period.
response.summary.units_sold_confirmedint6419926Total number of items sold in confirmed orders generated through affiliate marketing during the selected period.
response.summary.orders_placedint6422174Total number of placed orders generated through affiliate marketing during the selected period.
response.summary.orders_confirmedint6419456Total number of confirmed orders generated through affiliate marketing during the selected period. Confirmed orders are either non-Cash On Delivery (non-COD) orders that have been paid for or COD orders that have been confirmed for shipping (usually 30 mins after placing the order).
response.summary.estimated_commission_placedfloat76814.87132010002Estimated total payout from placed affiliate marketing orders during the selected period.
response.summary.estimated_commission_confirmedfloat76075.89821397001Estimated total payout from confirmed affiliate marketing orders during the selected period.
response.summary.roi_placedfloat34.355005195261626Return on Investment = Sales Placed / Estimated Commission Placed. It can be used to evaluate the efficiency of your investment in affiliate marketing.
response.summary.roi_confirmedfloat34.36578141209865Return on Investment = Sales Confirmed / Estimated Commission Confirmed. It can be used to evaluate the efficiency of your investment in affiliate marketing.
response.summary.buyers_placedint6420676Total number of unique buyers who placed affiliate marketing orders from your shop set during the selected period.
response.summary.buyers_confirmedint6418836Total number of unique buyers with confirmed affiliate marketing orders from your shop set during the selected period.
response.summary.new_buyers_placedint6415175Total number of unique new buyers who placed affiliate marketing orders from your shop set during the selected period.
response.summary.new_buyers_confirmedint6413618Total number of unique new buyers with confirmed affiliate marketing orders from your shop set during the selected period.
response.detailsobject[]List of shop-level detail records that returns affiliate performance metrics for each selected shop within the requested date range.
response.details.regionstringMYRegion code of the shop.
response.details.currencystringUSDCurrency code used for all amount-based metrics of this shop item.
response.details.shop_idint64123793634Shop identifier.
response.details.shop_namestringHUAWEI OFFICIAL STOREShop name.
response.details.sales_placedfloat2196698.681816249Total value of placed orders generated through affiliate marketing during the selected period.
response.details.sales_confirmedfloat2176115.5220428193Total value of confirmed orders generated through affiliate marketing during the selected period. Confirmed orders are either non-Cash On Delivery (non-COD) orders that have been paid for or COD orders that have been confirmed for shipping (usually 30 mins after placing the order).
response.details.units_sold_placedint6417366Total number of items sold in placed orders generated through affiliate marketing during the selected period.
response.details.units_sold_confirmedint6417202Total number of items sold in confirmed orders generated through affiliate marketing during the selected period.
response.details.orders_placedint6419287Total number of placed orders generated through affiliate marketing during the selected period.
response.details.orders_confirmedint6416802Total number of confirmed orders generated through affiliate marketing during the selected period. Confirmed orders are either non-Cash On Delivery (non-COD) orders that have been paid for or COD orders that have been confirmed for shipping (usually 30 mins after placing the order).
response.details.estimated_commission_placedfloat57418.763793350015Estimated total payout from placed affiliate marketing orders during the selected period.
response.details.estimated_commission_confirmedfloat56850.331386400016Estimated total payout from confirmed affiliate marketing orders during the selected period.
response.details.roi_placedfloat38.257505677450006Return on Investment = Sales Placed / Estimated Commission Placed. It can be used to evaluate the efficiency of your investment in affiliate marketing.
response.details.roi_confirmedfloat38.27797426988084Return on Investment = Sales Confirmed / Estimated Commission Confirmed. It can be used to evaluate the efficiency of your investment in affiliate marketing.
response.details.buyers_placedint6418003Total number of unique buyers who placed affiliate marketing orders from this shop during the selected period.
response.details.buyers_confirmedint6416301Total number of unique buyers with confirmed affiliate marketing orders from this shop during the selected period.
response.details.new_buyers_placedint6413300Total number of unique new buyers who placed affiliate marketing orders from this shop during the selected period.
response.details.new_buyers_confirmedint6411889Total number of unique new buyers with confirmed affiliate marketing orders from this shop during the selected period.
#

§5 Common parameters

Common parameters

NameTypeRequiredSampleDescription
partner_idint1Partner ID is assigned upon registration is successful. Required for all requests.
timestamptimestamp1610000000This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes.
access_tokenstringc09222e3fc40ffb25fc947f738b1abf1The token for API access, using to identify your permission to the api. Valid for multiple use and expires in 4 hours.
principal_idint1Shopee's unique identifier for a principal.
signstringe318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2Signature generated by(depends on different APIs) partner_id, api path, timestamp, access_token, principal_id and partner_key via HMAC-SHA256 hashing algorithm.
#

§6 Request samples

Request samples

#

§7 Payload

Payload

{
	"start_date": "2026-01-01",
	"end_date": "2026-01-01",
	"timezone": "GMT+8",
	"granularity": "day",
	"shop_list": [
		{
			"shop_id": 181050132,
			"currency": "USD"
		},
                {
			"shop_id": 1494995608,
			"currency": "USD"
		}
	]
}
#

§8 Java

Java

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://partner.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp")
.header("Content-Type","application/json")
.body("{
   \"end_date\": \"2026-01-01\",
   \"granularity\": \"day\",
   \"shop_list\": [
      {
         \"currency\": \"USD\",
         \"shop_id\": 181050132
      }
   ],
   \"start_date\": \"2026-01-01\",
   \"timezone\": \"GMT+8\"
}")
.asString();
#

§9 PHP

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://partner.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "end_date": "2026-01-01",
    "granularity": "day",
    "shop_list": [
        {
            "currency": "USD",
            "shop_id": 181050132
        }
    ],
    "start_date": "2026-01-01",
    "timezone": "GMT+8"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
#

§10 cURL

cURL

curl --location --request POST 'https://partner.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp' \
--header 'Content-Type: application/json' \
--data-raw '{
   "end_date": "2026-01-01",
   "granularity": "day",
   "shop_list": [
      {
         "currency": "USD",
         "shop_id": 181050132
      }
   ],
   "start_date": "2026-01-01",
   "timezone": "GMT+8"
}'
#

§11 Python

Python

import requests
import json

url = "https://partner.shopeemobile.com/api/v2/principal/get_shop_affiliate_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp"

payload=json.dumps({
  "end_date": "2026-01-01",
  "granularity": "day",
  "shop_list": [
    {
      "currency": "USD",
      "shop_id": 181050132
    }
  ],
  "start_date": "2026-01-01",
  "timezone": "GMT+8"
})
headers = {
  'Content-Type': 'application/json'
}
response = requests.RPCRequest("POST",url,headers=headers, data=payload, allow_redirects=False)

print(response.text)
#

§12 Response sample

Response sample

#

§13 JSON

JSON

{
    "error": "",
    "message": "",
    "response": {
        "summary": [
            {
                "currency": "USD",
                "sales_placed": 2638975.3032753896,
                "sales_confirmed": 2614407.688750359,
                "units_sold_placed": 20118,
                "units_sold_confirmed": 19926,
                "orders_placed": 22174,
                "orders_confirmed": 19456,
                "estimated_commission_placed": 76814.87132010002,
                "estimated_commission_confirmed": 76075.89821397001,
                "roi_placed": 34.355005195261626,
                "roi_confirmed": 34.36578141209865,
                "buyers_placed": 20676,
                "buyers_confirmed": 18836,
                "new_buyers_placed": 15175,
                "new_buyers_confirmed": 13618
            }
        ],
        "details": [
            {
                "region": "MY",
                "currency": "USD",
                "shop_id": 123793634,
                "shop_name": "HUAWEI OFFICIAL STORE",
                "sales_placed": 2196698.681816249,
                "sales_confirmed": 2176115.5220428193,
                "units_sold_placed": 17366,
                "units_sold_confirmed": 17202,
                "orders_placed": 19287,
                "orders_confirmed": 16802,
                "estimated_commission_placed": 57418.763793350015,
                "estimated_commission_confirmed": 56850.331386400016,
                "roi_placed": 38.257505677450006,
                "roi_confirmed": 38.27797426988084,
                "buyers_placed": 18003,
                "buyers_confirmed": 16301,
                "new_buyers_placed": 13300,
                "new_buyers_confirmed": 11889
            },
            {
                "region": "SG",
                "currency": "LOCAL",
                "shop_id": 181050132,
                "shop_name": "Huawei Official Store",
                "sales_placed": 567144.2500000002,
                "sales_confirmed": 562035.1700000002,
                "units_sold_placed": 2752,
                "units_sold_confirmed": 2724,
                "orders_placed": 2887,
                "orders_confirmed": 2654,
                "estimated_commission_placed": 24868.776899999997,
                "estimated_commission_confirmed": 24649.923740000006,
                "roi_placed": 22.80547420086431,
                "roi_confirmed": 22.800685954576508,
                "buyers_placed": 2673,
                "buyers_confirmed": 2535,
                "new_buyers_placed": 1875,
                "new_buyers_confirmed": 1729
            }
        ]
    },
    "request_id": "d518f85d-e0af-41b8-aa72-2e43598031a1"
}
#

§14 Error example

Error example

#

§15 JSON

JSON

{
    "request_id": "ffce7f67-be67-4d3c-975e-925165ec6dfb",
    "error": "error_param",
    "message": "for week granularity, start_date must be a Sunday.",
    "response": null
}
#

§16 Errors

Errors

ErrorDescriptionSolution
error_paramtimezone is required
error_paramtimezone is invalid. allowed values: GMT+7, GMT+8, GMT-3.
error_paramgranularity is required
error_paramrequest body is invalid
error_paramshop_id is required
error_paramshop_list contains shop that does not belong to the principal.
error_paramshop_list contains duplicate shop_id
error_paramcurrency is invalid
error_paramend_date is not ready, please retry later
error_paramfor day granularity, start_date must equal end_date.
error_paramday range is outside the allowed selectable range.
error_paramfor week granularity, end_date must be within the selected week range
error_paramfor week granularity, start_date must be a Sunday.
error_paramweek start_date is earlier than the earliest allowed week.
error_paramstart_date cannot be later than end_date.
error_parammonth range is outside the allowed selectable range.
error_paramfor month granularity, start_date must be the first day of month.
error_paramfor month granularity, end_date must be within the selected month range.
error_paramfor quarter granularity, end_date must be within the selected quarter range.
error_paramyear range is outside the allowed selectable range.
error_paramfor quarter granularity, start_date must be the first day of quarter.
error_paramfor quarter granularity, end_date must be within the selected quarter range.
error_paramstart_date is earlier than the earliest allowed date
error_paramfor year granularity, end_date must be within the selected year range.
error_paramend_date must not be later than the latest selectable day.
error_permissionauth failed
error_paramstart_date is required
error_paramstart_date is required; start_date must use YYYY-MM-DD
error_paramend_date is required
error_paramend_date must use YYYY-MM-DD
#

§17 Common errors

Common errors

ErrorDescriptionSolution
error_authpartner_id is invalid
error_authThe App is deleted, and you'll be unable to make any API call.
error_authApp developer’s permissions for authorizations have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
error_paramThere is no partner_id in query.
error_paramInvalid partner_id.
error_paramno timestamp
error_paramInvalid timestamp
error_paramThere is no sign in query.
error_signWrong sign.
invalid_partner_idInvalid partner_id, please have a check.
error_authNo permission to current api.
error_api_call_restrictedThe App permission for api call have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
api_suspendedThe API is offline. Please call v2 API instead.
error_limitThe total API call number made by your APP has reached the daily API call limit, please try again after 00: 00 (UTC+08:00)
error_rate_limitToo many requests. You have reached the rate limit. Please try again later.
source_ip_undeclaredRequest Source IP ({ip}) is undeclared. Please declare all your IP addresses in the Shopee Open Platform Console > App list > IP Address Whitelist
error_paramPermission denied. This API is currently offline or the request path is incorrect.
error_paramPartner_id is invalid, should be an integer between 0 and 4294967295.
error_paramno timestamp.
error_paramTimestamp is invalid, should be an integer between 0 and 4294967295.
error_paramTimestamp is expired.
error_partner_key_expiredYour API partner key has expired, please reset the Live API Partner Key in Console to get a new valid partner key to call open api.
error_api_permissionThis app type has no permission to this API.
#

§18 Update log

Update log

DateChange
2026-07-09New API
#