刪除附加元件Delete an add-on

若要刪除應用程式已向您的合作夥伴中心帳戶的附加元件 (也稱為應用程式內產品或 IAP),在 Microsoft Store 提交 API 中使用這個方法。Use this method in the Microsoft Store submission API to delete an add-on (also known as in-app product or IAP) for an app that is registered to your Partner Center account.

先決條件Prerequisites

若要使用這個方法,您必須先進行下列動作:To use this method, you need to first do the following:

  • 如果您尚未完成,請先完成 Microsoft Store 提交 API 的所有先決條件If you have not done so already, complete all the prerequisites for the Microsoft Store submission API.
  • 取得 Azure AD 存取權杖以便用於這個方法的要求標頭。Obtain an Azure AD access token to use in the request header for this method. 在您取得存取權杖之後,您在權杖到期之前有 60 分鐘的時間可以使用權杖。After you obtain an access token, you have 60 minutes to use it before it expires. 權杖到期之後,您可以取得新的權杖。After the token expires, you can obtain a new one.

要求Request

這個方法的語法如下。This method has the following syntax. 請參閱下列各小節了解標頭和要求本文的使用範例和描述。See the following sections for usage examples and descriptions of the header and request body.

方法Method 要求 URIRequest URI
DELETEDELETE https://manage.devcenter.microsoft.com/v1.0/my/inappproducts/{inAppProductId}

要求的標頭Request header

標頭Header 類型Type 描述Description
AuthorizationAuthorization 字串string 必要。Required. 在表單中的 Azure AD 存取權杖持有人 <語彙基元>。The Azure AD access token in the form Bearer <token>.

要求參數Request parameters

名稱Name 類型Type 描述Description
idid 字串string 必要。Required. 要刪除的附加元件市集識別碼。The Store ID of the add-on to delete. 存放區識別碼適用於合作夥伴中心。The Store ID is available in Partner Center.

要求本文Request body

不提供此方法的要求本文。Do not provide a request body for this method.

要求範例Request example

下列範例示範如何刪除附加元件。The following example demonstrates how to delete an add-on.

DELETE https://manage.devcenter.microsoft.com/v1.0/my/inappproducts/9NBLGGH4TNMP HTTP/1.1
Authorization: Bearer <your access token>

回應Response

如果成功,此方法會傳回空白回應主體。If successful, this method returns an empty response body.

錯誤碼Error codes

如果要求無法順利完成,則回應會包含下列其中一個 HTTP 錯誤碼。If the request cannot be successfully completed, the response will contain one of the following HTTP error codes.

錯誤碼Error code 描述Description
400400 要求無效。The request is invalid.
404404 找不到指定的附加元件。The specified add-on could not be found.
409409 找不到指定的附加元件,但無法刪除在目前的狀態,或附加元件會使用合作夥伴中心功能都十分目前不支援 Microsoft Store 提交 APIThe specified add-on was found but it could not be deleted in its current state, or the add-on uses a Partner Center feature that is currently not supported by the Microsoft Store submission API.