ภาพรวมของ API โปรโมชันจากผู้ขาย

ใช้โปรโมชันเพื่อแสดงข้อเสนอพิเศษสำหรับผลิตภัณฑ์ที่ขายบน Google โปรโมชันจะแสดงในผลิตภัณฑ์และบริการต่างๆ ของ Google ซึ่งรวมถึง Google Search, Shopping และ Chrome

เมื่อคุณเพิ่มโปรโมชันในผลิตภัณฑ์ ผู้เลือกซื้อจะเห็นลิงก์ข้อเสนอพิเศษ เช่น "ลด 15%" หรือ "จัดส่งฟรี" ลิงก์ข้อเสนอสามารถเพิ่มความน่าสนใจให้ผลิตภัณฑ์และกระตุ้นให้ผู้เลือกซื้อทำการซื้อได้

ดูข้อมูลเพิ่มเติมได้ที่ข้อมูลเบื้องต้นเกี่ยวกับโปรโมชัน

สิ่งที่ต้องดำเนินการก่อน

Google จำเป็นต้องให้คุณระบุข้อมูลที่เฉพาะเจาะจงเกี่ยวกับธุรกิจและผลิตภัณฑ์ก่อนที่จะแสดงโปรโมชัน คุณต้องมีสิ่งต่อไปนี้

นอกจากนี้ คุณต้องลงทะเบียนบัญชีผู้ขายในโปรแกรมโปรโมชันด้วย หากไม่แน่ใจว่าลงทะเบียนแล้วหรือไม่ โปรดดูที่ Merchant Center

หากยังไม่ได้ลงทะเบียน โปรดกรอกแบบฟอร์มคำขอ ทีมโปรโมชันจะแจ้งให้ทราบเมื่อคุณเริ่มใช้งานได้

สำหรับข้อมูลเพิ่มเติม โปรดดูเกณฑ์และนโยบายการเข้าร่วม

สร้างแหล่งข้อมูล

ใช้ API datasource.create เพื่อสร้างฟีดโปรโมชัน หากมีฟีดโปรโมชันอยู่แล้ว ให้ใช้ datasource.get เพื่อดึงข้อมูล datasource.name

แบบฟอร์มคำขอมีดังนี้

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

ตัวอย่าง

ตัวอย่างนี้แสดงคำขอและคำตอบทั่วไป

คำขอ:

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

คำตอบ:

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

สร้างโปรโมชัน

คุณสามารถใช้เมธอด accounts.promotions.insert เพื่อสร้างหรืออัปเดตโปรโมชันได้ เมธอด accounts.promotions.insert จะใช้ทรัพยากร promotions และชื่อแหล่งข้อมูลเป็นอินพุต และจะแสดงโปรโมชันใหม่หรือโปรโมชันที่อัปเดต หากสำเร็จ

การสร้างโปรโมชันต้องใช้ datasource.name

Google จะตรวจสอบและอนุมัติโปรโมชันของคุณก่อนเผยแพร่ ดูข้อมูลเพิ่มเติมได้ที่กระบวนการอนุมัติโปรโมชัน

แบบฟอร์มคำขอ

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

ศึกษาตัวอย่างโปรโมชันต่อไปนี้เพื่อเป็นข้อมูลอ้างอิง

ตัวอย่างที่ 1: โปรโมชันในพื้นที่ที่ใช้กับผลิตภัณฑ์ทั้งหมดและร้านค้าทั้งหมด

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"
}

ตัวอย่างที่ 2: โปรโมชันออนไลน์ที่ใช้กับผลิตภัณฑ์ที่เลือกที่มีรหัสแลกรับข้อเสนอ

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"
}

หมายเหตุพิเศษ

หลังจากสร้างโปรโมชัน ระบบอาจใช้เวลา 2-3 นาทีในการสร้างโปรโมชัน

ดูรายการแอตทริบิวต์ที่เกี่ยวข้องกับโปรโมชันได้ที่เพิ่มแอตทริบิวต์ข้อมูลที่มีโครงสร้าง

ก่อนที่จะสร้างและจัดการโปรโมชัน โปรดดูแนวทางปฏิบัติแนะนำสำหรับโปรโมชัน

ดูโปรโมชัน

หากต้องการดูโปรโมชัน ให้ใช้ accounts.promotions.get การรับนี้เป็นแบบอ่านอย่างเดียว คุณต้องระบุ merchantId และรหัสของโปรโมชัน เมธอด get จะแสดงทรัพยากรโปรโมชันที่เกี่ยวข้อง

เช่น

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

ศึกษาตัวอย่างเหล่านี้

ตัวอย่างที่ 1: โปรโมชันในร้าน

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"
}

ตัวอย่าง 2 โปรโมชันออนไลน์

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}"
}

แสดงรายการโปรโมชัน

คุณใช้เมธอด promotions.list เพื่อดูโปรโมชันที่สร้างขึ้นทั้งหมดได้

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

สถานะโปรโมชัน

หากต้องการดูสถานะของโปรโมชัน ให้ดูแอตทริบิวต์ promotionStatus ที่ส่งคืนภายในวันที่ promotions.get และ promotions.list

หากต้องการทำความเข้าใจกระบวนการอนุมัติ โปรดดูกระบวนการอนุมัติโปรโมชัน

ตัวอย่างสถานะโปรโมชัน

ตัวอย่างต่อไปนี้แสดงความแตกต่างระหว่างคำขอที่สำเร็จและคำขอที่ล้มเหลว

ตัวอย่าง 1 เนื้อหาการตอบกลับต่อไปนี้แสดงโปรโมชันออนไลน์ที่จะถูกปฏิเสธเนื่องจากไม่มีการแมปผลิตภัณฑ์

  "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"
        ]
      }
    ]
  }

ตัวอย่าง 2 เนื้อหาการตอบกลับต่อไปนี้แสดงโปรโมชันที่ได้รับอนุมัติ

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

ตัวอย่าง 3 โปรโมชันที่ได้รับอนุมัติและใช้งานอยู่

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

ดูข้อมูลเพิ่มเติม

ดูรายละเอียดเพิ่มเติมได้ที่ศูนย์ช่วยเหลือของโปรโมชัน

ดูข้อมูลเกี่ยวกับการย้ายข้อมูลจาก Content API for Shopping ได้ที่ย้ายข้อมูลการจัดการโปรโมชัน