是否有任何SoftLayer API方法可以通過以下三個輸入值返回所有開票項目:SoftLayer API:如果我有訂單ID,是否有任何SoftLayer API返回billingItem?
API用戶名,API密鑰和產品訂單號?
感謝。
是否有任何SoftLayer API方法可以通過以下三個輸入值返回所有開票項目:SoftLayer API:如果我有訂單ID,是否有任何SoftLayer API返回billingItem?
API用戶名,API密鑰和產品訂單號?
感謝。
我們可以使用SoftLayer_Account::getAllBillingItems使用一些filters
和masks
。
請嘗試以下要求:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems?objectFilter={ "allBillingItems": { "activeFlag": { "operation": 1 }, "orderItem": { "order": { "id": { "operation": 4303543} } } } }&objectMask=mask[id,categoryCode,orderItem[id,order.id],item,activeFlag]
Method: GET
其中: 「」 4303543」 」是orderId
。
另外,如果你知道是什麼類別的項目,你正在尋找(即Virtual Guests
),我們可以得到下面的執行開票項目:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask[datacenter,billingItem[id,orderItem[id,order.id]]]&objectFilter={ "virtualGuests": { "billingItem": { "orderItem": { "order": { "id": { "operation": 6630685 } } } } } }
Method: GET
其中: 」6630685」
是orderId
。
參考文獻:
可以使用Billing_Order服務,並調用getItems方法+ objectMask拿到賬單項目。
例如
GET https://api.softlayer.com/rest/v3/SoftLayer_Billing_Order/$OrderNumber/getItems?objectMask=mask[description, billingItem]
注:您的訂單號替換$ ORDERNUMBER
您也可以使用此請求
GET https://api.softlayer.com/rest/v3/SoftLayer_Billing_Order/$OrderNumber/getOrderTopLevelItems?objectMask=mask[description, billingItem]
注意獲取訂單的主要結算項目:您可以使用計費項目取消您的設備(服務器,VSI等)的結果
關注
謝謝y你是納爾遜和麥克魯茲。這兩個信息都很有用。 – mnnmountain
不客氣:) – mcruz