createOpportunity method

Future<CreateOpportunityResponse> createOpportunity({
  1. required String catalog,
  2. String? clientToken,
  3. Customer? customer,
  4. LifeCycle? lifeCycle,
  5. Marketing? marketing,
  6. NationalSecurity? nationalSecurity,
  7. List<Contact>? opportunityTeam,
  8. OpportunityType? opportunityType,
  9. OpportunityOrigin? origin,
  10. String? partnerOpportunityIdentifier,
  11. List<PrimaryNeedFromAws>? primaryNeedsFromAws,
  12. Project? project,
  13. SoftwareRevenue? softwareRevenue,
  14. List<Tag>? tags,
})

Creates an Opportunity record in Partner Central. Use this operation to create a potential business opportunity for submission to Amazon Web Services. Creating an opportunity sets Lifecycle.ReviewStatus to Pending Submission.

To submit an opportunity, follow these steps:

  1. To create the opportunity, use CreateOpportunity.
  2. To associate a solution with the opportunity, use AssociateOpportunity.
  3. To start the engagement with AWS, use StartEngagementFromOpportunity.
After submission, you can't edit the opportunity until the review is complete. But opportunities in the Pending Submission state must have complete details. You can update the opportunity while it's in the Pending Submission state.

There's a set of mandatory fields to create opportunities, but consider providing optional fields to enrich the opportunity record.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter catalog : 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 opportunity is created in. Use AWS to create opportunities in the Amazon Web Services catalog, and Sandbox for testing in secure, isolated environments.

Parameter clientToken : Required to be unique, and should be unchanging, it can be randomly generated or a meaningful string.

Default: None

Best practice: To help ensure uniqueness and avoid conflicts, use a Universally Unique Identifier (UUID) as the ClientToken. You can use standard libraries from most programming languages to generate this. If you use the same client token, the API returns the following error: "Conflicting client token submitted for a new request body."

Parameter customer : Specifies customer details associated with the Opportunity.

Parameter lifeCycle : An object that contains lifecycle details for the Opportunity.

Parameter marketing : This object contains marketing details and is optional for an opportunity.

Parameter nationalSecurity : Indicates whether the Opportunity pertains to a national security project. This field must be set to true only when the customer's industry is Government. Additional privacy and security measures apply during the review and management process for opportunities marked as NationalSecurity.

Parameter opportunityTeam : Represents the internal team handling the opportunity. Specify collaborating members of this opportunity who are within the partner's organization.

Parameter opportunityType : Specifies the opportunity type as a renewal, new, or expansion.

Opportunity types:

  • New opportunity: Represents a new business opportunity with a potential customer that's not previously engaged with your solutions or services.
  • Renewal opportunity: Represents an opportunity to renew an existing contract or subscription with a current customer, ensuring continuity of service.
  • Expansion opportunity: Represents an opportunity to expand the scope of an existing contract or subscription, either by adding new services or increasing the volume of existing services for a current customer.

Parameter origin : Specifies the origin of the opportunity, indicating if it was sourced from Amazon Web Services or the partner. For all opportunities created with Catalog: AWS, this field must only be Partner Referral. However, when using Catalog: Sandbox, you can set this field to AWS Referral to simulate Amazon Web Services referral creation. This allows Amazon Web Services-originated flows testing in the sandbox catalog.

Parameter partnerOpportunityIdentifier : Specifies the opportunity's unique identifier in the partner's CRM system. This value is essential to track and reconcile because it's included in the outbound payload to the partner.

This field allows partners to link an opportunity to their CRM, which helps to ensure seamless integration and accurate synchronization between the Partner Central API and the partner's internal systems.

Parameter primaryNeedsFromAws : Identifies the type of support the partner needs from Amazon Web Services.

Valid values:

  • Cosell—Architectural Validation: Confirmation from Amazon Web Services that the partner's proposed solution architecture is aligned with Amazon Web Services best practices and poses minimal architectural risks.
  • Cosell—Business Presentation: Request Amazon Web Services seller's participation in a joint customer presentation.
  • Cosell—Competitive Information: Access to Amazon Web Services competitive resources and support for the partner's proposed solution.
  • Cosell—Pricing Assistance: Connect with an Amazon Web Services seller for support situations where a partner may be receiving an upfront discount on a service (for example: EDP deals).
  • Cosell—Technical Consultation: Connect with an Amazon Web Services Solutions Architect to address the partner's questions about the proposed solution.
  • Cosell—Total Cost of Ownership Evaluation: Assistance with quoting different cost savings of proposed solutions on Amazon Web Services versus on-premises or a traditional hosting environment.
  • Cosell—Deal Support: Request Amazon Web Services seller's support to progress the opportunity (for example: joint customer call, strategic positioning).
  • Cosell—Support for Public Tender/RFx: Opportunity related to the public sector where the partner needs Amazon Web Services RFx support.

Parameter project : An object that contains project details for the Opportunity.

Parameter softwareRevenue : Specifies details of a customer's procurement terms. This is required only for partners in eligible programs.

Parameter tags : A map of the key-value pairs of the tag or tags to assign.

Implementation

Future<CreateOpportunityResponse> createOpportunity({
  required String catalog,
  String? clientToken,
  Customer? customer,
  LifeCycle? lifeCycle,
  Marketing? marketing,
  NationalSecurity? nationalSecurity,
  List<Contact>? opportunityTeam,
  OpportunityType? opportunityType,
  OpportunityOrigin? origin,
  String? partnerOpportunityIdentifier,
  List<PrimaryNeedFromAws>? primaryNeedsFromAws,
  Project? project,
  SoftwareRevenue? softwareRevenue,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSPartnerCentralSelling.CreateOpportunity'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (customer != null) 'Customer': customer,
      if (lifeCycle != null) 'LifeCycle': lifeCycle,
      if (marketing != null) 'Marketing': marketing,
      if (nationalSecurity != null)
        'NationalSecurity': nationalSecurity.value,
      if (opportunityTeam != null) 'OpportunityTeam': opportunityTeam,
      if (opportunityType != null) 'OpportunityType': opportunityType.value,
      if (origin != null) 'Origin': origin.value,
      if (partnerOpportunityIdentifier != null)
        'PartnerOpportunityIdentifier': partnerOpportunityIdentifier,
      if (primaryNeedsFromAws != null)
        'PrimaryNeedsFromAws':
            primaryNeedsFromAws.map((e) => e.value).toList(),
      if (project != null) 'Project': project,
      if (softwareRevenue != null) 'SoftwareRevenue': softwareRevenue,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateOpportunityResponse.fromJson(jsonResponse.body);
}