Overview
When a buyer subscribes to your product on AWS Marketplace, AWS creates an agreement for them and redirects them to your application. Registering that agreement tells Flexprice which subscription’s usage belongs to which buyer on AWS. Registration links three Flexprice entities to their AWS counterparts:
Register the agreement once per buyer, at the point they subscribe. After that, usage reporting runs on its own.
Prerequisites
Before registering an agreement, ensure you have:- A published AWS Marketplace connection - See How to Set Up AWS Marketplace
- Your dimension API identifier - The single usage dimension you created on your AWS product
- A Flexprice customer, plan, and active subscription - For the buyer, see Step 3
Step 1: Handle the AWS Redirect
When a buyer subscribes, AWS redirects their browser to the registration URL configured on your product. This is an HTTPPOST to your URL carrying a single form field:
For details on configuring your registration URL, see Determine how buyers will access your product in the AWS documentation.
Step 2: Call ResolveCustomer
Call the AWS Marketplace Metering ServiceResolveCustomer API from your backend, passing the token from Step 1.
Request to AWS:
This is a call your own backend makes directly to AWS, using credentials from the AWS account that published the product. Flexprice is not involved in this exchange.
Step 3: Make Sure the Buyer Exists in Flexprice
Three things must already exist in Flexprice before you can register the agreement. Flexprice does not create any of them for you.1
A Flexprice customer for this buyer
Create one with
POST /v1/customers if it does not already exist. Usage and billing are attributed to this customer.2
The Flexprice plan for this product
The plan whose usage-based charge corresponds to the AWS product the buyer subscribed to. See Creating a Plan.
3
An active Flexprice subscription
Create it with
POST /v1/subscriptions on that plan if it does not already exist. The subscription must be active: registration rejects a subscription in any other state.Step 4: Register the Agreement
Using Flexprice Dashboard
You can link a buyer’s AWS agreement to a Flexprice subscription directly from the Flexprice dashboard.API Request
Endpoint:POST /api/v1/marketplace/agreements
Headers:
Set
concurrent_agreements to true for products enrolled in AWS Concurrent Agreements. For these products, AWS identifies the product by the LicenseArn and does not accept a ProductCode. Set it to false for legacy products.Response
Validation Rules
Registration rejects the request if any of these do not hold:Registering Multiple Buyers on One Plan
The plan mapping stores your product-level AWS configuration, so it is created once and reused. Registering a second buyer on the same plan reuses the existing plan mapping rather than creating another one. This meansproduct_code, dimension, and concurrent_agreements are set by the first agreement registered against a plan. Later registrations for that plan do not change them.
Register every buyer for the same AWS product against the same Flexprice plan, with the same
product_code and dimension.Next Steps
Usage Reporting
Understand what gets metered to AWS and when.
Connection Setup
Set up your AWS listing, IAM role, and Flexprice connection.

