建立附加元件提交Create an add-on submission

若要建立新的附加元件 (也稱為應用程式內產品或 IAP) 提交至您的合作夥伴中心帳戶已註冊的應用程式,在 Microsoft Store 提交 API 中使用這個方法。Use this method in the Microsoft Store submission API to create a new add-on (also known as in-app product or IAP) submission for an app that is registered to your Partner Center account. 使用這個方法成功建立新提交之後,請更新提交對提交的資料進行任何必要的變更,然後認可提交供擷取和發佈。After you successfully create a new submission by using this method, update the submission to make any necessary changes to the submission data, and then commit the submission for ingestion and publishing.

如需這個方法如何在使用 Microsoft Store 提交 API 建立附加元件提交的程序中進行的詳細資訊,請參閱管理附加元件提交For more information about how this method fits into the process of creating an add-on submission by using the Microsoft Store submission API, see Manage add-on submissions.

注意

這個方法會為現有的附加元件建立提交。This method creates a submission for an existing add-on. 若要建立附加元件,請使用建立附加元件方法。To create an add-on, use the Create an add-on method.

先決條件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.
  • 建立您的應用程式的其中一個的附加元件。Create an add-on for one of your apps. 您可以在合作夥伴中心,或您可以使用建立附加元件方法。You can do this in Partner Center, or you can do this by using the Create an add-on method.

要求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
POSTPOST https://manage.devcenter.microsoft.com/v1.0/my/inappproducts/{inAppProductId}/submissions

要求的標頭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
inAppProductIdinAppProductId 字串string 必要。Required. 您想要建立提交之附加元件的市集識別碼。The Store ID of the add-on for which you want to create a submission. 存放區的識別碼在合作夥伴中心,而且它包含在要求的回應資料建立附加元件或是取得附加元件詳細資料The Store ID is available in Partner Center, and it is included in the response data for requests to Create an add-on or get add-on details.

要求本文Request body

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

要求範例Request example

下列範例示範如何為附加元件建立新的提交。The following example demonstrates how to create a new submission for an add-on.

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

回應Response

下列範例示範成功呼叫此方法時的 JSON 回應主體。The following example demonstrates the JSON response body for a successful call to this method. 回應本文包含新提交的相關資訊。The response body contains information about the new submission. 如需回應本文中各個值的詳細資訊,請參閱附加元件提交資源For more details about the values in the response body, see add-on submission resource.

{
  "id": "1152921504621243680",
  "contentType": "EMagazine",
  "keywords": [
    "books"
  ],
  "lifetime": "FiveDays",
  "listings": {
    "en": {
      "description": "English add-on description",
      "icon": {
        "fileName": "add-on-en-us-listing2.png",
        "fileStatus": "Uploaded"
      },
      "title": "Add-on Title (English)"
    },
    "ru": {
      "description": "Russian add-on description",
      "icon": {
        "fileName": "add-on-ru-listing.png",
        "fileStatus": "Uploaded"
      },
      "title": "Add-on Title (Russian)"
    }
  },
  "pricing": {
    "marketSpecificPricings": {
      "RU": "Tier3",
      "US": "Tier4",
    },
    "sales": [
      {
         "name": "Sale1",
         "basePriceId": "Free",
         "startDate": "2016-05-21T18:40:11.7369008Z",
         "endDate": "2016-05-22T18:40:11.7369008Z",
         "marketSpecificPricings": {
            "RU": "NotAvailable"
         }
      }
    ],
    "priceId": "Free",
    "isAdvancedPricingModel": true
  },
  "targetPublishDate": "2016-03-15T05:10:58.047Z",
  "targetPublishMode": "Immediate",
  "tag": "SampleTag",
  "visibility": "Public",
  "status": "PendingCommit",
  "statusDetails": {
    "errors": [
      {
        "code": "None",
        "details": "string"
      }
    ],
    "warnings": [
      {
        "code": "ListingOptOutWarning",
        "details": "You have removed listing language(s): []"
      }
    ],
    "certificationReports": [
      {
      }
    ]
  },
  "fileUploadUrl": "https://productingestionbin1.blob.core.windows.net/ingestion/26920f66-b592-4439-9a9d-fb0f014902ec?sv=2014-02-14&sr=b&sig=usAN0kNFNnYE2tGQBI%2BARQWejX1Guiz7hdFtRhyK%2Bog%3D&se=2016-06-17T20:45:51Z&sp=rwl",
  "friendlyName": "Submission 2"
}

錯誤碼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 submission could not be created because the request is invalid.
409409 無法建立提交作業,因為應用程式中的目前狀態,或應用程式使用的合作夥伴中心功能目前不支援 Microsoft Store 提交 APIThe submission could not be created because of the current state of the app, or the app uses a Partner Center feature that is currently not supported by the Microsoft Store submission API.