Skip to main content

Overview

When a buyer subscribes to your offer on Azure Marketplace, Azure creates a SaaS subscription for them. Registering that subscription tells Flexprice which subscription’s usage belongs to which buyer on Azure. Registration links three Flexprice entities to their Azure counterparts: Flexprice does not call the Azure SaaS fulfillment APIs itself. You resolve the subscription’s identifiers yourself and pass them to Flexprice. Register the subscription once per buyer, at the point they subscribe. After that, usage reporting runs on its own.

Prerequisites

Before registering an agreement, ensure you have:
  1. A published Azure Marketplace connection - See How to Set Up Azure Marketplace
  2. The buyer’s Azure SaaS subscription, resolved and activated - Through your own backend, using Azure’s SaaS fulfillment APIs. Flexprice is not involved in this step.
  3. Your dimension ID - The single metered dimension you created on your plan
  4. A Flexprice customer, plan, and active subscription - For the buyer, see Step 2

Step 1: Get the Values Flexprice Needs

Registering an agreement needs four values, from the subscription you resolved and your own offer setup.
offerId is not part of Azure’s usage report payload, so Flexprice does not store it. The plan is identified by planId alone.
Persist these values on your own side. Flexprice does not look them up again after registration.

Step 2: 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 Azure plan

The plan whose usage-based charge corresponds to the Azure plan 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 3: Register the Agreement

Using Flexprice Dashboard

You can link a buyer’s Azure subscription to a Flexprice subscription directly from the Flexprice dashboard.

API Request

Endpoint: POST /api/v1/marketplace/agreements Headers:
Request Body:
azure.plan_id is Azure’s own plan identifier, sent in the usage report. The top-level plan_id is the Flexprice plan. These are two different values and both are required.

Response

A successful response means the mapping is recorded. Nothing else happens synchronously: usage reporting begins on its own schedule, described in Usage Reporting.

Validation Rules

Registration rejects the request if any of these do not hold:
Each Azure subscription maps to exactly one Flexprice subscription, and a subscription cannot be re-pointed to a different Azure subscription. If a buyer re-subscribes and Azure issues a new resource ID, create a new Flexprice subscription for them rather than reusing the old one.

Registering Multiple Buyers on One Plan

The plan mapping stores your plan-level Azure 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 means azure.plan_id and dimension 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 Azure plan against the same Flexprice plan, with the same azure.plan_id and dimension.
If your offer has several plans, map each Azure plan to its own Flexprice plan. A buyer who changes plan on Azure moves to the Flexprice plan mapped to their new planId.

Next Steps

Connection Setup

Set up your Azure offer, Entra app credentials, and Flexprice connection.

Usage Reporting

Understand what gets metered to Azure and when.
API References