共用方式為


附加採購單並完成採購單詳細數據

適當的角色:全域管理員 |管理員 代理程式

合作夥伴可能需要提供客戶採購單和/或招標或提案要求 (RFP) 資訊,才能在合作夥伴中心內完成交易。 本文說明合作夥伴如何使用合作夥伴中心以程序設計方式附加採購單。

必要條件

  • 認證,如合作夥伴中心驗證所述。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。

要求語法

方法 要求 URI
POST {baseURL}/v1/customers/{customerid}/orders/{orderid}/attachment

URI 主體參數

使用下列本文參數可傳回採購單狀態。

名稱 類型​​ 必要 描述
isPartofTender 布林值 這是客戶招標或提案要求 (RFP) 的訂單部分。
customerPrice 十進位/字串 Y
currency String Y
fxRate 十進位/字串
tenderLink String Y/N 如果isPartOfTender為 true 且未提供招標檔,則這是必要項目,否則不需要。
POfiles Files Y
TenderFiles Files Y/N 如果isPartOfTender為 true 且未提供招標連結,則這是必要項目,否則不需要。

要求標頭

如需詳細資訊,請參閱合作夥伴中心 REST 標頭

要求範例

POST https://api.partnercenter.microsoft.com/v1/customers/<customerid>/orders/<orderid>/attachment
Authorization: Bearer <Token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryaLQBO4IgpABK3wdj
Accept: application/json

------WebKitFormBoundaryaLQBO4IgpABK3wdj
Content-Disposition: form-data; name="metadata"
{"isPartofTender":true,"customerPrice":"156.87","currency":"CAD","fxRate":"1.2","tenderLink":https://onedrive.com/ishdruiwiojfdhajhgdfgjhgj}
------WebKitFormBoundaryaLQBO4IgpABK3wdj
Content-Disposition: form-data; name="pofiles"; filename="PO_Part1.pdf"
Content-Type: application/pdf

REST 回應

如果交易需要在合作夥伴完成建立訂單或結帳後上傳採購單,則會收到下列回應。

回應成功和錯誤碼

每個回應都有一個 HTTP 狀態代碼,指出成功或失敗,以及更多偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型等等參數。 如需完整清單,請參閱錯誤碼

回應範例

HTTP/1.1 201 Created
Content-Length: 393

{"totalCount":3,"items":[{"attachmentId":"ed64c99f750115","fileName":"PO_Part1.pdf","sizeInKB":2051,"attachmentType":"POAttachment"},{"attachmentId":"ef8fe74c39e264","fileName":"PO_Part2.pdf","sizeInKB":1313,"attachmentType":"POAttachment"},{"attachmentId":"32a312ca64567a","fileName":"Tender.pdf","sizeInKB":2223,"attachmentType":"TenderAttachment"}],"attributes":{"objectType":"Collection"}}