Skip to content

Switching from CustomerIdentifier to customerAWSAccountID and AWS Marketplace SNS notifications response

1

As AWS is deprecating CustomerIdenfier, I have a question on how the AWS Marketplace SNS topics will work. I have used the following Github repository which I found from AWS labs on the marketplace setup guide.

https://catalog.workshops.aws/mpseller/en-US/saas/integration-with-quickstart#background

https://github.com/aws-samples/aws-marketplace-serverless-saas-integration/

The problem I have is I don't see a way of retrieving the CustomerAWSAccountID from the SNS topic, whilst the CustomerIdenfier is sent directly as customer-identifier.

The only way to retrieve the CustomerAWSAccountID is to resolve the x-amzn-marketplace-token with resolveCustomer. But this is dependent on the customer clicking on the register page and filling out the form. The current solution automatically updates the entitlements from the sns topic. Is there a way to continue updating the entitlements via the SNS topic without having the user fill out the register page? Secondly, if it will be dependent in the future on the customer completing registration on application side, how will the SNS topic interaction work? Will the SQS queue triggered meteringupdate function need to wait for the registration to complete/retry before finishing the update? The solution uses the customer-identifier, received via the SNS subscription topic, which it will store on the Dynamodb table, the getEntitlements API call can then make use of it directly to update the entitlements for the customer.

Namely, the responses the SNS topics give is: entitlement below:

{
    "action": "<action-name>",
    "customer-identifier": " X01EXAMPLEX",
    "product-code": "n0123EXAMPLEX,
}

subscription below

{
    "action": "<action-name>",
    "customer-identifier": " X01EXAMPLEX",
    "product-code": "n0123EXAMPLEX",
    "offer-identifier": "offer-abcexample123",
    "isFreeTrialTermPresent":"true"
}

Entitlement Lambda solution snippet:

exports.handler = async (event) => {
  await Promise.all(event.Records.map(async (record) => {
    const { body } = record;
    let { Message: message } = JSON.parse(body);

    if (typeof message === 'string' || message instanceof String) {
      message = JSON.parse(message);
    }

    if (message.action === 'entitlement-updated') {
      const entitlementParams = {
        ProductCode: message['product-code'],
        Filter: {
          CUSTOMER_IDENTIFIER: [message['customer-identifier']],
        },
      };
  const entitlementsResponse = await marketplaceEntitlementService.getEntitlements(entitlementParams).promise(); 

Per: https://docs.aws.amazon.com/marketplace/latest/APIReference/API_marketplace-entitlements_GetEntitlements.html The CustomerIdentifier parameter is scheduled for deprecation on March 31, 2026. Use CustomerAWSAccountID instead..

asked a year ago375 views

1 Answer
0

When AWS Marketplace deprecates the CustomerIdentifier parameter on March 31, 2026, you'll need to adapt your integration to use CustomerAWSAccountID instead. This change affects how you process SNS notifications and call the GetEntitlements API.

Currently, the SNS notifications for both entitlement and subscription topics include the customer-identifier field, which you're using directly in your GetEntitlements API call. However, these notifications don't currently include the CustomerAWSAccountID.

To address this upcoming change, you have a few options:

  1. Continue using the current approach until AWS updates the SNS notification format. It's likely that AWS will update the SNS notification payload to include the CustomerAWSAccountID before the CustomerIdentifier is fully deprecated.

  2. Maintain a mapping between CustomerIdentifier and CustomerAWSAccountID in your database. When a customer completes the registration process using ResolveCustomer, store both identifiers. Then, when processing SNS notifications, use the customer-identifier to look up the corresponding CustomerAWSAccountID in your database.

  3. Contact AWS Marketplace Seller Operations to inquire about their plans for updating the SNS notification format to include CustomerAWSAccountID.

Regarding your second question about the SNS topic interaction and registration dependency: If AWS doesn't update the SNS notification format, your system would need to wait for customer registration to establish the mapping between CustomerIdentifier and CustomerAWSAccountID. This would mean:

  • Your SQS queue triggered function would need to check if the CustomerAWSAccountID mapping exists for the received CustomerIdentifier
  • If not found, you might need to implement a retry mechanism or queue these requests separately until the customer completes registration
  • Once registration is complete and the mapping is established, you can process the queued entitlement updates

This approach would require additional logic to handle cases where entitlement updates arrive before customer registration. You might need to implement a separate queue or database table to store these pending updates until the customer registers.

The ResolveCustomer API call remains essential as it's the point where you obtain both the CustomerIdentifier and CustomerAWSAccountID together, allowing you to create the mapping needed for future GetEntitlements calls.
Sources
GetEntitlements - AWS Marketplace
ResolveCustomer - AWS Marketplace
Code examples for SaaS product integration - AWS Marketplace
Integrating your SaaS contract-based product with AWS Marketplace - AWS Marketplace

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.