Skip to content

resolve_customer

resolve_customer(
    registration_token: NonEmptyString,
    *,
    config_overrides: Optional[MarketplaceMeteringClientConfig] = None,
) -> ResolveCustomerResult

ResolveCustomer is called by a SaaS application during the registration process. When a buyer visits your website during the registration process, the buyer submits a registration token through their browser. The registration token is resolved through this API to obtain a CustomerIdentifier along with the CustomerAWSAccountId, ProductCode, and LicenseArn.

For new SaaS product integrations, the CustomerIdentifier field is not populated in the ResolveCustomer API response. New integrations must use CustomerAWSAccountId and LicenseArn to identify customers. Existing integrations continue to work unchanged.

To successfully resolve the token, the API must be called from the account that was used to publish the SaaS application. For an example of using ResolveCustomer, see ResolveCustomer code example in the Amazon Web Services Marketplace Seller Guide.

Permission is required for this operation. Your IAM role or user performing this operation requires a policy to allow the aws-marketplace:ResolveCustomer action. For more information, see Actions, resources, and condition keys for Amazon Web Services Marketplace Metering Service in the Service Authorization Reference.

For Amazon Web Services Regions that support ResolveCustomer, see ResolveCustomer Region support.

Parameters:

  • registration_token (NonEmptyString) –

    When a buyer visits your website during the registration process, the buyer submits a registration token through the browser. The registration token is resolved to obtain a CustomerIdentifier along with the CustomerAWSAccountId, ProductCode, and LicenseArn.

    For new SaaS product integrations, the CustomerIdentifier field is not populated. Use CustomerAWSAccountId and LicenseArn for customer identification.

Raises:

  • DisabledApiException –

    The API is disabled in the Region.

  • ExpiredTokenException –

    The submitted registration token has expired. This can happen if the buyer's browser takes too long to redirect to your page, the buyer has resubmitted the registration token, or your application has held on to the registration token for too long. Your SaaS registration website should redeem this token as soon as it is submitted by the buyer's browser.

  • InternalServiceErrorException –

    An internal error has occurred. Retry your request. If the problem persists, post a message with details on the Amazon Web Services forums.

  • InvalidTokenException –

    Registration token is invalid.

  • ThrottlingException –

    The calls to the API are throttled.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_marketplace_metering/_services/marketplace_metering.py
def resolve_customer(
    self,
    registration_token: "capo_marketplace_metering.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[MarketplaceMeteringClientConfig] = None,
) -> (
    "capo_marketplace_metering.types.resolve_customer_result.ResolveCustomerResult"
):
    """<p> <code>ResolveCustomer</code> is called by a SaaS application during the registration process. When a buyer visits your website during the registration process, the buyer submits a registration token through their browser. The registration token is resolved through this API to obtain a <code>CustomerIdentifier</code> along with the <code>CustomerAWSAccountId</code>, <code>ProductCode</code>, and <code>LicenseArn</code>.</p> <important> <p>For new SaaS product integrations, the <code>CustomerIdentifier</code> field is not populated in the <code>ResolveCustomer</code> API response. New integrations must use <code>CustomerAWSAccountId</code> and <code>LicenseArn</code> to identify customers. Existing integrations continue to work unchanged.</p> </important> <note> <p>To successfully resolve the token, the API must be called from the account that was used to publish the SaaS application. For an example of using <code>ResolveCustomer</code>, see <a href="https://docs.aws.amazon.com/marketplace/latest/userguide/saas-code-examples.html#saas-resolvecustomer-example"> ResolveCustomer code example</a> in the <i>Amazon Web Services Marketplace Seller Guide</i>.</p> </note> <p>Permission is required for this operation. Your IAM role or user performing this operation requires a policy to allow the <code>aws-marketplace:ResolveCustomer</code> action. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsmarketplacemeteringservice.html">Actions, resources, and condition keys for Amazon Web Services Marketplace Metering Service</a> in the <i>Service Authorization Reference</i>.</p> <p>For Amazon Web Services Regions that support <code>ResolveCustomer</code>, see <a href="https://docs.aws.amazon.com/marketplace/latest/APIReference/metering-regions.html#resolvecustomer-region-support">ResolveCustomer Region support</a>. </p>

    Args:
        registration_token: <p>When a buyer visits your website during the registration process, the buyer submits a registration token through the browser. The registration token is resolved to obtain a <code>CustomerIdentifier</code> along with the <code>CustomerAWSAccountId</code>, <code>ProductCode</code>, and <code>LicenseArn</code>.</p> <note> <p>For new SaaS product integrations, the <code>CustomerIdentifier</code> field is not populated. Use <code>CustomerAWSAccountId</code> and <code>LicenseArn</code> for customer identification.</p> </note>

    Raises:
        capo_marketplace_metering.errors.disabled_api_exception.DisabledApiException: <p>The API is disabled in the Region.</p>
        capo_marketplace_metering.errors.expired_token_exception.ExpiredTokenException: <p>The submitted registration token has expired. This can happen if the buyer's browser takes too long to redirect to your page, the buyer has resubmitted the registration token, or your application has held on to the registration token for too long. Your SaaS registration website should redeem this token as soon as it is submitted by the buyer's browser.</p>
        capo_marketplace_metering.errors.internal_service_error_exception.InternalServiceErrorException: <p>An internal error has occurred. Retry your request. If the problem persists, post a message with details on the Amazon Web Services forums.</p>
        capo_marketplace_metering.errors.invalid_token_exception.InvalidTokenException: <p>Registration token is invalid.</p>
        capo_marketplace_metering.errors.throttling_exception.ThrottlingException: <p>The calls to the API are throttled.</p>
        capo_marketplace_metering.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_marketplace_metering.types.resolve_customer_request.ResolveCustomerRequest]",
    ) -> OperationResponse[
        "capo_marketplace_metering.types.resolve_customer_result.ResolveCustomerResult"
    ]:
        import capo_marketplace_metering._operations.awsmp_metering_service.resolve_customer

        output, http_response = (
            capo_marketplace_metering._operations.awsmp_metering_service.resolve_customer.resolve_customer(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ResolveCustomer")
    )
    input_: capo_marketplace_metering.types.resolve_customer_request.ResolveCustomerRequest = {
        "registration_token": registration_token
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output