Tổng quan về Merchant promotion API (API chương trình khuyến mãi của người bán)

Sử dụng chương trình khuyến mãi để giới thiệu các ưu đãi đặc biệt cho các sản phẩm bạn bán trên Google. Quảng cáo hiển thị trên các sản phẩm khác nhau của Google, bao gồm Google Tìm kiếm, Google Mua sắm và Chrome.

Khi bạn thêm Chương trình khuyến mãi vào sản phẩm của mình, người mua sắm sẽ thấy một đường liên kết ưu đãi đặc biệt, với ví dụ: "giảm giá 15%" hoặc "Vận chuyển miễn phí". Đường liên kết đến sản phẩm có thể tăng sức hút cho sản phẩm của bạn và khuyến khích người mua sắm mua hàng.

Để biết thêm thông tin, hãy xem bài viết Khuyến mãi kiến thức cơ bản.

Điều kiện tiên quyết

Google cần bạn cung cấp thông tin cụ thể về doanh nghiệp và trước khi đăng chương trình khuyến mãi. Bạn phải có:

Ngoài ra, bạn phải đăng ký cho tài khoản người bán của mình tham gia chương trình Khuyến mãi. Nếu bạn không chắc chắn liệu mình đã đăng ký hay chưa, hãy xem xét thẻ Người bán .

Nếu bạn chưa đăng ký, hãy hoàn tất yêu cầu biểu mẫu. Chiến lược phát hành đĩa đơn sẽ cho bạn biết thời điểm bạn có thể bắt đầu triển khai.

Để biết thêm thông tin, hãy xem Tiêu chí tham gia và chính sách của Google.

Tạo một nguồn dữ liệu

Sử dụng API datasource.create để tạo nguồn cấp dữ liệu khuyến mãi. Nếu một đơn vị quảng cáo hiện có Bạn đã có thể sử dụng nguồn cấp dữ liệu khuyến mãi, hãy sử dụng datasource.get để tìm nạp datasource.name

Biểu mẫu của yêu cầu này như sau:

POST https://merchantapi.googleapis.com/promotions/v1beta/accounts/{account}/dataSources/{datasource}

Ví dụ:

Ví dụ này cho thấy một yêu cầu và phản hồi thông thường.

Yêu cầu:

POST https://merchantapi.googleapis.com/datasources/v1beta/accounts/123/dataSources {"displayName": "test api feed", "promotionDataSource":{"targetCountry":"US", "contentLanguage":"en"}}

Phản hồi:

{
  "name": "accounts/123/dataSources/1000000573361824",
  "dataSourceId": "1000000573361824",
  "displayName": "test api feed",
  "promotionDataSource": {
    "targetCountry": "US",
    "contentLanguage": "en"
  },
  "input": "API"
}

Tạo quảng cáo

Bạn có thể sử dụng accounts.promotions.insert để tạo hoặc cập nhật chương trình khuyến mãi. Phương thức accounts.promotions.insert lấy tài nguyên promotions và tên nguồn dữ liệu làm đầu vào. Phương thức này trả về chương trình khuyến mãi mới hoặc được cập nhật nếu thành công.

Để tạo chương trình khuyến mãi, bạn cần datasource.name.

Google xem xét và phê duyệt chương trình khuyến mãi của bạn trước khi phân phối. Để biết thêm thông tin, xem Phê duyệt chương trình khuyến mãi .

Biểu mẫu của yêu cầu:

POST https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*/}promotions:insert

Nghiên cứu các chương trình khuyến mãi mẫu sau để tham khảo.

Mẫu 1: Một câu hỏi tại địa phương khuyến mãi áp dụng cho tất cả sản phẩm và tất cả cửa hàng

POST https://merchantapi.googleapis.com/promotions/v1beta/accounts/123/promotions:insert

{
  "promotion": {
    "promotionId": "buy_2_get_10_off",
    "contentLanguage": "en",
    "targetCountry": "US",
    "redemptionChannel": [
      "IN_STORE"
    ],
    "attributes": {
      "longTitle": "Buy 2 and get 10$ OFF purchase",
      "productApplicability": "ALL_PRODUCTS",
      "offerType": "NO_CODE",
      "couponValueType": "BUY_M_GET_MONEY_OFF",
      "promotionDisplayTimePeriod": {
        "startTime": "2024-2-06T00:47:44Z",
        "endTime": "2024-5-06T00:47:44Z"
      },
      "promotionEffectiveTimePeriod": {
        "startTime": "2024-2-06T00:47:44Z",
        "endTime": "2024-5-06T00:47:44Z"
      },
      "moneyOffAmount": {
        "amountMicros": "1000000",
        "currencyCode": "USD"
      },
      "minimum_purchase_quantity": 2,
      "storeApplicability": "ALL_STORES",
      "promotionUrl": "http://promotionnew4url.com/",
      "promotionDestinations": [
        "LOCAL_INVENTORY_ADS"
      ],
    }
  },
  "dataSource": "accounts/123/dataSources/1000000573361824"
}

Mẫu 2: Chương trình khuyến mãi trực tuyến áp dụng cho những sản phẩm đã chọn có sử dụng mã khuyến mãi mã

POST https://merchantapi.googleapis.com/promotions/v1beta/accounts/123/promotions:insert

{
 "promotion": {
   "promotionId": "25_pct_off",
   "contentLanguage": "en",
   "targetCountry": "US",
   "redemptionChannel": [
     "ONLINE"
   ],
   "attributes": {
     "longTitle": "10% off on selected items",
     "productApplicability": "SPECIFIC_PRODUCTS",
     "offerType": "GENERIC_CODE",
     "genericRedemptionCode": "SPRINGSALE",
     "couponValueType": "PERCENT_OFF",
     "promotionDisplayTimePeriod": {
       "startTime": "2024-2-06T00:47:44Z",
       "endTime": "2024-5-06T00:47:44Z"
     },
     "promotionEffectiveTimePeriod": {
       "startTime": "2024-2-06T00:47:44Z",
       "endTime": "2024-5-06T00:47:44Z"
     },
     "percentOff": 25,
     "promotionDestinations": [
       "FREE_LISTINGS"
     ],
     "itemIdInclusion": [
       "1499860100",
       "1499860101",
       "1499860102",
       "1499860103",
       "1499860104"
     ],
   }
 },
 "dataSource": "accounts/123/dataSources/1000000573361824"
}

Ghi chú đặc biệt

Sau khi tạo chiến dịch quảng bá, có thể mất vài phút để tạo chiến dịch quảng bá.

Để biết danh sách các thuộc tính liên quan đến chương trình khuyến mãi, hãy xem bài viết Thêm dữ liệu có cấu trúc .

Trước khi tạo và quản lý chương trình khuyến mãi, hãy xem bài viết Chương trình khuyến mãi tốt nhất Các phương pháp.

Xem quảng cáo

Để xem chương trình khuyến mãi, hãy sử dụng accounts.promotions.get. Hàm get này ở chế độ chỉ đọc. Phương thức này yêu cầu bạn sử dụng merchantId và mã nhận dạng của quảng cáo. Phương thức get trả về tài nguyên chương trình khuyến mãi tương ứng.

Ví dụ:

GET https://merchantapi.googleapis.com/promotions/v1beta/{name=accounts/*/promotions/*}

Hãy nghiên cứu những mẫu này.

Mẫu 1: Chương trình khuyến mãi tại địa phương

GET https://merchantapi.googleapis.com/promotions/v1beta/accounts/123/promotions/in_store~en~US~buy_2_get_10_off

{
 "name": "accounts/123/promotions/in_store~en~US~buy_2_get_10_off",
 "promotionId": "buy_2_get_10_off",
 "contentLanguage": "en",
 "targetCountry": "US",
 "redemptionChannel": [
   "IN_STORE"
 ],
 "attributes": {
   "longTitle": "Buy 2 and get 10$ OFF purchase",
   "productApplicability": "ALL_PRODUCTS",
   "offerType": "NO_CODE",
   "couponValueType": "BUY_M_GET_MONEY_OFF",
   "promotionDisplayTimePeriod": {
     "startTime": "2024-2-06T00:47:44Z",
     "endTime": "2024-5-06T00:47:44Z"
   },
   "promotionEffectiveTimePeriod": {
     "startTime": "2024-2-06T00:47:44Z",
     "endTime": "2024-5-06T00:47:44Z"
   },
   "moneyOffAmount": {
     "amountMicros": "1000000",
     "currencyCode": "USD"
   },
   "minimum_purchase_quantity": 2,
   "storeApplicability": "ALL_STORES",
   "promotionUrl": "http://promotionnew4url.com/",
   "promotionDestinations": [
     "LOCAL_INVENTORY_ADS"
   ],
 }
 "dataSource": "accounts/123/dataSources/1000000573361824"
}

Mẫu 2. Quảng cáo trực tuyến

GET https://merchantapi.googleapis.com/promotions/v1beta/accounts/123/promotions/online~en~US~25_pct_off
{
 "name": "accounts/123/promotions/online~en~US~25_pct_off",
 "promotionId": "25_pct_off",
 "contentLanguage": "en",
 "targetCountry": "US",
 "redemptionChannel": [
   "ONLINE"
 ],
 "attributes": {
   "longTitle": "10% off on selected items",
   "productApplicability": "SPECIFIC_PRODUCTS",
   "offerType": "GENERIC_CODE",
   "genericRedemptionCode": "WINTERGIFT",
   "couponValueType": "PERCENT_OFF",
   "promotionDisplayTimePeriod": {
     "startTime": "2024-2-06T00:47:44Z",
     "endTime": "2024-5-06T00:47:44Z"
   },
   "promotionEffectiveTimePeriod": {
     "startTime": "2024-2-06T00:47:44Z",
     "endTime": "2024-5-06T00:47:44Z"
   },
   "percentOff": 25,
   "promotionDestinations": [
     "FREE_LISTINGS"
   ],
   "itemIdInclusion": [
     "1499860100",
     "1499860101",
     "1499860102",
     "1499860103",
     "1499860104"
   ],
 }
 "dataSource": "accounts/{account}/dataSources/{dataSource}"
}

Liệt kê chương trình khuyến mãi

Bạn có thể sử dụng promotions.list để xem tất cả các chương trình khuyến mãi đã tạo.

GET https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*}/promotions

Trạng thái khuyến mãi

Để xem trạng thái của một chương trình khuyến mãi, bạn có thể xem thuộc tính promotionStatus được trả về bởi promotions.getpromotions.list.

Để tìm hiểu quy trình phê duyệt, hãy xem bài viết Phê duyệt chương trình khuyến mãi .

Trạng thái chương trình khuyến mãi mẫu

Các mẫu sau đây minh hoạ sự khác biệt giữa thành công và không thành công yêu cầu.

Mẫu 1. Nội dung phản hồi sau đây cho thấy một chương trình khuyến mãi trực tuyến bị từ chối do thiếu liên kết sản phẩm.

  "promotionStatus": {
    "destinationStatuses": [
      {
        "reportingContext": "FREE_LISTINGS",
        "status": "REJECTED"
      }
    ],
    "itemLevelIssues": [
      {
        "code": "promotion_sku_unmapped",
        "severity": "DISAPPROVED",
        "resolution": "merchant_action",
        "reportingContext": "FREE_LISTINGS",
        "description": "Unmapped",
        "detail": "This promotion couldn't be tested during review because it doesn't apply to any products that are currently in your Products feed",
        "documentation": "https://support.google.com/merchants/answer/2906014",
        "applicableCountries": [
          "US"
        ]
      },
      {
        "code": "promotion_sku_additional_requirements",
        "severity": "DISAPPROVED",
        "resolution": "merchant_action",
        "reportingContext": "FREE_LISTINGS",
        "description": "Promotion conditions not allowed",
        "detail": "This promotion has additional requirements that are not allowed such as requiring customers to verify additional details like phone number or ID before showing the promotion details",
        "documentation": "https://support.google.com/merchants/answer/2906014",
        "applicableCountries": [
          "US"
        ]
      }
    ]
  }

Mẫu 2. Nội dung phản hồi sau đây cho thấy một chương trình khuyến mãi đã được phê duyệt.

  "promotionStatus": {
    "destinationStatuses": [
      {
        "reportingContext": "FREE_LISTINGS",
        "status": "PENDING"
      },
      {
        "destination": "SHOPPING_ADS",
        "status": "PENDING"
      }
    ],
    "itemLevelIssues": []
  }

Mẫu 3. Quảng cáo đang hoạt động và đã được phê duyệt

  "promotionStatus": {
    "destinationStatuses": [
      {
        "reportingContext": "FREE_LISTINGS",
        "status": "LIVE"
      },
      {
        "destination": "SHOPPING_ADS",
        "status": "LIVE"
 }  ],
    "itemLevelIssues": []
  }

Tìm hiểu thêm

Để biết thêm thông tin, hãy xem trang Trợ giúp khuyến mãi .

Để tìm hiểu về cách di chuyển từ Content API cho Mua sắm, hãy xem phần Di chuyển chương trình khuyến mãi quản lý chiến dịch.