共用方式為


管理您的商店

注意事項

Store 資源僅供封閉式 Beta 參與者使用。 如需參與封閉式 Beta 或 open-beta 計劃的相關信息,請連絡您的帳戶管理員。

在 Beta 期間,所有 Store 程式設計元素和檔都可能會變更。

若要建立存放區,請使用 POST存放區範本。 POST 的主體是 StoreCreate 物件。 您必須指定 storeNamestoreDestinationUrlnotificationEmail 欄位。 其他欄位是選擇性的。 您必須先前已 驗證並宣告網站的 URL

以下顯示只指定必要欄位的範例要求。

curl -X POST -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>" -H "Content-Type: application/json" --data "{\"storeName\": \"Contoso Sports\",\"storeUrl\": \"https://contoso.com\",\"notificationEmail\": [\"someone@example.com\"]}"  https://content.api.ads.microsoft.com/v9.1/bmc/stores

如果要求成功,回應的本文會包含 Store 物件。 物件包含您在要求中指定的欄位,以及提供預設值的所有選擇性欄位。 欄 merchantId 位包含新存放區的標識碼, storeStatus 而欄位會指出是否已核准存放區。

{
  "merchantId": 123456,
  "storeName": "Contoso Sports",
  "storeUrl": "https://contoso.com/",
  "notificationEmail": [
    "someone@example.com"
  ],
  "notificationLanguage": "en-US",
  "isSslCheckout": true,
  "isBlockAggregator": false,
  "storeStatus": {
    "status": "Approved"
  }
}

如果狀態為 [不核准], StoreStatus 物件會包含 message 字段,指出為什麼未核准存放區。 在下列範例中,因為 為 false,所以不允許isSslCheckout存放區。

  "storeStatus": {
    "status": "Disapproved",
    "message": "UnSecuredCheckOut"
  }

如果 POST 要求驗證失敗,響應主體會是 ErrorResponse 物件。 如需可能的錯誤碼清單,請參閱 錯誤碼

{
  "errors": [
    {
      "code": "DuplicateStoreNameErr",
      "message": "Another store with the specified store name exists; store names must be unique with Microsoft Merchant Center."
    },
    {
      "code": "NotificationLanguageNotSupportedErr",
      "message": "The market that you specified in the notificationLanguage field is not valid."
    }
  ]
}

取得商店清單

若要取得使用者可存取的存放區清單,請使用 GET 商店範本。 如果您是機構,請包含 CustomerIdCustomerAccountId標頭

curl -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>"  https://content.api.ads.microsoft.com/v9.1/bmc/stores

回應是 StoreCollection 物件。 欄 stores 位包含 Store 物件的陣列。

{
  "stores": [
    {
      "merchantId": 12345,
      "storeName": "Alpine Ski House",
      "storeUrl": "https://alpineskihouse.com/",
      "notificationEmail": [
        "someone@alpineskihouse.com"],
      "notificationLanguage": "de-De",
      "isSslCheckout": true,
      "isBlockAggregator": false,
      "storeStatus": {
        "status": "Approved"
      }
    },

    . . .

    {
      "merchantId": 67890,
      "storeName": "Fabrikam",
      "storeUrl": "https://fabrikam.com/",
      "notificationEmail": [
        "someone@fabrikam.com"],
      "notificationLanguage": "en-us",
      "isSslCheckout": true,
      "isBlockAggregator": false,
      "storeStatus": {
        "status": "Approved"
      }
    }
  ]
}

取得特定存放區

若要取得使用者可存取的特定存放區,請使用 GET 存放區範本。 如果您是機構,請包含 CustomerIdCustomerAccountId標頭

curl -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>"  https://content.api.ads.microsoft.com/v9.1/bmc/stores/12345

回應是 Store 物件。

{
  "merchantId": 12345,
  "storeName": "Alpine Ski House",
  "storeUrl": "http://www.alpineskihouse.com",
  "notificationEmail": [
    "someone@alpineskihouse.com"],
  "notificationLanguage": "de-DE",
  "isSslCheckout": true,
  "isBlockAggregator": false,
  "storeStatus": {
    "status": "Approved"
  }
}