

# ListOpportunities
<a name="API_ListOpportunities"></a>

This request accepts a list of filters that retrieve opportunity subsets as well as sort options. This feature is available to partners from [Partner Central](https://partnercentral.awspartner.com/) using the `ListOpportunities` API action.

To synchronize your system with AWS, list only the opportunities that were newly created or updated. We recommend you rely on events emitted by the service into your AWS account’s Amazon EventBridge default event bus. You can also use the `ListOpportunities` action.

We recommend the following approach:

1. Find the latest `LastModifiedDate` that you stored, and only use the values that came from AWS. Don’t use values generated by your system.

1. When you send a `ListOpportunities` request, submit the date in ISO 8601 format in the `AfterLastModifiedDate` filter.

1.  AWS only returns opportunities created or updated on or after that date and time. Use `NextToken` to iterate over all pages.

## Request Syntax
<a name="API_ListOpportunities_RequestSyntax"></a>

```
{
   "Catalog": "string",
   "CreatedDate": { 
      "AfterCreatedDate": "string",
      "BeforeCreatedDate": "string"
   },
   "CustomerCompanyName": [ "string" ],
   "Identifier": [ "string" ],
   "LastModifiedDate": { 
      "AfterLastModifiedDate": "string",
      "BeforeLastModifiedDate": "string"
   },
   "LifeCycleReviewStatus": [ "string" ],
   "LifeCycleStage": [ "string" ],
   "MaxResults": number,
   "NextToken": "string",
   "Sort": { 
      "SortBy": "string",
      "SortOrder": "string"
   },
   "TargetCloseDate": { 
      "AfterTargetCloseDate": "string",
      "BeforeTargetCloseDate": "string"
   }
}
```

## Request Parameters
<a name="API_ListOpportunities_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Catalog](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-Catalog"></a>
Specifies the catalog associated with the request. This field takes a string value from a predefined list: `AWS` or `Sandbox`. The catalog determines which environment the opportunities are listed in. Use `AWS` for listing real opportunities in the AWS catalog, and `Sandbox` for testing in secure, isolated environments.  
Type: String  
Pattern: `[a-zA-Z]+`   
Required: Yes

 ** [CreatedDate](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-CreatedDate"></a>
Filter opportunities by creation date criteria.  
Type: [CreatedDateFilter](API_CreatedDateFilter.md) object  
Required: No

 ** [CustomerCompanyName](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-CustomerCompanyName"></a>
Filters the opportunities based on the customer's company name. This allows partners to search for opportunities associated with a specific customer by matching the provided company name string.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 10 items.  
Required: No

 ** [Identifier](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-Identifier"></a>
Filters the opportunities based on the opportunity identifier. This allows partners to retrieve specific opportunities by providing their unique identifiers, ensuring precise results.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 20 items.  
Pattern: `O[0-9]{1,19}`   
Required: No

 ** [LastModifiedDate](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-LastModifiedDate"></a>
Filters the opportunities based on their last modified date. This filter helps retrieve opportunities that were updated after the specified date, allowing partners to track recent changes or updates.  
Type: [LastModifiedDate](API_LastModifiedDate.md) object  
Required: No

 ** [LifeCycleReviewStatus](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-LifeCycleReviewStatus"></a>
Filters the opportunities based on their current lifecycle approval status. Use this filter to retrieve opportunities with statuses such as `Pending Submission`, `In Review`, `Action Required`, or `Approved`.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 10 items.  
Valid Values: `Pending Submission | Submitted | In review | Approved | Rejected | Action Required`   
Required: No

 ** [LifeCycleStage](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-LifeCycleStage"></a>
Filters the opportunities based on their lifecycle stage. This filter allows partners to retrieve opportunities at various stages in the sales cycle, such as `Qualified`, `Technical Validation`, `Business Validation`, or `Closed Won`.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 10 items.  
Valid Values: `Prospect | Qualified | Technical Validation | Business Validation | Committed | Launched | Closed Lost`   
Required: No

 ** [MaxResults](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-MaxResults"></a>
Specifies the maximum number of results to return in a single call. This limits the number of opportunities returned in the response to avoid providing too many results at once.  
Default: 20  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 100.  
Required: No

 ** [NextToken](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-NextToken"></a>
A pagination token used to retrieve the next set of results in subsequent calls. This token is included in the response only if there are additional result pages available.  
Type: String  
Required: No

 ** [Sort](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-Sort"></a>
An object that specifies how the response is sorted. The default `Sort.SortBy` value is `LastModifiedDate`.  
Type: [OpportunitySort](API_OpportunitySort.md) object  
Required: No

 ** [TargetCloseDate](#API_ListOpportunities_RequestSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-request-TargetCloseDate"></a>
Filters opportunities based on their target close date. This filter helps retrieve opportunities with an expected close date before or after a specified date.  
Type: [TargetCloseDateFilter](API_TargetCloseDateFilter.md) object  
Required: No

## Response Syntax
<a name="API_ListOpportunities_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "OpportunitySummaries": [ 
      { 
         "Arn": "string",
         "Catalog": "string",
         "CreatedDate": "string",
         "Customer": { 
            "Account": { 
               "Address": { 
                  "City": "string",
                  "CountryCode": "string",
                  "PostalCode": "string",
                  "StateOrRegion": "string"
               },
               "CompanyName": "string",
               "Industry": "string",
               "OtherIndustry": "string",
               "WebsiteUrl": "string"
            }
         },
         "Id": "string",
         "LastModifiedDate": "string",
         "LifeCycle": { 
            "ClosedLostReason": "string",
            "NextSteps": "string",
            "ReviewComments": "string",
            "ReviewStatus": "string",
            "ReviewStatusReason": "string",
            "Stage": "string",
            "TargetCloseDate": "string"
         },
         "OpportunityType": "string",
         "PartnerOpportunityIdentifier": "string",
         "Project": { 
            "DeliveryModels": [ "string" ],
            "ExpectedCustomerSpend": [ 
               { 
                  "Amount": "string",
                  "CurrencyCode": "string",
                  "EstimationUrl": "string",
                  "Frequency": "string",
                  "TargetCompany": "string"
               }
            ]
         }
      }
   ]
}
```

## Response Elements
<a name="API_ListOpportunities_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [OpportunitySummaries](#API_ListOpportunities_ResponseSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-response-OpportunitySummaries"></a>
An array that contains minimal details for opportunities that match the request criteria. This summary view provides a quick overview of relevant opportunities.  
Type: Array of [OpportunitySummary](API_OpportunitySummary.md) objects

 ** [NextToken](#API_ListOpportunities_ResponseSyntax) **   <a name="AWSPartnerCentral-ListOpportunities-response-NextToken"></a>
A pagination token used to retrieve the next set of results in subsequent calls. This token is included in the response only if there are additional result pages available.  
Type: String

## Errors
<a name="API_ListOpportunities_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
This error occurs when you don't have permission to perform the requested action.  
You don’t have access to this action or resource. Review IAM policies or contact your AWS administrator for assistance.    
 ** Reason **   
The reason why access was denied for the requested operation.
HTTP Status Code: 400

 ** InternalServerException **   
This error occurs when the specified resource can’t be found or doesn't exist. Resource ID and type might be incorrect.  
Suggested action: This is usually a transient error. Retry after the provided retry delay or a short interval. If the problem persists, contact AWS support.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
This error occurs when the specified resource can't be found. The resource might not exist, or isn't visible with the current credentials.  
Suggested action: Verify that the resource ID is correct and the resource is in the expected AWS region. Check IAM permissions for accessing the resource.  
HTTP Status Code: 400

 ** ThrottlingException **   
This error occurs when there are too many requests sent. Review the provided quotas and adapt your usage to avoid throttling.  
This error occurs when there are too many requests sent. Review the provided [Quotas](https://docs.aws.amazon.com/partner-central/latest/selling-api/quotas.html) and retry after the provided delay.  
HTTP Status Code: 400

 ** ValidationException **   
The input fails to satisfy the constraints specified by the service or business validation rules.  
Suggested action: Review the error message, including the failed fields and reasons, to correct the request payload.    
 ** ErrorList **   
A list of issues that were discovered in the submitted request or the resource state.  
 ** Reason **   
The primary reason for this validation exception to occur.  
+  *REQUEST\$1VALIDATION\$1FAILED:* The request format is not valid.

  Fix: Verify your request payload includes all required fields, uses correct data types and string formats.
+  *BUSINESS\$1VALIDATION\$1FAILED:* The requested change doesn't pass the business validation rules.

  Fix: Check that your change aligns with the business rules defined by AWS Partner Central.
HTTP Status Code: 400

## See Also
<a name="API_ListOpportunities_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/partnercentral-selling-2022-07-26/ListOpportunities) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/partnercentral-selling-2022-07-26/ListOpportunities) 