A customer segment refers to a grouping of customers that meet specified criteria, and the collection of these criteria are known as segment conditions. Merchants can create segments in the SHOPLINE Admin to filter target customers. For example, merchants can save all customers who subscribe to marketing emails as a customer segment.
You can create a customer segment using the segmentCreate GraphQL API. This article primarily introduces the composition of customer segment conditions and how to create the query
parameter in the segmentCreate
API.
Composition of customer segment conditions
Customer segment conditions consist of one or more condition groups, connected byand
, or
, or not
relationships. For example, as shown in the following figure, when the email subscription status is subscribed and the customer status is registered, these combined form a condition group.
Each condition group consists of individual conditions or nested condition groups, connected by and
or or
. For example, a simple condition might be that the email subscription status is subscribed.
Conditions
A condition is the fundamental element that composes a segment. As shown in the following table, the SHOPLINE Admin provides a variety of conditions for merchants to create segments.Condition groups
A condition group consists of one or more conditions or nested condition groups, collectively evaluating specified criteria. The groups circled as1
, 2
, and 3
in the following figure are examples of condition groups.
Combined condition groups
Combined condition groups include fixed conditions and relationships between those conditions. For example, in the following figure, the combined condition group Product purchased refers to customers who bought a specified product within a certain time period. This combined condition group consists of two conditions: Product purchased and Order date, connected by anand
relationship.
The Combined condition group fields section lists all available combined condition groups. The structure of combined condition groups is predetermined and cannot be customized.
Create customer segment conditions
You can create a customer segment using the segmentCreate Admin GraphQL API. Refer to the following data structures and field explanations to form thequery
parameter.
Conditions
Data structure
You can use the following JSON object to create a condition where the customer status is equal to registered.{
"type": 0,
"metafield": false,
"mfType": null,
"key": "status",
"value": [
0
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
}
The condition created by the above JSON object corresponds to the following display effect in the SHOPLINE Admin.
Field description
Field | Type | Required or not | Description |
---|---|---|---|
type | Number | Yes | The field must be set to the fixed value0 , which indicates a condition. |
metafield | Boolean | No | Indicates whether the condition is a metafield condition. + true : The condition is a metafield condition. + false : The condition is not a metafield condition. |
mfType | EnumMFType | No | The type of the metafield. Specify this field when you set metafield to true . |
key | String | Yes | The unique identifier for the condition. Refer to Condition fields for specific key values of different condition types. |
value | Array | Yes | A list of specific values of the condition. Refer to Condition fields for specific field value values of different condition types. |
operator | EnumOperator | Yes | The operator of query conditions, used to define logical relationships in query conditions, such as equal to, not equal to, greater than, and less than. Refer to Condition fields for specific operator values of different condition types. |
extInfo | ExtInfo | Yes | Used to control the display of customer segment interactions on the SHOPLINE Admin page. See extInfo for more information. Refer to Condition fields for specific extInfo values of different condition types. |
extInfo
extInfo
is a JSON string that enables the SHOPLINE Admin page to display different interactions based on various condition types.
For example, as shown in the following figures, Email subscription status and Last order date conditions show different interaction effects.
Email subscription status
{
"key": "emailSubscribeStatus",
"type": 0,
"operator": "IN",
"value": [
1,
2
],
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}"
}
Last order date
{
"key": "lastOrderTime",
"type": 0,
"operator": "BETWEEN",
"value": [
1
],
"extInfo": "{\"componentType\":\"DATE\",\"dateType\":\"LAST_7_DAY\"}"
}
EnumMFType
The following table shows valid values and descriptions of different metafield types.Value | Description |
---|---|
date | Date with a single value |
date_time | Date and time with a single value |
number_integer | Integer with a single value |
number_decimal | Decimal with a single value |
single_line_text_field | Single-line text with a single value |
multi_line_text_field | Multi-line text |
color | Color with a single value |
boolean | Boolean type |
list.date | Date with multiple values |
list.date_time | Date and time with multiple values |
list.number_integer | Integer with multiple values |
list.number_decimal | Decimal with multiple values |
list.single_line_text_field | Single-line text with multiple values |
list.color | Color with multiple values |
Condition groups
Data structure
You can use the following JSON object to create a condition group where the email domain is equal to @gmail.com and the language is equal to English.{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "emailDomain",
"value": [
"@gmail.com"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST_PAGE\",\"listSource\":\"emailDomain\",\"label\":[\"@gmail.com\"]}"
},
{
"type": 0,
"blockType": 0,
"key": "language",
"value": [
"en"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST\",\"listSource\":\"language\",\"label\":[\"English\"]}"
}
]
}
The condition group created by the above JSON object corresponds to the following display effect in the SHOPLINE Admin.
Field description
Field | Type | Required or not | Description |
---|---|---|---|
type | Number | Yes | The field must be set to the fixed value 1 , which indicates a condition group. |
blockType | Number | Yes | The type of the condition group. Valid values are: + 0 : combined condition group+ 1 : non-combined condition group |
key | String | No | The unique identifier for the condition. Specify this field if you set the value of blockType to 1 . Refer to Combined condition group fields for specific key values. |
relation | String | Yes | The logical relationship within the children list. Valid values are:+ and : indicates a conjunctive relationship. + or : indicates a disjunctive relationship. |
children | Array | Yes | A list of conditions or condition groups. |
Condition combination logic
The combinations of customer segment conditions follow two logics: conditions met and conditions unmet.Conditions met
Conditions met consist of one or more condition groups, as shown in the following figure.Conditions met are represented by the conditions
object in the query
JSON data, as shown in the following code sample.
{
"conditions": {
"type": 1,
"relation": "and",
"blockType": 0,
"children": [
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "emailDomain",
"value": [
"@gmail.com"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST_PAGE\",\"listSource\":\"emailDomain\",\"label\":[\"@gmail.com\"]}",
},
{
"type": 0,
"blockType": 0,
"key": "language",
"value": [
"en"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST\",\"listSource\":\"language\",\"label\":[\"English\"]}",
}
]
},
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "userSource",
"value": [
"1",
"2"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
},
{
"type": 0,
"blockType": 0,
"key": "status",
"value": [
3
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
}
]
}
]
}
}
Conditions unmet
Conditions unmet consist of only one condition group, as shown in the following figure.Conditions unmet are represented by the not
object in the query
JSON data, as shown in the following code sample.
{
"not": {
"type": 1,
"relation": "and",
"blockType": 0,
"children": [
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "status",
"value": [
0
],
"operator": "IN",
"relation": null,
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
},
{
"type": 0,
"blockType": 0,
"key": "ageLevel",
"value": [
4
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
}
]
}
]
}
}
Example
The following is a JSON object example of thequery
argument in the segmentCreate
API.
Caution: Ensure you serialize the JSON object to a JSON string before passing it to the API.
{
"conditions": {
"type": 1,
"relation": "and",
"blockType": 0,
"children": [
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "emailDomain",
"value": [
"@gmail.com"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST_PAGE\",\"listSource\":\"emailDomain\",\"label\":[\"@gmail.com\"]}",
},
{
"type": 0,
"blockType": 0,
"key": "language",
"value": [
"en"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"LIST\",\"listSource\":\"language\",\"label\":[\"English\"]}",
}
]
},
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "userSource",
"value": [
"1",
"2"
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
},
{
"type": 0,
"blockType": 0,
"key": "status",
"value": [
3
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
}
]
}
]
},
"not": {
"type": 1,
"relation": "and",
"blockType": 0,
"children": [
{
"type": 1,
"blockType": 0,
"relation": "and",
"children": [
{
"type": 0,
"blockType": 0,
"key": "status",
"value": [
0
],
"operator": "IN",
"relation": null,
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
},
{
"type": 0,
"blockType": 0,
"key": "ageLevel",
"value": [
4
],
"operator": "IN",
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}",
}
]
}
]
}
}
The conditions created by the above JSON object correspond to the following display effect in the SHOPLINE Admin.
The following example shows a complete segmentCreate
mutation containing the above conditions:
mutation {
segmentCreate(name: "Demo1", query: "{\"conditions\":{\"type\":1,\"relation\":\"and\",\"blockType\":0,\"children\":[{\"type\":1,\"blockType\":0,\"relation\":\"and\",\"children\":[{\"type\":0,\"blockType\":0,\"key\":\"emailDomain\",\"value\":[\"@gmail.com\"],\"operator\":\"IN\",\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"LIST_PAGE\\\",\\\"listSource\\\":\\\"emailDomain\\\",\\\"label\\\":[\\\"@gmail.com\\\"]}\"},{\"type\":0,\"blockType\":0,\"key\":\"language\",\"value\":[\"en\"],\"operator\":\"IN\",\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"LIST\\\",\\\"listSource\\\":\\\"language\\\",\\\"label\\\":[\\\"English\\\"]}\"}]},{\"type\":1,\"blockType\":0,\"relation\":\"and\",\"children\":[{\"type\":0,\"blockType\":0,\"key\":\"userSource\",\"value\":[\"1\",\"2\"],\"operator\":\"IN\",\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"ENUM\\\"}\"},{\"type\":0,\"blockType\":0,\"key\":\"status\",\"value\":[3],\"operator\":\"IN\",\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"ENUM\\\"}\"}]}]},\"not\":{\"type\":1,\"relation\":\"and\",\"blockType\":0,\"children\":[{\"type\":1,\"blockType\":0,\"relation\":\"and\",\"children\":[{\"type\":0,\"blockType\":0,\"key\":\"status\",\"value\":[0],\"operator\":\"IN\",\"relation\":null,\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"ENUM\\\"}\"},{\"type\":0,\"blockType\":0,\"key\":\"ageLevel\",\"value\":[4],\"operator\":\"IN\",\"extInfo\":\"{\\\"operatorType\\\":\\\"EQ\\\",\\\"componentType\\\":\\\"ENUM\\\"}\"}]}]}}") {
segment {
id
name
query
creationDate
lastEditDate
}
userErrors {
code
field
message
}
}
}
Field details
Condition fields
This section explains the condition fieldsvalue
, operator
, extInfo
, and key
based on different types of conditions, such as date, list, and integer.
Date
Pass in the preset date range or custom date range.value
To customize a date range, pass a list of timestamps, for example,[1701705600000, 1702051199999]
.
For preset data ranges, refer to the following table for valid values and pass in an enumeration value, such as [1]
.
Preset value | Description |
---|---|
0 | Today |
1 | Past 7 days |
2 | Past 30 days |
3 | Past 90 days |
4 | Past 12 months |
operator
Valid values are as follows:BETWEEN
: indicates a custom date range.EQ
: indicates a preset date range.
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value DATE . |
dateType | Valid values are: + CUSTOME : The custom date range.+ TODAY : The date range is set to today. + LAST_7_DAY : The date range is set to the last seven days. + LAST_30_DAY : The date range is set to the last thirty days. + LAST_90_DAY : The date range is set to the last ninety days. + LAST_12_MONTH : The date range is set to the last twelve months. |
key
The followingkey
values indicate different time condition types.
key values | Name | Description |
---|---|---|
createTime | Customer's join date | Date of store's first customer information acquisition |
singleOrderAmountTime | Order date | Used together with singleOrderAmount in Combined condition group to list the date of the order |
firstOrderTime | First order date | Date of customer's first successful order |
lastOrderTime | Last order date | Date of customer's last successful order |
lastAbandonedCreateTime | Last cart abandonment date | Date of customer's last cart abandonment |
lastLoginTime | Last login date | Date of customer's last login to online store |
loginChannelTime | Login date | Used together with loginChannel in Combined condition group to list the date of login |
lastCartCreateTime | Last add-to-cart date | Date of customer's last add-to-cart action |
purchasedItemTime | Order date | Used together with purchasedItem in Combined condition group to list the date of the order |
purchasedCateTime | Order date | Used together with purchasedCate in Combined condition group to list the date of the order |
Example
{
"key": "lastLoginTime",
"type": 0,
"operator": "EQ",
"value": [
2
],
"extInfo": "{\"componentType\":\"DATE\",\"dateType\":\"LAST_30_DAY\"}"
}
Integer
Pass in a range of integers.value
When the value ofoperator
is BETWEEN
, pass in a pair of integers, such as [2, 10]
.
For other operator
values, pass in a single integer, such as [10]
.
operator
Value | Description |
---|---|
EQ | Equal to |
NE | Not equal to |
GT | Greater than |
LT | Less than |
BETWEEN | Within the interval |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value NUMBER . |
key
The followingkey
values indicate different integer condition types.
key value | Name | Description |
---|---|---|
payOrderCnt | Order quantity | Accumulated successful orders |
loginCount | Visited times | Customer's visited times to online store in last 90 days |
Example
{
"key": "loginCount",
"type": 0,
"operator": "EQ",
"value": [
2
],
"extInfo": "{\"componentType\":\"NUMBER\"}"
}
Decimal
Pass in a range of decimals.value
When the value ofoperator
is BETWEEN
, pass in a pair of decimals, such as [2.3, 10.9]
.
For other operator
values, pass in a single decimal, such as [2.3]
.
operator
Value | Description |
---|---|
EQ | Equal to |
NE | Not equal to |
GT | Greater than |
LT | Less than |
BETWEEN | Within the interval |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value FLOAT . |
key
Only the metafield condition supports the decimal data type. Refer to Metafield for how to specifykey
values.
Example
{
"key": "my_fields.float",
"type": 0,
"operator": "EQ",
"value": [
1.33
],
"metafield": true,
"mfType": "list.number_decimal",
"extInfo": "{\"componentType\":\"FLOAT\",\"mfName\":\"Decimal\"}"
}
Amount
Pass in a range of amounts in cents. For example,$20
corresponds to 2000 cents.
value
When the value ofoperator
is BETWEEN
, pass in a pair of amount values, such as [2000, 10000]
.
For other operator
values, pass in a single amount value or a list of amount values, such as [10000]
.
operator
Value | Description |
---|---|
EQ | Equal to |
NE | Not equal to |
GT | Greater than |
LT | Less than |
BETWEEN | Within the interval |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value PRICE . |
key
The followingkey
values indicate different amount condition types.
key value | Name | Description |
---|---|---|
totalAmount | Consumption amount | Accumulated consumption amount |
singleOrderAmount | Single consumption amount | Successful order amount history |
unitPrice | Average order value | Customer's average consumption amount of each order |
preferPrice | Price preference | Preferential product prices figured out through customer's purchase history |
preferDiscount | Discount sensitivity | Preferential discount amount of each order figured out through customer's purchase history |
Example
{
"key": "totalAmount",
"type": 0,
"operator": "EQ",
"value": [
20000
],
"extInfo": "{\"componentType\":\"PRICE\"}"
}
Boolean
Pass in a boolean.value
Valid values aretrue
and false
.
true
: indicates an affirmative or positive condition, essentially indicating yes.false
: indicates a negative or opposite condition, essentially indicating no.
operator
Value | Description |
---|---|
EQ | Equal to |
NE | Not equal to |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value BOOLEAN . |
key
Only the metafield condition supports the boolean data type. Refer to Metafield for how to specifykey
values.
Example
{
"key": "my_fields.vip",
"type": 0,
"operator": "EQ",
"value": false,
"metafield": true,
"mfType": "boolean",
"extInfo": "{\"componentType\":\"BOOLEAN\",\"mfName\":\"Important customer\"}"
}
Address
Pass in an address object.value
Provide the address information specified in the Key column of the following table.Key | Type | Required or not | Description |
---|---|---|---|
country | String | Yes | The country or region. |
countryCode | String | Yes | The two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard. For example, US . |
province | String | Yes | The province. |
provinceCode | String | Yes | The code that represents the province. |
city | String | Yes | The city. |
cityCode | String | Yes | The code that represents the city. |
district | String | Yes | The district. |
districtCode | String | Yes | The code that represents the district. |
operator
Value | Description |
---|---|
EQ | Equal to |
NE | Not equal to |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value ADDRESS . |
key
The followingkey
values indicate the address condition.
key value | Name | Description |
---|---|---|
address | Address | Customer's country, province, city |
Example
{
"key": "address",
"type": 0,
"operator": "EQ",
"value": {
"countryCode": "US",
"country": "United States",
"provinceCode": "4200001",
"province": "Alabama",
"cityCode": "",
"city": "",
"districtCode": "",
"district": ""
},
"extInfo": "{\"componentType\":\"ADDRESS\"}"
}
Tag
SHOPLINE predefines a set of recommended tags that allow for quick filtering to identify specific customer groups.operator
The field must be set to the fixed valueEQ
.
value
The field must be set to the fixed value1
.
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value TAG . |
subGroup | The tag subgroup. Refer to the table under key for valid values. |
key
The followingkey
values indicate different tag condition types.
key value | Name | Description | subGroup |
---|---|---|---|
isLoginNotPay | Visited without placing an order | Customers who visited online store while not placing orders | attractNew |
isAddCartNotPayIn30 | Add products into cart without placing orders in the last 30 days | Customers who subscribed emails and added into cart while not placing orders in the last 30 days | attractNew |
isAbandonedIn30 | Abandoned order last 30 days | Customers who subscribed emails and abandoned shopping cart | attractNew |
isNotOrderIn30 | Subscribed emails without placing orders last 30 days | Customers who subscribed emails and not placing orders in the last 30 days | attractNew |
isFirstOrder | First order subscribers | Customers who subscribed emails and purchased for only once | oldRepurch |
isRecentHighConsume | High consumption recent days | Customers with higher consumption amount in last 90 days | oldRepurch |
isRecentHighOrder | Many orders placed recent days | Customers with more orders placed last 90 days | oldRepurch |
isRecentConsumed | Purchased recent days | Customers with consumption history in last 90 days | lossRecovery |
isOnceActived | Customers with active history | Customers with higher consumption history while not placing orders in recent 12 months | lossRecovery |
isRecentAbandoned | Abandoned order recent days | Customers who abandoned cart in the last 30 days | lossRecovery |
isHighValue | High-value customers | Customers with high value from RFM calculation | keyPperations |
isBirthdayInNextMonth | Birthday in next month | Customers with birthday next month | keyPperations |
isRecentActived | Active in recent days | Customers with login history in the last 30 days | keyPperations |
isRepurchased | Returned customers | Customers with life cycle as returned customer | keyPperations |
Example
{
"key": "isNotOrderIn30",
"type": 0,
"operator": "EQ",
"value": 1,
"extInfo": "{\"subGroup\":\"attractNew\",\"componentType\":\"TAG\",}"
}
Enumeration list
Pass in a list of data sets for the enumeration type. For example, the valid values for customer Status are Black list, Not invited, Invited, and Registered.key
The followingkey
values indicate different condition types for the enumeration list.
key value | Name | Description |
---|---|---|
userSource | Customer's join channel | Source of store's first customer acquisition |
platform | Platform where customers join | The platform sales channel where the store obtains customers for the first time |
status | Customer status | Customer status |
emailSubscribeStatus | Email subscription status | Customer's email subscription status |
gender | Gender | Customer's gender |
ageLevel | Age | Customer's age |
birthdayMonth | Birth month | Customer's birth month |
smsSubscribeStatus | SMS subscription status | Customer's SMS subscription status |
preferActivity | Activity type preference | Preferential activity types figured out through customer's purchase history |
rfm | RFM value | Customer value figured out through comprehensive consideration of customer's consumption amount, times and recent consumption time |
customerCycle | Customer life cycle | Customers distributed by life cycle, as potential customers, first-time customer, returned customer, lost customer |
value
The following table lists enumerated values corresponding to variouskey
types. For example, you can pass in [1, 2]
.
userSource
Value | Description |
---|---|
1 | Import from admin |
2 | Online store registration |
3 | Offline store |
4 | Store relocation |
5 | POS registration |
6 | Sign in with Multipass |
7 | Storefront |
8 | Manually created |
16 | Social media |
17 | API creation |
18 | Website subscription |
19 | Unlogged user order |
20 | |
23 | TikTok |
24 | Shop App |
25 | Marketplace |
26 | Apple |
platform
Value | Description |
---|---|
1 | shopify |
2 | bigcommerce |
3 | woocommerce |
4 | lightspeed |
5 | shoplazaza |
6 | etsy |
7 | zalora |
8 | kogan |
9 | amazon |
10 | ebay |
status
value | Description |
---|---|
0 | Black list |
1 | Not invited |
2 | Invited |
3 | Registered |
emailSubscribeStatus
Value | Description |
---|---|
0 | Unsubscribed |
1 | Subscribed |
2 | Not subscribed |
3 | Awaiting confirmation |
5 | Not set |
gender
Value | Description |
---|---|
0 | Unknown |
1 | Male |
2 | Female |
3 | Undisclosed |
ageLevel
Value | Description |
---|---|
0 | 0 - 20 |
1 | 21 - 30 |
2 | 31 - 40 |
3 | 41 - 50 |
4 | 51 - 60 |
5 | 61 - 70 |
6 | 71 - 100 |
birthdayMonth
Value | Description |
---|---|
1 | January |
2 | February |
3 | March |
4 | April |
5 | May |
6 | June |
7 | July |
8 | August |
9 | September |
10 | October |
11 | November |
12 | December |
smsSubscribeStatus
Value | Description |
---|---|
0 | Unsubscribed |
1 | Subscribed |
2 | Not subscribed |
preferActivity
Value | Description |
---|---|
0 | Discount activity |
1 | Flash sales |
2 | Tie-in sales |
4 | Combo pack |
5 | Giveaway |
6 | Pre-sale |
rfm
Value | Description |
---|---|
0 | High-value customers |
1 | Potential high-value customers |
2 | Loyal customers |
3 | Potential loyal customers |
4 | Big spenders |
5 | Potential big spender |
6 | At-risk customers |
7 | Almost lost customers |
customerCycle
Value | Description |
---|---|
0 | Potential customers |
1 | First-time customers |
2 | Returned customers |
3 | Lost customers |
operator
value | Description |
---|---|
IN | Include |
NOT_IN | Exclude |
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Value |
---|---|
componentType | The field must be set to the fixed value ENUM . |
operatorType | The field must be set to the fixed value EQ . |
Example
{
"key": "status",
"type": 0,
"operator": "IN",
"value": [
3,
0
],
"extInfo": "{\"operatorType\":\"EQ\",\"componentType\":\"ENUM\"}"
}
Asnychronous data list
Pass in a list of dynamic data values. For example, the available values for Products purchased will vary depending on the merchant's product data.value
The data source value collection. For example, if the data source is a product, then pass in the collection of product IDs, such as['productId111', 'productId222']
.
extInfo
This field is a JSON string that contains key-value pairs, refer to the following table for valid values.Key | Type | Value |
---|---|---|
componentType | String | This affects the way to query the data source. Valid values are: + LIST : indicates that the API is called to get and display all available options at once. + LIST_PAGE : indicates that the API is called for paginated retrieval and display of available options. Pass in a fixed value based on the corresponding key-value relationships outlined in the key table. |
operatorType | String | This affects the display texts for the page operators. Valid values are: + EQ : displays page texts Equals to and Not equals to.+ IN : displays page texts Include and Exclude.For example, if you pass in EQ , the texts Equals to and Not equals to will be displayed, as shown in the following figure. ![]() Pass in a fixed value based on the corresponding key-value relationships outlined in the key table. |
listSource | String | The data source. Pass in a fixed value based on the corresponding key-value relationships outlined in the key table. |
label | Array[String] | The display texts. For example, if you pass in a collection of product IDs for value , then label should be a collection of product names. |
key
The followingkey
values indicate different condition types for the asynchronous data list, and corresponding values for componentType
, operatortype
, and listSource
.
key value | Name | Description | componentType | operatorType | listSource |
---|---|---|---|---|---|
language | Customer language | Customer's online store language | LIST | EQ | language |
lastLoginChannel | Last visit channel | Source of customer's last visit to online store | LIST | EQ | loginChannel |
loginChannel | Channels visited | Sources of customer's visit to online store in last 90 days | LIST | EQ | loginChannel |
purchasedCate | Product category purchased | Purchased products of specific category | LIST | IN | categoryList |
preferCate | Product category preference | Preferential product categories figured out through customer's purchase history | LIST | IN | categoryList |
emailDomain | Email domain | Customer's email domain | LIST_PAGE | EQ | emailDomain |
purchasedItem | Products purchased | Purchased specific products | LIST_PAGE | IN | productList |
preferItemTag | Product tag preference | Preferential product tags figured out through customer's purchase history | LIST_PAGE | IN | productLabelList |
customerTag | Customer tag | Tags added for customers manually in customer list | LIST_PAGE | IN | customerLabelList |
operator
value | Description |
---|---|
IN | Include |
NOT_IN | Exclude |
Example
{
"key": "purchasedCate",
"type": 0,
"operator": "IN",
"value": [
"12257647834446320149372682",
"12257647834482223391662682"
],
"extInfo": "{\"operatorType\":\"IN\",\"componentType\":\"LIST\",\"listSource\":\"categoryList\",\"label\":[\"fashion shirt\",\"summer vacation\"]}"
}
Metafield
All metafields under the customer module can be conditions. For more information about metafields, refer to Guide to using metafields feature.key
In the format:{metafield.namespace}.{metafield.key}
. For example, my_fields.date
.
value/operator/extInfo
Pass invalue
, operator
, and extInfo
according to the corresponding condition types. The mapping relationship between metafield types and condition types is as follows:
Metafield type | Condition type | Description |
---|---|---|
date | Date | - |
date_time | ||
list.date | ||
list.date_time | ||
boolean | Boolean | - |
single_line_text_field | Asynchronous data list | The value of extInfo.componentType must be set to LIST_PAGE_FRONT . |
list.single_line_text_field | ||
multi_line_text_field | ||
color | ||
list.color | ||
number_decimal | Decimal | - |
list.number_decimal | ||
number_integer | Integer | - |
list.number_integer |
extInfo
In addition to the parameters required by various condition types, you must also specify the following parameter.Key | Type | Required or not | Description |
---|---|---|---|
mfName | string | Yes | The name of the metafield. |
Example
{
"key": "my_fields.date",
"type": 0,
"operator": "EQ",
"value": [
3
],
"metafield": true,
"mfType": "list.date",
"extInfo": "{\"componentType\":\"DATE\",\"mfName\":\"Date\",\"dateType\":\"LAST_90_DAY\"}"
}
Combined condition group fields
relation
The field must be set to the fixed valueand
, which indicates that the relationship between conditions in a combined condition group is "and".
key
The following conditions are combined condition groups:key value | Name | Included basic conditions |
---|---|---|
singleOrderAmount | Single consumption amount | + singleOrderAmount + singleOrderAmountTime |
loginChannel | Channels visited | + loginChannel + loginChannelTime |
purchasedItem | Products purchased | + purchasedItem + purchasedItemTime |
purchasedCate | Product category purchased | + purchasedCate + purchasedCateTime |
Example
The following example shows a JSON object used for creating a combined condition group Product purchased.{
"key": "purchasedItem",
"type": 1,
"relation": "and",
"blockType": 1,
"children": [
{
"key": "purchasedItem",
"type": 0,
"operator": "IN",
"value": [
"16054924754902568180002744"
],
"extInfo": "{\"operatorType\":\"IN\",\"componentType\":\"LIST_PAGE\",\"listSource\":\"productList\",\"label\":[\"Halloween Pumpkin Print T-shirt\"]}"
},
{
"key": "purchasedItemTime",
"type": 0,
"operator": "EQ",
"value": [
2
],
"extInfo": "{\"componentType\":\"DATE\",\"dateType\":\"LAST_30_DAY\"}"
}
],
}
The combined condition group created by the above JSON object corresponds to the following display effect in the SHOPLINE Admin.
Error loading component.