# Signup URL Redirect

Buyers Signup URL on Marketplaces goes to Suger first, then redirect to your service Signup URL.

---

## Overview

When the buyers purchased your product in one marketplace (`AWS, Azure or GCP`), they would get a link to set up or register the account on your service website. The link will be directed to the Suger endpoint, after decoding and processing, it will be redirected to your service signup URL.

## How it works

1. You provide `Suger` with your product signup URL, for example, `https://your-service-signup-url`.
2. When a buyer purchased your service in the marketplace, they get a link sent to Suger endpoint `https://api.suger.cloud/public/signup/{partner}/orgId/{orgId}?partnerId={partnerId}`, where the `partner` can be `aws`, `azure` or `gcp`, the `orgId` is your Suger `Organization` ID and the `partnerId` is your Suger `Integration` partner ID.
3. Suger will take care of several interactions (including decode token, register entitlement & buyer info, etc.) and will resolve to a `Suger Entitlement` ID.
4. Suger redirects the buyer to your signup URL with several query parameters `https://your-service-signup-url?sugerEntitlementId=entitlement-id&partner={partner}&offerType={offerType}`, as defined below:

   | Query Parameter Name | Definition                                                                                                                                                                                                                                                                                                                                                                                                               |
   | -------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | `sugerEntitlementId` | The ID of this Entitlement in the Suger                                                                                                                                                                                                                                                                                                                                                                                  |
   | `partner`            | The cloud partner where this Entitlement comes from, such as `aws`, `azure` or `gcp` (all lowercase)                                                                                                                                                                                                                                                                                                                     |
   | `offerType`          | The type of the Offer on which this Entitlement is based , such as `DEFAULT` for the default/public offer in the cloud marketplace. The possible values include `UNKNOWN`, `AMI`, `CONTAINER`, `CONTRACT`, `CPPO_OUT`, `CPPO_IN`, `CPPO`, `CUD`, `DEFAULT`, `FIXED_FEE`, `FIXED_FEE_WITH_OVERAGE`, `FLAT_RATE`, `FREE_TRIAL`, `PAYG`, `PAYG_WITH_CUD`, `PER_USER`, `PRIVATE`, `PROFESSIONAL_SERVICES` and `SUBSCRIPTION` |

5. Your service need to collect the `sugerEntitlementId`, and save it with the buyer's account. The ID can be used to fetch detailed `Entitlement` & `Buyer` info from the [Suger API doc](https://doc.suger.io/api/suger-api), and meter usage records as well.

:::warning[AWS Marketplace only]

- For AWS Marketplace, there can be a delay of **up to 5 minutes** to send the marketplace event to notify Suger the new purchase. So when buyers set up the account immediately right after the purchase, Suger know the product & buyer info, but may not know which offer is purchased.
- To bring better experiences, Suger creates new Entitlement with the default offer, and redirect the signup URL with the Entitlement ID. Once the marketplace event is received, the entitlement will be updated with the right Offer info. Your webhook will receive the Entitlement Update event.
- Your service is responsible to fetch the latest Entitlement info. The entitlement ID & Status are not changed in this scenario.
- This delay does **not** apply to Azure or GCP — Suger resolves the subscription synchronously while the buyer is on the landing page, so the Entitlement already reflects the purchased offer by the time your service receives the `sugerEntitlementId`.
  :::


## Azure Marketplace specifics

Azure's redirect flow differs from AWS in a few important ways, and a few configuration mistakes can break it.

### How the redirect works on Azure

1. The buyer purchases your SaaS offer on Azure Marketplace.
2. The buyer clicks **Configure your account** in the Azure portal.
3. Azure redirects the buyer's browser to the **Landing Page URL** that Suger registered in Partner Center → Offer → Technical Configuration:
   ```
   https://api.suger.cloud/public/signup/azure/orgId/{orgId}?token=<one-time JWT>
   ```
   The `?token=...` is appended by Azure and is **single-use**.
4. Suger reads the token, calls Microsoft's `POST /api/saas/subscriptions/resolve` (passing the token in the `x-ms-marketplace-token` header), activates the subscription, and creates the Entitlement.
5. Suger then 303-redirects the buyer to your **Product Fulfillment URL** with `?sugerEntitlementId=<id>&partner=azure&offerType=<type>` appended — the same shape used for the other partners.

### What you should NOT touch

- **Do not edit the Landing Page URL in Azure Partner Center.** Suger writes this automatically when publishing your offer. Overwriting it breaks the entire signup chain.
- **Do not bookmark, share, or reopen the Suger landing URL.** The Azure token is single-use; once Suger has consumed it (or it has been stripped from the URL), reopening the page will fail with the error below.

### Common error: `400 HeaderNotPresent x-ms-marketplace-token`

If you see this returned from `POST .../api/saas/subscriptions/resolve`, it means the Suger landing page was opened **without** a valid `?token=` query parameter. Typical causes:

- The link was opened from somewhere other than the Azure portal's **Configure your account** button.
- The page was refreshed or revisited after the initial redirect — by then Suger had already consumed the token and 303'd the buyer onward.
- An email or chat preview stripped the query string when previewing the link.

**Fix:** the buyer should go back to the [Azure portal **SaaS** page](https://portal.azure.com/#browse/Microsoft.SaaS%2Fresources), find the subscription, and click **Configure your account** again. Azure will mint a fresh token and the flow will succeed.


## FAQ

- #### Could you clarify whether you guys build the sign-up form or we do?
    Our platform handles the creation of the client sign-up form for Marketplace. You can provide some basic details, such as the Company Name and Logo, and we'll create the registration form automatically.

- #### How do I update my new user signup page?
    You can update it by navigating to Suger > Settings > New Client Sign Up.

- #### When exactly do the clients see the sign-up page in the purchase process?
    After they complete the purchase, they are immediately redirected to the sign-up page.

- #### What is the meaning of the CC emails field? Emails that will be CC'd on the email to the client?
    Yes

- #### Is the email sent after they leave their details on this page?
    Yes, after the customer completes the form, we send them a confirmation.

- #### Does 'Public Notes' appear on the page?
    That's correct, you can add any additional note you want on the page.

- #### What is the integration of our solution going to look like? What are the requirements?
    What needs to be done is to connect your product registration page to [Suger's Webhook](https://doc.suger.io/get-started/webhook).
    Once you have connected it, you can update the FullFilment URL of your AWS Product to your SaaS Registration page through Suger: Signup URL Redirect | Suger

- #### For Azure, what should I set as my Product's Fulfillment URL?
    Set it to the signup destination you want buyers to land on **after** Suger finishes resolving the Azure token:

    - Your own SaaS signup page, e.g. `https://app.your-product.com/signup` — your app reads `?sugerEntitlementId=...&partner=azure&offerType=...` and registers the buyer. **Recommended.**
    - The Suger-hosted new-client form, e.g. `https://api.suger.cloud/public/signup/newclient/{signupId}`, if you don't have your own signup page. Configure the form at **Suger → Settings → New Client Sign Up**.

    The Fulfillment URL is **not** the same as the Azure Partner Center "Landing Page URL" — Suger manages the Landing Page URL automatically; you only configure the Fulfillment URL.
