> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/cost-management-agent-apis/commitment-orchestrator/sp-inventory-apis.md).

# SP Inventory APIs

## List Savings Plans

> Retrieves a paginated list of Savings Plans with optional filtering

```json
{"openapi":"3.0.1","info":{"title":"Commitment Orchestrator APIs","version":"1.0.0"},"tags":[],"servers":[{"url":"https://app.harness.io/gateway","description":"Production server"}],"paths":{"/accounts/{account_id}/v2/inventory/sp/list":{"post":{"tags":["SP Inventory APIs"],"summary":"List Savings Plans","description":"Retrieves a paginated list of Savings Plans with optional filtering","operationId":"ListSavingsPlans","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string"},"description":"Account Identifier for the Entity"},{"name":"routingId","in":"query","required":true,"schema":{"type":"string"},"description":"Routing identifier for request processing"},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Start date for filtering Savings Plans"},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"End date for filtering Savings Plans"}],"requestBody":{"description":"Pagination and filtering options","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSavingsPlansRequest"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSavingsPlansResponse"}}}},"400":{"description":"Invalid request parameters"}}}}},"components":{"schemas":{"ListSavingsPlansRequest":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/PaginationInput"},"filters":{"$ref":"#/components/schemas/InventorySPAPIFilter"},"sort_by":{"type":"string","description":"Field to sort results by"},"sort_order":{"type":"string","enum":["asc","desc"],"description":"Sort order direction"}}},"PaginationInput":{"type":"object","properties":{"limit":{"type":"integer","maximum":100},"page":{"type":"integer","maximum":100}}},"InventorySPAPIFilter":{"type":"object","properties":{"account_ids":{"type":"array","items":{"type":"string"},"description":"List of provider account IDs"},"cloud_account_ids":{"type":"array","items":{"type":"string"},"description":"List of cloud account IDs"},"instance_families":{"type":"array","items":{"type":"string"},"description":"List of instance families"},"payment_options":{"type":"array","items":{"type":"string","enum":["No Upfront","Partial Upfront","All Upfront"]},"description":"List of payment options"},"terms":{"type":"array","items":{"type":"number","format":"float64"},"description":"List of term lengths in years"},"plan_types":{"type":"array","items":{"type":"string","enum":["ComputeSavingsPlans","EC2InstanceSavingsPlans","SageMakerSavingsPlans","AzureComputeSavingsPlans"]},"description":"List of Savings Plan types. AzureComputeSavingsPlans applies to the VirtualMachines service."},"status":{"type":"array","items":{"type":"string","enum":["active","expired","pending","retired"]},"description":"List of statuses"},"is_harness_managed":{"type":"boolean","nullable":true,"description":"Filter by Harness managed status"},"service":{"type":"string","enum":["Amazon Relational Database Service","Amazon Elastic Compute Cloud - Compute","VirtualMachines"],"description":"Service to filter by. VirtualMachines returns Azure savings plans, whose plan type is AzureComputeSavingsPlans."},"regions":{"type":"array","items":{"type":"string"},"description":"List of regions"}}},"ListSavingsPlansResponse":{"type":"object","properties":{"ts":{"type":"integer","description":"Response timestamp"},"success":{"type":"boolean","description":"Indicates if the request was successful"},"errors":{"type":"string","nullable":true,"description":"Error details, if any"},"response":{"$ref":"#/components/schemas/SavingsPlansDataResponse"}}},"SavingsPlansDataResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of Savings Plans"},"pages":{"type":"integer","format":"int64","description":"Total number of pages"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SavingsPlan"}},"pagination":{"$ref":"#/components/schemas/PaginationInput"}}},"SavingsPlan":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the Savings Plan"},"type":{"type":"string","description":"Type of Savings Plan"},"instance_family":{"type":"string","description":"Instance family if applicable"},"region":{"type":"string","description":"Region for the Savings Plan"},"commitment":{"type":"number","format":"double","description":"Hourly commitment amount"},"start_date":{"type":"string","format":"date-time","description":"Start date of the Savings Plan"},"expires_on":{"type":"string","format":"date-time","description":"Expiration date of the Savings Plan"},"term":{"type":"string","description":"Term length of the Savings Plan"},"avg_utilization":{"type":"number","format":"float","description":"Average utilization percentage"},"status":{"type":"string","description":"Current status of the Savings Plan"},"is_harness_managed":{"type":"boolean","description":"Indicates if the Savings Plan is managed by Harness"},"payment_option":{"type":"string","description":"Payment option for the Savings Plan"},"plan_type":{"type":"string","description":"Type of the Savings Plan"},"upfront_fee":{"type":"number","format":"double","description":"Upfront fee amount if applicable"}}}}}}
```

## Get Savings Plan Details

> Retrieves detailed information about a specific Savings Plan

```json
{"openapi":"3.0.1","info":{"title":"Commitment Orchestrator APIs","version":"1.0.0"},"tags":[],"servers":[{"url":"https://app.harness.io/gateway","description":"Production server"}],"paths":{"/accounts/{account_id}/v2/inventory/sp/{spId}/detail":{"get":{"tags":["SP Inventory APIs"],"summary":"Get Savings Plan Details","description":"Retrieves detailed information about a specific Savings Plan","operationId":"GetSavingsPlanDetails","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string"},"description":"Account Identifier for the Entity"},{"name":"spId","in":"path","required":true,"schema":{"type":"string"},"description":"Unique identifier of the Savings Plan"},{"name":"routingId","in":"query","required":true,"schema":{"type":"string"},"description":"Routing identifier for request processing"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsPlanDetailsResponse"}}}},"400":{"description":"Invalid request parameters"},"404":{"description":"Savings Plan not found"}}}}},"components":{"schemas":{"SavingsPlanDetailsResponse":{"type":"object","properties":{"ts":{"type":"integer","description":"Response timestamp"},"success":{"type":"boolean","description":"Indicates if the request was successful"},"errors":{"type":"string","nullable":true,"description":"Error details, if any"},"response":{"$ref":"#/components/schemas/SavingsPlanDetail"}}},"SavingsPlanDetail":{"type":"object","properties":{"account_info":{"$ref":"#/components/schemas/AccountInfo","description":"Associated account information"},"instance_family":{"type":"string","description":"Instance family if applicable"},"region":{"type":"string","description":"Region for the Savings Plan"},"platform":{"type":"string","description":"Operating system platform"},"type":{"type":"string","description":"Type of Savings Plan"},"mtd_utilization":{"type":"number","format":"double","description":"Month-to-date utilization percentage"},"status":{"type":"string","description":"Current status of the Savings Plan"},"start_date":{"type":"string","format":"date-time","description":"Start date of the Savings Plan"},"expiry_date":{"type":"string","format":"date-time","description":"End date of the Savings Plan"},"purchase_term_years":{"type":"string","description":"Term length of the Savings Plan"},"payment_option":{"type":"string","description":"Payment option selected"},"commitment":{"type":"number","format":"double","description":"Hourly commitment amount"},"mtd_commitment":{"type":"number","format":"double","description":"Month-to-date commitment amount"},"upfront_fee":{"type":"number","format":"double","description":"Upfront payment amount"},"hourly_cost":{"type":"number","format":"double","description":"Hourly cost amount"},"mtd_net_savings":{"type":"number","format":"double","description":"Month-to-date net savings amount"},"approval_info":{"$ref":"#/components/schemas/SPApprovalInfo","description":"Approval information if applicable"},"is_harness_managed":{"type":"boolean","description":"Indicates if the Savings Plan is managed by Harness"}}},"AccountInfo":{"type":"object","properties":{"account_id":{"type":"string","description":"Account identifier"},"account_name":{"type":"string","description":"Name of the account"},"id":{"type":"string","description":"Unique identifier (ARN) of the Savings Plan"}}},"SPApprovalInfo":{"type":"object","properties":{"approved_by":{"type":"string","description":"User who approved the Savings Plan"},"approved_at":{"type":"string","description":"Timestamp of approval"},"status":{"type":"string","description":"Current approval status"}}}}}}
```

## Get Savings Plans Filter Options

> Retrieves available filter options for Savings Plans including account IDs, instance families, payment options, etc.

```json
{"openapi":"3.0.1","info":{"title":"Commitment Orchestrator APIs","version":"1.0.0"},"tags":[],"servers":[{"url":"https://app.harness.io/gateway","description":"Production server"}],"paths":{"/accounts/{account_id}/v2/filters/sp":{"get":{"tags":["SP Inventory APIs"],"summary":"Get Savings Plans Filter Options","description":"Retrieves available filter options for Savings Plans including account IDs, instance families, payment options, etc.","operationId":"GetSPFilterOptions","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string"},"description":"Account Identifier for the Entity"},{"name":"routingId","in":"query","required":true,"schema":{"type":"string"},"description":"Routing identifier for request processing"},{"name":"service","in":"query","required":false,"schema":{"type":"string","enum":["Amazon Relational Database Service","Amazon Elastic Compute Cloud - Compute","VirtualMachines"]},"description":"Service to fetch filters for. VirtualMachines returns Azure savings plan filters, where the only plan type is AzureComputeSavingsPlans."}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"ts":{"type":"integer","description":"Response timestamp"},"success":{"type":"boolean","description":"Indicates if the request was successful"},"errors":{"type":"string","nullable":true,"description":"Error details, if any"},"response":{"$ref":"#/components/schemas/InventorySPAPIFilter"}}}}}},"400":{"description":"Invalid request parameters"}}}}},"components":{"schemas":{"InventorySPAPIFilter":{"type":"object","properties":{"account_ids":{"type":"array","items":{"type":"string"},"description":"List of provider account IDs"},"cloud_account_ids":{"type":"array","items":{"type":"string"},"description":"List of cloud account IDs"},"instance_families":{"type":"array","items":{"type":"string"},"description":"List of instance families"},"payment_options":{"type":"array","items":{"type":"string","enum":["No Upfront","Partial Upfront","All Upfront"]},"description":"List of payment options"},"terms":{"type":"array","items":{"type":"number","format":"float64"},"description":"List of term lengths in years"},"plan_types":{"type":"array","items":{"type":"string","enum":["ComputeSavingsPlans","EC2InstanceSavingsPlans","SageMakerSavingsPlans","AzureComputeSavingsPlans"]},"description":"List of Savings Plan types. AzureComputeSavingsPlans applies to the VirtualMachines service."},"status":{"type":"array","items":{"type":"string","enum":["active","expired","pending","retired"]},"description":"List of statuses"},"is_harness_managed":{"type":"boolean","nullable":true,"description":"Filter by Harness managed status"},"service":{"type":"string","enum":["Amazon Relational Database Service","Amazon Elastic Compute Cloud - Compute","VirtualMachines"],"description":"Service to filter by. VirtualMachines returns Azure savings plans, whose plan type is AzureComputeSavingsPlans."},"regions":{"type":"array","items":{"type":"string"},"description":"List of regions"}}}}}}
```
