---
title: "Mass sync marketing event statistics"
description: "Bulk sync marketing event statistics (Create marketing engagement)"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/marketing/marketing-events/mass-sync-marketing-event-statistics'
  md: 'https://developer.shopline.com/docs/admin-rest-api/marketing/marketing-events/mass-sync-marketing-event-statistics.md'
---
# Mass sync marketing event statistics

Bulk sync marketing event statistics (Create marketing engagement)

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_marketing_event`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /sales/marketing_events/sync_data.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_marketing_event`

## Request

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

### Request Body

* `marketing_activity_datas`

  array<object>

  Marketing event data, statistical data is full data

  * `marketing_event_id`

    string

    Id for marketing events

  * `reported_as_spam_num`

    long

    Reported as spam num

  * `order_visitor_amount`

    long

    Number of users ordered

  * `purchase_num`

    long

    Number of purchases

  * `get_unit_cost`

    long

    Get unit cost

  * `order_amount`

    long

    Sales

  * `click_num`

    long

    Click count

  * `custom_activity_engagement_list`

    array<object>

    Custom activity engagement, max size =5

    * `name`

      string

      Name, maximum 20 characters

    * `tool_tips`

      string

      Tool tips, maximum 30 characters

    * `type`

      integer

      Value type, 1-amount; 2-percent; 3-numerical

    * `value`

      string

      Value

  * `custom_sale_data_list`

    array<object>

    custom sale data,  max size =5

    * `value`

      string

      Value

    * `name`

      string

      Name, maximum 20 characters

    * `tool_tips`

      string

      Tool tips, maximum 30 characters

    * `type`

      integer

      Value type, 1-amount; 2-percent; 3-numerical

  * `has_send_num`

    long

    Number of send

  * `occurred_on`

    long

    Time to happen , standard 13- digit stamp

  * `new_buyer_sum`

    long

    New guest number

  * `unsubscribed_num`

    long

    Unsubscribed num

  * `open_sum`

    long

    Number of open

  * `add_cart_sum`

    long

    Additional purchase number

  * `spend_cost`

    long

    Marketing cost

  * `order_num`

    long

    Order qty

  * `product_sale_list`

    array<object>

    Product sale ranking

    * `product_id`

      string

      Product id

    * `count`

      long

      Product sale 

  * `check_out_sum`

    long

    Checkout number

  * `regional_visit_list`

    array<object>

    Regional visit ranking, max size=5

    * `count`

      long

      Regional visit

    * `name`

      string

      Regional name, maximum 200 characters

  * `benefit_amount`

    long

    Discount amount

  * `has_delivery_num`

    long

    Number of deliveries

  * `order_product_sum`

    long

    Order Product total number

  * `bounced_num`

    long

    Bounced num

  * `visitor_amount`

    long

    Number of visitors

  * `impression_num`

    long

    Exposure number , refers to the number of displays

  * `old_buyer_sum`

    long

     Number of old buyer

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `sucess_count`

  integer

  Success total number


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "description": "Bulk sync marketing event statistics (Create marketing engagement)",
  "externalDocs": {
    "description": "Permission point used by the interface is `write_marketing_event` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "srGU5dHy",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API. Please refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "marketing_activity_datas": {
              "name": "marketing_activity_datas",
              "description": "Marketing event data, statistical data is full data",
              "type": "array",
              "items": {
                "name": "marketing_activity_datas",
                "description": "Marketing event data, statistical data is full data",
                "type": "object",
                "properties": {
                  "marketing_event_id": {
                    "name": "marketing_event_id",
                    "description": "Id for marketing events",
                    "type": "string",
                    "example": "MA_12323312324"
                  },
                  "reported_as_spam_num": {
                    "name": "reported_as_spam_num",
                    "description": "Reported as spam num",
                    "type": "long",
                    "example": 100
                  },
                  "order_visitor_amount": {
                    "name": "order_visitor_amount",
                    "description": "Number of users ordered",
                    "type": "long",
                    "example": 100
                  },
                  "purchase_num": {
                    "name": "purchase_num",
                    "description": "Number of purchases",
                    "type": "long",
                    "example": 100
                  },
                  "get_unit_cost": {
                    "name": "get_unit_cost",
                    "description": "Get unit cost",
                    "type": "long",
                    "example": 100
                  },
                  "order_amount": {
                    "name": "order_amount",
                    "description": "Sales",
                    "type": "long",
                    "example": 100
                  },
                  "click_num": {
                    "name": "click_num",
                    "description": "Click count",
                    "type": "long",
                    "example": 100
                  },
                  "custom_activity_engagement_list": {
                    "name": "custom_activity_engagement_list",
                    "description": "Custom activity engagement, max size =5",
                    "type": "array",
                    "items": {
                      "name": "custom_activity_engagement_list",
                      "description": "Custom activity engagement, max size =5",
                      "type": "object",
                      "properties": {
                        "name": {
                          "name": "name",
                          "description": "Name, maximum 20 characters",
                          "type": "string",
                          "example": "FackbookOrderConversionRate"
                        },
                        "tool_tips": {
                          "name": "tool_tips",
                          "description": "Tool tips, maximum 30 characters",
                          "type": "string",
                          "example": "Fackboo order conversion rate"
                        },
                        "type": {
                          "name": "type",
                          "description": "Value type, 1-amount; 2-percent; 3-numerical",
                          "type": "integer",
                          "example": 2
                        },
                        "value": {
                          "name": "value",
                          "description": "Value",
                          "type": "string",
                          "example": "0.09"
                        }
                      },
                      "example": {
                        "tool_tips": "Fackboo order conversion rate",
                        "type": 2,
                        "value": "0.09",
                        "name": "FackbookOrderConversionRate"
                      }
                    },
                    "example": [
                      {
                        "name": "FackbookOrderConversionRate",
                        "tool_tips": "Fackboo order conversion rate",
                        "type": 2,
                        "value": "0.09"
                      }
                    ]
                  },
                  "custom_sale_data_list": {
                    "name": "custom_sale_data_list",
                    "description": "custom sale data,  max size =5",
                    "type": "array",
                    "items": {
                      "name": "custom_sale_data_list",
                      "description": "custom sale data,  max size =5",
                      "type": "object",
                      "properties": {
                        "value": {
                          "name": "value",
                          "description": "Value",
                          "type": "string",
                          "example": "100"
                        },
                        "name": {
                          "name": "name",
                          "description": "Name, maximum 20 characters",
                          "type": "string",
                          "example": "FackbookOrderCount"
                        },
                        "tool_tips": {
                          "name": "tool_tips",
                          "description": "Tool tips, maximum 30 characters",
                          "type": "string",
                          "example": "Order from Fackbook count"
                        },
                        "type": {
                          "name": "type",
                          "description": "Value type, 1-amount; 2-percent; 3-numerical",
                          "type": "integer",
                          "example": 3
                        }
                      },
                      "example": {
                        "name": "FackbookOrderCount",
                        "tool_tips": "Order from Fackbook count",
                        "type": 3,
                        "value": "100"
                      }
                    },
                    "example": [
                      {
                        "name": "FackbookOrderCount",
                        "tool_tips": "Order from Fackbook count",
                        "type": 3,
                        "value": "100"
                      }
                    ]
                  },
                  "has_send_num": {
                    "name": "has_send_num",
                    "description": "Number of send",
                    "type": "long",
                    "example": 100
                  },
                  "occurred_on": {
                    "name": "occurred_on",
                    "description": "Time to happen , standard 13- digit stamp",
                    "type": "long",
                    "example": 1672246800000
                  },
                  "new_buyer_sum": {
                    "name": "new_buyer_sum",
                    "description": "New guest number",
                    "type": "long",
                    "example": 100
                  },
                  "unsubscribed_num": {
                    "name": "unsubscribed_num",
                    "description": "Unsubscribed num",
                    "type": "long",
                    "example": 100
                  },
                  "open_sum": {
                    "name": "open_sum",
                    "description": "Number of open",
                    "type": "long",
                    "example": 100
                  },
                  "add_cart_sum": {
                    "name": "add_cart_sum",
                    "description": "Additional purchase number",
                    "type": "long",
                    "example": 100
                  },
                  "spend_cost": {
                    "name": "spend_cost",
                    "description": "Marketing cost",
                    "type": "long",
                    "example": 100
                  },
                  "order_num": {
                    "name": "order_num",
                    "description": "Order qty",
                    "type": "long",
                    "example": 100
                  },
                  "product_sale_list": {
                    "name": "product_sale_list",
                    "description": "Product sale ranking",
                    "type": "array",
                    "items": {
                      "name": "product_sale_list",
                      "description": "Product sale ranking",
                      "type": "object",
                      "properties": {
                        "product_id": {
                          "name": "product_id",
                          "description": "Product id",
                          "type": "string",
                          "example": "16062938070772167548642145"
                        },
                        "count": {
                          "name": "count",
                          "description": "Product sale ",
                          "type": "long",
                          "example": 100
                        }
                      },
                      "example": {
                        "product_id": "16062938070772167548642145",
                        "count": 100
                      }
                    },
                    "example": [
                      {
                        "product_id": "16062938070772167548642145",
                        "count": 100
                      }
                    ]
                  },
                  "check_out_sum": {
                    "name": "check_out_sum",
                    "description": "Checkout number",
                    "type": "long",
                    "example": 100
                  },
                  "regional_visit_list": {
                    "name": "regional_visit_list",
                    "description": "Regional visit ranking, max size=5",
                    "type": "array",
                    "items": {
                      "name": "regional_visit_list",
                      "description": "Regional visit ranking, max size=5",
                      "type": "object",
                      "properties": {
                        "count": {
                          "name": "count",
                          "description": "Regional visit",
                          "type": "long",
                          "example": 100
                        },
                        "name": {
                          "name": "name",
                          "description": "Regional name, maximum 200 characters",
                          "type": "string",
                          "example": "ua"
                        }
                      },
                      "example": {
                        "count": 100,
                        "name": "ua"
                      }
                    },
                    "example": [
                      {
                        "count": 100,
                        "name": "ua"
                      }
                    ]
                  },
                  "benefit_amount": {
                    "name": "benefit_amount",
                    "description": "Discount amount",
                    "type": "long",
                    "example": 100
                  },
                  "has_delivery_num": {
                    "name": "has_delivery_num",
                    "description": "Number of deliveries",
                    "type": "long",
                    "example": 100
                  },
                  "order_product_sum": {
                    "name": "order_product_sum",
                    "description": "Order Product total number",
                    "type": "long",
                    "example": 100
                  },
                  "bounced_num": {
                    "name": "bounced_num",
                    "description": "Bounced num",
                    "type": "long",
                    "example": 100
                  },
                  "visitor_amount": {
                    "name": "visitor_amount",
                    "description": "Number of visitors",
                    "type": "long",
                    "example": 100
                  },
                  "impression_num": {
                    "name": "impression_num",
                    "description": "Exposure number , refers to the number of displays",
                    "type": "long",
                    "example": 100
                  },
                  "old_buyer_sum": {
                    "name": "old_buyer_sum",
                    "description": " Number of old buyer",
                    "type": "long",
                    "example": 1001672246800000
                  }
                },
                "example": {
                  "purchase_num": 100,
                  "has_delivery_num": 100,
                  "product_sale_list": [
                    {
                      "count": 100,
                      "product_id": "16062938070772167548642145"
                    }
                  ],
                  "new_buyer_sum": 100,
                  "occurred_on": 1672246800000,
                  "bounced_num": 100,
                  "custom_sale_data_list": [
                    {
                      "value": "100",
                      "name": "FackbookOrderCount",
                      "tool_tips": "Order from Fackbook count",
                      "type": 3
                    }
                  ],
                  "reported_as_spam_num": 100,
                  "visitor_amount": 100,
                  "marketing_event_id": "MA_12323312324",
                  "add_cart_sum": 100,
                  "order_product_sum": 100,
                  "regional_visit_list": [
                    {
                      "count": 100,
                      "name": "ua"
                    }
                  ],
                  "click_num": 100,
                  "order_amount": 100,
                  "spend_cost": 100,
                  "get_unit_cost": 100,
                  "old_buyer_sum": 1001672246800000,
                  "order_visitor_amount": 100,
                  "has_send_num": 100,
                  "unsubscribed_num": 100,
                  "custom_activity_engagement_list": [
                    {
                      "tool_tips": "Fackboo order conversion rate",
                      "type": 2,
                      "value": "0.09",
                      "name": "FackbookOrderConversionRate"
                    }
                  ],
                  "benefit_amount": 100,
                  "impression_num": 100,
                  "open_sum": 100,
                  "order_num": 100,
                  "check_out_sum": 100
                }
              },
              "example": [
                {
                  "open_sum": 100,
                  "old_buyer_sum": 1001672246800000,
                  "bounced_num": 100,
                  "benefit_amount": 100,
                  "order_product_sum": 100,
                  "order_amount": 100,
                  "add_cart_sum": 100,
                  "visitor_amount": 100,
                  "check_out_sum": 100,
                  "marketing_event_id": "MA_12323312324",
                  "new_buyer_sum": 100,
                  "order_visitor_amount": 100,
                  "reported_as_spam_num": 100,
                  "custom_activity_engagement_list": [
                    {
                      "name": "FackbookOrderConversionRate",
                      "tool_tips": "Fackboo order conversion rate",
                      "type": 2,
                      "value": "0.09"
                    }
                  ],
                  "impression_num": 100,
                  "regional_visit_list": [
                    {
                      "count": 100,
                      "name": "ua"
                    }
                  ],
                  "unsubscribed_num": 100,
                  "has_delivery_num": 100,
                  "order_num": 100,
                  "purchase_num": 100,
                  "spend_cost": 100,
                  "has_send_num": 100,
                  "get_unit_cost": 100,
                  "occurred_on": 1672246800000,
                  "custom_sale_data_list": [
                    {
                      "type": 3,
                      "value": "100",
                      "name": "FackbookOrderCount",
                      "tool_tips": "Order from Fackbook count"
                    }
                  ],
                  "product_sale_list": [
                    {
                      "product_id": "16062938070772167548642145",
                      "count": 100
                    }
                  ],
                  "click_num": 100
                }
              ]
            }
          },
          "example": {
            "marketing_activity_datas": [
              {
                "order_visitor_amount": 100,
                "marketing_event_id": "MA_12323312324",
                "purchase_num": 100,
                "order_amount": 100,
                "get_unit_cost": 100,
                "bounced_num": 100,
                "reported_as_spam_num": 100,
                "custom_sale_data_list": [
                  {
                    "tool_tips": "Order from Fackbook count",
                    "type": 3,
                    "value": "100",
                    "name": "FackbookOrderCount"
                  }
                ],
                "order_num": 100,
                "product_sale_list": [
                  {
                    "count": 100,
                    "product_id": "16062938070772167548642145"
                  }
                ],
                "new_buyer_sum": 100,
                "spend_cost": 100,
                "regional_visit_list": [
                  {
                    "count": 100,
                    "name": "ua"
                  }
                ],
                "visitor_amount": 100,
                "click_num": 100,
                "has_delivery_num": 100,
                "has_send_num": 100,
                "unsubscribed_num": 100,
                "open_sum": 100,
                "order_product_sum": 100,
                "impression_num": 100,
                "occurred_on": 1672246800000,
                "add_cart_sum": 100,
                "benefit_amount": 100,
                "custom_activity_engagement_list": [
                  {
                    "value": "0.09",
                    "name": "FackbookOrderConversionRate",
                    "tool_tips": "Fackboo order conversion rate",
                    "type": 2
                  }
                ],
                "old_buyer_sum": 1001672246800000,
                "check_out_sum": 100
              }
            ]
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "sucess_count": {
                "name": "sucess_count",
                "description": "Success total number",
                "type": "integer",
                "example": 1
              }
            },
            "example": {
              "sucess_count": 1
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/sales/marketing_events/sync_data.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Mass sync marketing event statistics",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_marketing_event"
  ]
}
```