次の方法で共有


ストアの管理

注:

ストア リソースは、クローズド ベータ参加者のみが使用できます。 クローズド ベータプログラムまたはオープンベータ プログラムへの参加については、アカウント マネージャーにお問い合わせください。

すべてのストア プログラミング要素とドキュメントは、ベータ期間中に変更される可能性があります。

ストアを作成するには、 POST ストア テンプレートを使用します。 POST の本文は StoreCreate オブジェクトです。 storeNamestoreDestinationUrlnotificationEmailの各フィールドを指定する必要があります。 その他のフィールドは省略可能です。 Web サイトの 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 フィールドには新しいストアの ID が含まれており、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 フィールドが含まれます。これは、ストアが承認されなかった理由を示します。 次の例では、 isSslCheckoutfalse であるため、ストアは不承認になりました。

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