{
  "openapi": "3.1.0",
  "info": {
    "title": "WeTransact Platform API",
    "description": "Manage your Microsoft commercial-marketplace business programmatically: read the subscriptions customers\nhave bought, report metered usage, and reconcile what Microsoft recorded and paid.\n\n## Authentication\n\nEvery request needs your API key in an `x-api-key` header. Generate one under **Settings** in your\nWeTransact portal and store it securely; it is shown once.\n\n```http\nGET /api/v1.0/subscriptions HTTP/1.1\nHost: <yoursubdomain>.wetransact.io\nx-api-key: YOUR_API_KEY\n```\n\nA missing or unknown key returns `401`. See [Getting started](./getting-started.md) for the full setup,\nand the [Metering integration guide](./metering-integration-guide.md) if you bill on usage.\n\n## What you can do\n\n| Area | Endpoints | Use it for |\n|---|---|---|\n| **Subscriptions** | `GET /subscriptions`, `GET /subscriptions/{subscriptionId}`, `activate`, `reject` | read what customers bought, with their plans and metered dimensions; drive the fulfilment lifecycle |\n| **Usage reporting** | `POST /subscriptions/{subscriptionId}/actions/charge` | report metered usage to Microsoft. This is a **billing action**: an accepted charge lands on the customer's Azure bill |\n| **Reconciliation** | `GET /usage`, `GET /financials` | what Microsoft actually metered, per dimension per day, and the revenue and payout lines behind it |\n| **Products** | `GET /products`, `GET /products/{productId}`, `GET /products/bypartnercenterofferid/{partnerCenterOfferId}` | your listings, plans and pricing |\n| **Leads and deals** | `GET /marketplaceleads`, `GET /dealregistration/findcompany` | marketplace leads and deal-registration lookups |\n\n## Conventions\n\n- **Versioning.** Every path is prefixed `/api/v1.0`.\n- **Response casing.** Response bodies use **PascalCase** property names (`MarketplaceSubscriptionId`,\n  `Success`). Error bodies returned before any record exists use lower-case `message` and `retryable`.\n- **Times.** ISO 8601, UTC. Dates that come from Microsoft's reports carry no time zone and should be read\n  as UTC dates.\n- **Identifiers.** `dimensionId` on the charge endpoint is the **Partner Center dimension id**, the same\n  value `GET /subscriptions?includeMeters=true` returns as `MeterId`.\n\n## Rate limits\n\n- **Reads:** 10 requests per 60 seconds per client. Cache where you can.\n- **Charges:** 10 in flight at once, 5 more may queue; beyond that you get `429`. Retry later with the\n  same `effectiveStartTime`.\n\n## Reporting usage safely\n\nMicrosoft accepts one usage event per subscription, dimension and hour, and so does this API. Send\n`effectiveStartTime` explicitly and reuse the same value when retrying: you get `200` if it landed now, or\n`409` if it had already landed, never a double charge. Every error body tells you whether a retry is safe.\nThe [Metering integration guide](./metering-integration-guide.md) walks through the whole flow, including a\nsandbox you can exercise without touching a real customer's bill.\n\nQuestions: [support@wetransact.io](mailto:support@wetransact.io).\n",
    "version": "1.0",
    "contact": {
      "name": "Support Team",
      "email": "support@wetransact.io"
    }
  },
  "servers": [
    {
      "url": "https://<yoursubdomain>.wetransact.io",
      "description": "WeTransact Publisher API Base URL"
    }
  ],
  "tags": [
    {
      "name": "Subscriptions",
      "description": "Subscription entity operations."
    },
    {
      "name": "Products",
      "description": "Product operations on the WeTransact Platform."
    },
    {
      "name": "Financials",
      "description": "Financial details for the publisher."
    },
    {
      "name": "DealRegistration",
      "description": "Deal registration helpers (company lookup)."
    },
    {
      "name": "MarketplaceLeads",
      "description": "Marketplace leads captured from listings and offers."
    },
    {
      "name": "Getting started guide",
      "description": "### 🚀 Introduction\n\nWelcome to the **WeTransact Platform API** — your gateway to managing subscriptions, products, financials, deal registration, and marketplace leads for offers listed on the Azure Marketplace.\n\nAs a publisher, this API lets your system interact with WeTransact in real-time. You can:\n\n- **Retrieve subscriptions** your customers have purchased and inspect their meters\n- **Activate** or **reject** new subscriptions based on your own business logic\n- **Charge** for usage when your product includes metered dimensions\n- **Retrieve products and plans** you've published\n- **Retrieve financial details** for your publisher account\n- **Look up companies** to support deal registration workflows\n- **Retrieve marketplace leads** captured from your listings and offers\n\nThink of this as the control panel behind the curtain — allowing your software to handle marketplace operations automatically, reliably, and safely.\n\n---\n\n### 🎯 What You Can Do\n\n#### 📦 Subscriptions\n\n`GET /api/v1.0/subscriptions`, `GET /api/v1.0/subscriptions/{subscriptionId}` — list and retrieve subscriptions. Pass `includeMeters=true` to hydrate the metering dimensions on each subscription.\n\n#### ✅ Activate\n\nWhen a customer purchases your product, WeTransact doesn't activate the subscription automatically. You're in control. Use `POST /api/v1.0/subscriptions/{subscriptionId}/actions/activate` to approve and activate once you're ready (e.g., after internal provisioning).\n\n#### ❌ Reject\n\nNot the right fit? Use `POST /api/v1.0/subscriptions/{subscriptionId}/actions/reject` to explicitly reject a subscription before activation — for example, if the customer doesn't meet prerequisites or passes fraud checks.\n\n#### 💰 Charge\n\nFor offers with custom dimensions (i.e., usage-based pricing), `POST /api/v1.0/subscriptions/{subscriptionId}/actions/charge?dimensionId=...&quantity=...&effectiveStartTime=...` reports usage, which leads to the customer being billed through Microsoft. `dimensionId` is the **Partner Center dimension id**; `GET /subscriptions?includeMeters=true` returns it as `MeterId` (and `PartnerCenterMeterId`) on each meter. `effectiveStartTime` is optional (ISO 8601 UTC, defaults to now) and names the usage hour being reported; it must not be in the future or older than 24 hours.\n\n> **Behind the scenes:** WeTransact relays these charges to the [Microsoft Commercial Marketplace Metering API](https://learn.microsoft.com/en-us/azure/marketplace/partner-center-portal/marketplace-metering-service-apis) — and those charges end up directly on the customer's invoice.\n\n#### 🧩 Products\n\n`GET /api/v1.0/products`, `GET /api/v1.0/products/{productId}`, `GET /api/v1.0/products/bypartnercenterofferid/{partnerCenterOfferId}` — list your products or retrieve one by WeTransact product ID or by the Partner Center offer ID. Product responses include associated plans, pricing configuration, and metadata such as screenshots, videos, and supporting files.\n\n#### 💵 Financials\n\n`GET /api/v1.0/financials` — every revenue line Microsoft reports for your account (one row per purchase line per month, refreshed nightly from Partner Center), for payout reconciliation. Join `AssetId` to your SaaS `MarketplaceSubscriptionId`; use `PurchaseRecordId` + `LineItemId` for a single purchase line. Amounts come in three currencies (CC customer, PC your payout currency, USD) and the expected payout is `estimatedRevenuePC × incentiveRate / 100`. See the endpoint reference for every column.\n\n`GET /api/v1.0/usage?subscriptionId=...&from=...&to=...` — Microsoft's usage report: daily metered usage per subscription and meter dimension (`MeterId` is the dimension id you charge with; for SaaS the subscription id is in `ReferenceId`). Rows are daily aggregates, not individual usage events, so reconcile daily totals per dimension against what you sent through the charge endpoint. Filters are optional; without them you get the full history.\n\n#### 🤝 Deal Registration\n\n`GET /api/v1.0/dealregistration/findcompany?countryCode=...&companyName=...` — look up a company by ISO country code and name to support deal registration workflows.\n\n#### 📨 Marketplace Leads\n\n`GET /api/v1.0/marketplaceleads`, `GET /api/v1.0/marketplaceleads/{marketplaceLeadId}` — retrieve leads captured from your Azure Marketplace listings and offers. Use the optional `since` query parameter (ISO-8601 UTC timestamp) to fetch only recent leads.\n\n> **Consuming WeTransact events?** The public API is pull-only. If you need event-driven integration (subscription purchased, cancelled, renewed, etc.), use the **WeTransact Zapier app** or contact support for an alternative integration path.\n\n---\n\n### ⚠️ Charging: Use with Care\n\nWhen you submit a usage charge, you're triggering a **real financial transaction** on your customer's Azure bill.\n\nBecause of this, we **strongly recommend** testing your integration thoroughly.\n\n#### 🧪 Test Like a Pro\n\nTo validate your charging logic without real financial impact:\n\n1. **Create a test product** on Azure Marketplace with a price of **$0.01 per unit**\n2. Add one or more **custom dimensions**, each priced at **$0.01**\n3. Use this offer to test your charging flows end-to-end — including retries, rollbacks, and reporting\n\n#### 🔁 Duplicate Detection & Safe Retries\n\nMicrosoft accepts **one usage event per subscription, dimension and hour** (the hour of `effectiveStartTime`). WeTransact applies the same rule before calling Microsoft, but only against reports Microsoft has **accepted** — a failed attempt never blocks its own retry.\n\nThat makes retries safe: after a timeout, a `429` or a `502`, resend the **same** `effectiveStartTime` and you get one of two answers, never a double charge:\n\n| HTTP | Meaning | Retry? |\n|------|---------|--------|\n| `200` | Microsoft accepted the usage event. `Microsoft.UsageEventId` is Microsoft's id. | No |\n| `400` | Invalid input (`quantity`, `dimensionId`, `effectiveStartTime` unparsable / future / older than 24h). | Fix first |\n| `404` | Subscription or dimension unknown. | Fix first |\n| `409` | Already reported for this hour — by an earlier accepted call, or Microsoft answered `Duplicate`. Body carries the original `UsageReportEventId` and `Microsoft.UsageEventId`. | No |\n| `422` | Microsoft rejected the event (`ResourceNotActive`, `InvalidDimension`, `Expired`, `BadArgument`, ...). See `Microsoft.Status`. | Fix first |\n| `429` | Too many concurrent charges. | Yes, same `effectiveStartTime` |\n| `502` | Microsoft unreachable, timed out or 5xx. Outcome unknown; resending the same hour cannot double charge. `retryable` is `true`. | Yes, same `effectiveStartTime` |\n\nEvery response from the endpoint includes `retryable`, `effectiveStartTime` and Microsoft's own verdict under `Microsoft`, so your reconciliation can tie each report to what Microsoft actually recorded. The `429` from the concurrency limiter carries no body.\n\nStill, it's your responsibility to make sure your integration is idempotent and stable.\n\n---\n\n### 🔐 Authentication: Using Your API Key\n\nTo authenticate with the WeTransact API, include your **API key** in every request using the `x-api-key` header.\n\n#### 🔧 How to Generate Your API Key\n\n1. Log in to your WeTransact portal:\n   `https://{your-subdomain}.wetransact.io/Settings`\n2. Navigate to the **Settings** section\n3. Generate your API key and store it securely — you won't be able to retrieve it again later\n\n#### 📬 Example Request\n\n```http\nGET /api/v1.0/subscriptions HTTP/1.1\nHost: yoursubdomain.wetransact.io\nx-api-key: YOUR_API_KEY_HERE\n```\n\n> ⚠️ **Security Note**: Treat your API key like a password. Don't expose it in client-side code, public repos, or logs. If you suspect it's been compromised, rotate it immediately.\n\n---\n\n### 📈 Rate Limits & Throttling\n\nTo keep the platform stable and fair for all users, WeTransact enforces API rate limits.\n\n#### 📦 Subscription Retrieval\n\n- **Limit**: 10 requests per 60 seconds per client\n- **Overages**: Requests beyond this will be throttled or temporarily blocked\n- **Tip**: Cache subscription data where possible, especially in burst scenarios\n\n#### ⚙️ Charge Action\n\n- **Concurrent Limit**: Up to 10 active charge requests at a time\n- **Queue Buffer**: Up to 5 additional requests may queue if things get busy\n- **Overload Handling**: Requests beyond the queue limit are rejected with `429` — retry later with the **same** `effectiveStartTime`\n\nThis ensures the underlying billing system remains performant and reliable — because nobody wants their customer's bill delayed (or wrong).\n\n---\n\n### 🧭 What's Next?\n\nYou're ready to build. Here's what we suggest:\n\n- Start with **subscription retrieval** to list and inspect active subscriptions\n- Hook up the **activation and rejection** logic to your onboarding workflow\n- Integrate **usage metering** only after you've validated everything in a test environment\n- Pull **products**, **financials**, and **marketplace leads** to surface marketplace data in your own dashboards\n\nNeed example code or help setting up? Let us know.\n"
    },
    {
      "name": "Metering integration guide",
      "description": "For engineering teams reporting metered usage through the WeTransact external API and reconciling it against Microsoft's records. It covers the identifiers you join on, how to report usage so that retries are safe, every verdict Microsoft can give, how to read back usage and revenue, and how to use the sandbox.\n\n### Environments\n\n| | Sandbox | Production |\n|---|---|---|\n| Base URL | `https://wetx-api-sandbox.azurewebsites.net` | `https://<yoursubdomain>.wetransact.io` |\n| Authentication | `x-api-key: <sandbox key from WeTransact>` | `x-api-key: <key generated under Settings>` |\n| Microsoft | Faked, stateful, fault-injectable | Real. Every accepted charge lands on your customer's Azure bill |\n| Data | Two seeded subscriptions, seven days of usage history | Your tenant's subscriptions and reports |\n\nA Postman collection with every request in this guide, including the sandbox fault scenarios, is available from WeTransact (`External-API-Metering.postman_collection.json` plus a sandbox environment file). Every request needs the `x-api-key` header; a missing key returns `401`.\n\n**Wire format.** Responses are JSON with PascalCase property names (`MarketplaceSubscriptionId`, `Success`, `Microsoft.Status`). Error bodies returned before a usage report exists use lower-case `message` and `retryable`.\n\n### Identifiers\n\n| You have | It is | Where it appears |\n|---|---|---|\n| SaaS subscription id | The `{subscriptionId}` in every subscription URL | `GET /subscriptions` → `MarketplaceSubscriptionId`; `/financials` → `AssetId`; `/usage` → `ReferenceId` |\n| Partner Center dimension id (for example `transaction_tier_1`) | The `dimensionId` you charge with | `GET /subscriptions?includeMeters=true` → `MeteringDetails.Meters[].MeterId` and `PartnerCenterMeterId` (same value); `/usage` → `MeterId` |\n| Customer's Azure subscription | Microsoft's own `MarketplaceSubscriptionId` column in the usage report | `/usage` → `MarketplaceSubscriptionId`. Not the SaaS subscription id |\n| Purchase line | One line of one purchase | `/financials` → `PurchaseRecordId` + `LineItemId`. Two orders can share one `AssetId` |\n\nStart every integration with `GET /api/v1.0/subscriptions?includeMeters=true`. It lists only subscriptions whose plan has metered dimensions, with the dimension ids to charge and a `charge` link per subscription.\n\n### Reporting usage\n\n```http\nPOST /api/v1.0/subscriptions/{subscriptionId}/actions/charge\n     ?dimensionId=transaction_tier_1\n     &quantity=5\n     &effectiveStartTime=2026-09-07T10:00:00Z\nx-api-key: <key>\n```\n\n- `quantity`: whole number, at least 1.\n- `effectiveStartTime`: optional, ISO 8601 with a `Z` or offset. Defaults to now. Must not be in the future or older than 24 hours. **Always send it explicitly** and store the value you sent: it is your idempotency key. If you omit it, the accepted response carries a `Warning` explaining why that is unsafe.\n\nMicrosoft accepts one usage event per subscription, dimension and hour of `effectiveStartTime`. WeTransact applies the same rule before calling Microsoft, but only against reports Microsoft has accepted, so a failed attempt never blocks its own retry.\n\n#### Response\n\n```json\n{\n  \"Timestamp\": \"2026-09-07T10:42:11Z\",\n  \"MeterId\": \"transaction_tier_1\",\n  \"MeterName\": \"Transactions tier 1\",\n  \"Unit\": \"transaction\",\n  \"Quantity\": 5,\n  \"Success\": true,\n  \"Message\": \"Success\",\n  \"UsageReportEventId\": \"2b7f0c3a-5e1d-4a9b-9c2e-7d8f1a2b3c4d\",\n  \"EffectiveStartTime\": \"2026-09-07T10:00:00Z\",\n  \"Retryable\": false,\n  \"Microsoft\": {\n    \"StatusCode\": 200,\n    \"Status\": \"Accepted\",\n    \"UsageEventId\": \"6f8b3c1e-9a2d-4b7e-8c1f-2d3e4f5a6b7c\",\n    \"Message\": null\n  }\n}\n```\n\n`UsageReportEventId` is WeTransact's record of the report; `Microsoft.UsageEventId` is Microsoft's. Keep both.\n\n#### Status codes\n\n| HTTP | Meaning | Body | Retry? |\n|---|---|---|---|\n| 200 | Microsoft accepted the usage event | Full response, `Success: true` | No |\n| 400 | Invalid `quantity`, `dimensionId` or `effectiveStartTime` (unparsable, future, older than 24h) | `message`, `retryable: false` | Fix first |\n| 404 | Subscription or dimension unknown | `message`, `retryable: false` | Fix first |\n| 409 | Already reported for this hour. Either WeTransact accepted it earlier, or Microsoft answered Duplicate | Full response with the **original** `UsageReportEventId` and `Microsoft.UsageEventId`; `Microsoft.StatusCode` is `null` when Microsoft was not called | No |\n| 422 | Microsoft rejected the event | Full response, see `Microsoft.Status` | Fix first |\n| 429 | Too many concurrent charges (10 in flight, 5 queued) | Empty | Yes, same `effectiveStartTime` |\n| 502 | Microsoft unreachable, timed out or answered 5xx. **Outcome unknown** | Full response, `Retryable: true` | Yes, same `effectiveStartTime` |\n\n#### The retry recipe\n\n```text\nsend charge(subscription, dimension, quantity, effectiveStartTime)\n  200 → done; store UsageReportEventId and Microsoft.UsageEventId\n  409 → done; the hour had already landed, the body tells you which report\n  429, 502, timeout → wait (backoff), send the identical request again\n  400, 404, 422 → do not retry unchanged; fix the request or the subscription state\n```\n\nResending the identical request can never double charge: if the first attempt landed at Microsoft, the retry gets 409 with its ids. Never change `effectiveStartTime` on a retry; that makes it a new usage event.\n\n### Microsoft verdicts\n\nMicrosoft's own answer is relayed unchanged under `Microsoft`. Any Microsoft 4xx is returned as 422; 5xx as 502.\n\n| `Microsoft.Status` | Microsoft HTTP | Returned as | Means |\n|---|---|---|---|\n| `Accepted` | 200 | 200 | Usage recorded |\n| `Duplicate` | 409 | 409 | Microsoft already had this subscription, dimension and hour |\n| `ResourceNotFound` | 400 | 422 | Microsoft does not know the subscription |\n| `ResourceNotAuthorized` | 403 | 422 | The publisher is not allowed to report for this resource |\n| `ResourceNotActive` | 400 | 422 | Subscription suspended or not yet activated |\n| `InvalidDimension` | 400 | 422 | Dimension not in the subscription's plan |\n| `InvalidQuantity` | 400 | 422 | Quantity must be greater than zero |\n| `BadArgument` | 400 | 422 | Malformed request |\n| `Expired` | 400 | 422 | `effectiveStartTime` older than 24 hours at Microsoft |\n| `InternalServerError` and other 5xx | 5xx | 502 | Retry with the same `effectiveStartTime` |\n\n### Reading back what Microsoft recorded\n\n#### Usage per dimension per day\n\n```http\nGET /api/v1.0/usage?subscriptionId=<SaaS subscription id>&from=2026-08-01&to=2026-08-31\n```\n\nMicrosoft's usage report: one row per subscription, per day, per meter dimension (a row can split further when plan, price or private-offer attributes differ). Rows are **daily aggregates**, not individual usage events, so reconcile per day: sum what you reported for a dimension on a day and compare with `MeteredUsage`.\n\n| Field | Meaning |\n|---|---|\n| `ReferenceId` | The SaaS subscription id (your join key) |\n| `MarketplaceSubscriptionId` | The customer's Azure subscription, not the SaaS id |\n| `UsageDate`, `MonthStartDate` | Day and month of usage (dates without a time zone; treat as UTC) |\n| `MeterId`, `MeterDimension` | Dimension id you charge with, and its display name |\n| `RawUsage`, `MeteredUsage`, `UsageUnit` | Quantity Microsoft recorded and billed, in the dimension's unit |\n| `PriceCC`, `EstimatedPricePC`, `ListPriceUSD` | Unit price in customer currency, your payout currency, USD |\n| `EstimatedExtendedChargeCC` / `PC` | `MeteredUsage` × unit price |\n| `PartnerCenterDetectedAnomaly`, `PublisherMarkedAnomaly` | Microsoft's anomaly flags |\n\nFilters are optional; without them you get the full history. In production the report refreshes nightly, so a charge appears the next day. Poll at most once a day.\n\n#### Revenue and payout\n\n```http\nGET /api/v1.0/financials\n```\n\nMicrosoft's revenue report: one row per purchase line per month. Join `AssetId` to the SaaS subscription id; use `PurchaseRecordId` + `LineItemId` to identify a single purchase line. Metered usage appears as monthly SKU-level totals (`BillingModel: \"UsageBased\"`), not per dimension; use `/usage` for that.\n\nThree currencies appear: **CC** is the customer's transaction currency, **PC** is your payout currency, **USD** is Microsoft's reporting currency. `TransactionAmount*` is what the customer was billed, `EarningAmount*` your share after Microsoft's fee, `IncentiveRate` your share in percent (for example `97`). Expected payout in your payout currency is `EstimatedRevenuePC × IncentiveRate / 100`. `PayoutStatus` runs Unprocessed → Upcoming → Sent, with `EstimatedPayoutMonth` and `PaymentSentDate`.\n\nPayouts flow from Microsoft to your Partner Center account. WeTransact is not in the money path.\n\n### Using the sandbox\n\nThe sandbox runs the production API code over an in-memory database; only Microsoft is faked. Its Microsoft is stateful: it remembers what it accepted per subscription, dimension and hour and answers `Duplicate` for it afterwards, exactly as the real one does. `GET /` returns a plain-text summary.\n\n**Seeded data**\n\n| Subscription id | Offer | Dimensions |\n|---|---|---|\n| `22222222-2222-2222-2222-222222222222` | Northwind On Demand (metered) | `transaction_tier_1` … `transaction_tier_6` |\n| `11111111-1111-1111-1111-111111111111` | Northwind Insights (flat rate) | none |\n\nThe metered subscription comes with the previous seven days of usage across all six tiers, so `/usage` and `/financials` return data before you have charged anything. Accepted charges appear in both immediately.\n\n**Fault injection.** Add the header `X-Sandbox-Outcome` to a charge request. Production ignores this header, so never send it there: the call would be a real charge.\n\n| Value | What happens |\n|---|---|\n| `unavailable` | Microsoft never reached: 502, `Retryable: true`, no verdict. The retry lands |\n| `lost` | Microsoft accepted but the response was lost: 502, `Retryable: true`. The retry with the same hour gets 409 Duplicate. **This is the case your retry loop must survive** |\n| `duplicate` | Microsoft had already accepted this hour: 409 Duplicate, and stays 409 |\n| `throttled` | 429 with an empty body |\n| `resource-not-found`, `resource-not-authorized`, `resource-not-active`, `invalid-dimension`, `invalid-quantity`, `bad-argument`, `expired` | The corresponding Microsoft rejection, returned as 422 |\n| `server-error` | Microsoft 500, returned as 502 `Retryable: true` |\n\n`POST /sandbox/reset` (with the key) forgets every charge and restores the seeded history. Let in-flight calls finish first.\n\n**What the sandbox does not do**\n\n- Microsoft's real latency, real error message wording, and any verdict not listed above. Codes are Microsoft's; message text is modelled on Microsoft's documentation.\n- The 10-requests-per-minute limit that production applies to the GET endpoints.\n- Persist anything: state lives in memory and is lost on restart or reset.\n- Your data: subscriptions, dimensions and reports are seeded examples.\n\nTwo production behaviours the sandbox reproduces on purpose: an unknown subscription id on `GET /subscriptions/{id}` answers 500 rather than 404, and dates from Microsoft's reports come back without a time zone.\n\n### Suggested rollout\n\n1. Onboard flat-rate offers first. They exercise activation, lifecycle events and payout reconciliation without touching the charge endpoint.\n2. Build and test the charge retry loop against the sandbox, including the `lost` scenario and a parallel burst that produces 429s.\n3. Move the consumption offer once the loop handles every status in the table above and your daily reconciliation against `/usage` closes.\n"
    }
  ],
  "paths": {
    "/api/v1.0/subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get all subscriptions",
        "operationId": "GetSubscriptions",
        "parameters": [
          {
            "name": "includeMeters",
            "in": "query",
            "description": "If true, include meters in the response.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the list of subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to get subscriptions"
          }
        }
      }
    },
    "/api/v1.0/subscriptions/{subscriptionId}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get a subscription by ID",
        "operationId": "GetSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "The ID of the subscription.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeMeters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the subscription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "404": {
            "description": "Subscription not found"
          },
          "500": {
            "description": "Failed to get the subscription"
          }
        }
      }
    },
    "/api/v1.0/subscriptions/{subscriptionId}/actions/activate": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Activate a subscription",
        "operationId": "ActivateSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription activated successfully"
          },
          "500": {
            "description": "Failed to activate the subscription"
          }
        }
      }
    },
    "/api/v1.0/subscriptions/{subscriptionId}/actions/reject": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Reject a subscription",
        "operationId": "RejectSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription rejected successfully"
          },
          "500": {
            "description": "Failed to reject the subscription"
          }
        }
      }
    },
    "/api/v1.0/subscriptions/{subscriptionId}/actions/charge": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Charge dimensions tied to a subscription",
        "operationId": "ChargeSubscription",
        "description": "Reports usage for one metered dimension of a subscription and relays Microsoft's verdict. This is a\n**billing action**: accepted usage lands on the customer's Azure invoice.\n\n**Idempotency.** Microsoft accepts one usage event per subscription, dimension and hour (the hour of\n`effectiveStartTime`). WeTransact applies the same rule before calling Microsoft, but only against\nreports Microsoft has **accepted**, so a failed attempt never blocks its own retry.\n\n**Safe retry recipe.** Store the `effectiveStartTime` you send. After a timeout, `429` or `502`, resend\nthe identical request. You will get `200` (landed now) or `409` (had already landed, with the original\nids), never a double charge. Every error body from this endpoint says whether a retry is safe (`Retryable` on 409/422/502, `retryable` on 400/404); the `429` from the\nconcurrency limiter has no body.\n\n| HTTP | Meaning | Retry? |\n|------|---------|--------|\n| 200 | Microsoft accepted the usage event | No |\n| 400 | Invalid input | Fix first |\n| 404 | Subscription or dimension unknown | Fix first |\n| 409 | Already reported for this hour (ours or Microsoft `Duplicate`) | No |\n| 422 | Microsoft rejected the event, see `Microsoft.Status` | Fix first |\n| 429 | Too many concurrent charges | Yes, same `effectiveStartTime` |\n| 502 | Microsoft unreachable, timed out or 5xx; outcome unknown | Yes, same `effectiveStartTime` |\n",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "The marketplace subscription id.",
            "schema": {
              "type": "string"
            },
            "example": "aa930163-2330-45c2-a17c-dd325f9f2d44"
          },
          {
            "name": "dimensionId",
            "in": "query",
            "required": true,
            "description": "The **Partner Center dimension id** to charge. `GET /subscriptions?includeMeters=true` returns it as `MeterId` on each meter.",
            "schema": {
              "type": "string"
            },
            "example": "transaction_tier_1"
          },
          {
            "name": "quantity",
            "in": "query",
            "required": true,
            "description": "The quantity to charge. Whole number, at least 1.",
            "schema": {
              "type": "string"
            },
            "example": "5"
          },
          {
            "name": "effectiveStartTime",
            "in": "query",
            "required": false,
            "description": "Optional. The usage hour being reported, ISO 8601 UTC (e.g. 2026-09-07T10:00:00Z). Defaults to now. Must not be in the future or older than 24 hours. Resend the same value when retrying.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-09-07T10:00:00Z"
          }
        ],
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "Report usage",
            "source": "curl -X POST \"https://yoursubdomain.wetransact.io/api/v1.0/subscriptions/aa930163-2330-45c2-a17c-dd325f9f2d44/actions/charge?dimensionId=transaction_tier_1&quantity=5&effectiveStartTime=2026-09-07T10:00:00Z\" \\\n  -H \"x-api-key: YOUR_API_KEY\"\n"
          },
          {
            "lang": "cURL",
            "label": "Retry (identical request)",
            "source": "# Same subscription, dimension and effectiveStartTime as the attempt that timed out.\n# 200 = landed now, 409 = had already landed. Never a double charge.\ncurl -X POST \"https://yoursubdomain.wetransact.io/api/v1.0/subscriptions/aa930163-2330-45c2-a17c-dd325f9f2d44/actions/charge?dimensionId=transaction_tier_1&quantity=5&effectiveStartTime=2026-09-07T10:00:00Z\" \\\n  -H \"x-api-key: YOUR_API_KEY\"\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Microsoft accepted the usage event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                },
                "example": {
                  "Timestamp": "2026-09-07T10:42:11Z",
                  "MeterId": "transaction_tier_1",
                  "MeterName": "Transactions tier 1",
                  "Unit": "transaction",
                  "Quantity": 5,
                  "Success": true,
                  "Message": "Success",
                  "UsageReportEventId": "2b7f0c3a-5e1d-4a9b-9c2e-7d8f1a2b3c4d",
                  "EffectiveStartTime": "2026-09-07T10:00:00Z",
                  "Retryable": false,
                  "Microsoft": {
                    "StatusCode": 200,
                    "Status": "Accepted",
                    "UsageEventId": "6f8b3c1e-9a2d-4b7e-8c1f-2d3e4f5a6b7c",
                    "Message": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid subscriptionId, dimensionId, quantity or effectiveStartTime (unparsable, in the future, or older than 24 hours). Fix the request; do not retry unchanged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeError"
                },
                "example": {
                  "message": "effectiveStartTime cannot be older than 24 hours; Microsoft no longer accepts the usage",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "Subscription or dimension not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeError"
                },
                "example": {
                  "message": "Dimension transaction_tier_9 not found for subscription aa930163-2330-45c2-a17c-dd325f9f2d44",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "Usage for this subscription, dimension and hour was already reported, either accepted earlier by WeTransact or reported as Duplicate by Microsoft. The body carries the original usageReportEventId and Microsoft usageEventId. Nothing was charged twice. Do not retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                },
                "example": {
                  "Timestamp": "2026-09-07T10:43:02Z",
                  "MeterId": "transaction_tier_1",
                  "MeterName": "Transactions tier 1",
                  "Unit": "transaction",
                  "Quantity": 5,
                  "Success": false,
                  "Message": "Usage for this dimension was already reported for the hour starting 2026-09-07T10:00:00.0000000Z",
                  "UsageReportEventId": "2b7f0c3a-5e1d-4a9b-9c2e-7d8f1a2b3c4d",
                  "EffectiveStartTime": "2026-09-07T10:00:00Z",
                  "Retryable": false,
                  "Microsoft": {
                    "StatusCode": null,
                    "Status": "Accepted",
                    "UsageEventId": "6f8b3c1e-9a2d-4b7e-8c1f-2d3e4f5a6b7c",
                    "Message": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Microsoft rejected the usage event (ResourceNotActive, InvalidDimension, Expired, BadArgument, ...). See microsoft.status. Do not retry unchanged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                },
                "example": {
                  "Timestamp": "2026-09-07T10:42:11Z",
                  "MeterId": "transaction_tier_1",
                  "MeterName": "Transactions tier 1",
                  "Unit": "transaction",
                  "Quantity": 5,
                  "Success": false,
                  "Message": "Resource is not active.",
                  "UsageReportEventId": "9d1e2f3a-4b5c-4d6e-8f7a-0b1c2d3e4f5a",
                  "EffectiveStartTime": "2026-09-07T10:00:00Z",
                  "Retryable": false,
                  "Microsoft": {
                    "StatusCode": 400,
                    "Status": "ResourceNotActive",
                    "UsageEventId": null,
                    "Message": "Resource is not active."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many concurrent charge requests. Retry later with the same effectiveStartTime."
          },
          "500": {
            "description": "Unexpected error. Contact support@wetransact.io."
          },
          "502": {
            "description": "Microsoft could not be reached, timed out, or answered 5xx. The outcome at Microsoft is unknown; resend with the same effectiveStartTime and Microsoft's dedupe guarantees no double charge. retryable is true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                },
                "example": {
                  "Timestamp": "2026-09-07T10:42:11Z",
                  "MeterId": "transaction_tier_1",
                  "MeterName": "Transactions tier 1",
                  "Unit": "transaction",
                  "Quantity": 5,
                  "Success": false,
                  "Message": "Service Unavailable",
                  "UsageReportEventId": "9d1e2f3a-4b5c-4d6e-8f7a-0b1c2d3e4f5a",
                  "EffectiveStartTime": "2026-09-07T10:00:00Z",
                  "Retryable": true,
                  "Microsoft": {
                    "StatusCode": 503,
                    "Status": null,
                    "UsageEventId": null,
                    "Message": "Service Unavailable"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1.0/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List products",
        "operationId": "listProducts",
        "responses": {
          "200": {
            "description": "A list of products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to get products"
          }
        }
      }
    },
    "/api/v1.0/products/{productId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get product by ID",
        "operationId": "getProduct",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Product not found"
          },
          "500": {
            "description": "Failed to get product"
          }
        }
      }
    },
    "/api/v1.0/products/bypartnercenterofferid/{partnerCenterOfferId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get product by partner center offer ID",
        "operationId": "getProductByPartnerCenterOfferId",
        "parameters": [
          {
            "name": "partnerCenterOfferId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Partner Center Offer ID is required"
          },
          "404": {
            "description": "Product not found"
          },
          "500": {
            "description": "Failed to get product"
          }
        }
      }
    },
    "/api/v1.0/financials": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "Get financial details",
        "operationId": "GetFinancials",
        "description": "Returns every revenue line WeTransact holds for your publisher account, one row per **purchase line per\nmonth**. The rows are Microsoft's own commercial-marketplace **Revenue report**, pulled from Partner Center\nevery night at 01:00 UTC and stored as-is, so the figures tie to what Microsoft pays out. Payouts flow\nMicrosoft → your Partner Center account; WeTransact is not in the money path.\n\n**Joining to your own data**\n\n| You have | Join on |\n|----------|---------|\n| SaaS `MarketplaceSubscriptionId` (from `GET /subscriptions`) | `AssetId` |\n| One specific purchase line | `PurchaseRecordId` + `LineItemId` (two orders can share one `AssetId`) |\n| A month of usage for a metered plan | `LineItemId` + `MonthStartDate`, rows with `BillingModel = UsageBased` |\n\n**Reading the money columns.** Three currencies appear: **CC** is the customer's transaction currency,\n**PC** is your payout currency, **USD** is Microsoft's reporting currency. `transactionAmount*` is what\nthe customer was billed, `earningAmount*` is your share after Microsoft's fee, and\n`estimatedRevenuePC × incentiveRate / 100` is the payout you should expect in your payout currency\n(`IncentiveRate` is your share in percent, e.g. `97` for a new sale, `98.5` for a renewal).\n\n**Granularity.** Metered usage is reported as monthly SKU-level totals (`billingModel = UsageBased`,\n`Quantity` in `Units`), not per dimension. Use the usage endpoint for per-dimension detail.\n\n**Volume.** There is no filtering or paging; the call returns your whole history. Cache it and diff\nlocally rather than polling more than once a day, since the source only changes nightly.\n",
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "Fetch all revenue lines",
            "source": "curl \"https://yoursubdomain.wetransact.io/api/v1.0/financials\" \\\n  -H \"x-api-key: YOUR_API_KEY\"\n"
          }
        ],
        "responses": {
          "200": {
            "description": "All revenue lines for the publisher, unordered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RevenueLine"
                  }
                },
                "example": [
                  {
                    "PartnerCenterRevenueId": "3c2a9b7e-1d4f-4e8a-9b6c-5d7e8f9a0b1c",
                    "Publisher": "Default",
                    "AssetId": "aa930163-2330-45c2-a17c-dd325f9f2d44",
                    "SalesChannel": "Enterprise",
                    "BillingAccountId": "7f3d1a2b-...",
                    "CustomerCompanyName": "Contoso Ltd",
                    "CustomerCountry": "GB",
                    "CustomerName": "Jane Doe",
                    "CustomerEmail": "jane.doe@contoso.com",
                    "OfferName": "Northwind On Demand",
                    "OfferType": "SaaS",
                    "SKU": "on-demand",
                    "BillingModel": "UsageBased",
                    "Units": "transaction",
                    "Quantity": 1250,
                    "PurchaseRecordId": "f5c1e2d3-...",
                    "LineItemId": "1",
                    "MonthStartDate": "2026-08-01T00:00:00",
                    "TermStartDate": "2026-08-14T00:00:00",
                    "TermEndDate": "2026-09-13T00:00:00",
                    "TransactionAmountCC": 1250,
                    "TransactionAmountPC": 1087.5,
                    "TransactionAmountUSD": 1250,
                    "EarningAmountCC": 1212.5,
                    "EarningAmountPC": 1054.88,
                    "EarningAmountUSD": 1212.5,
                    "EarningCurrencyCode": "GBP",
                    "EarningExchangeRatePC": 0.87,
                    "Revenue": 1250,
                    "EstimatedRevenuePC": 1087.5,
                    "EstimatedRevenueUSD": 1250,
                    "ExchangeRateDate": "2026-08-31T00:00:00",
                    "ExchangeRatePC": 0.87,
                    "ExchangeRateUSD": 1,
                    "IncentiveRate": 97,
                    "PayoutStatus": "Upcoming",
                    "EstimatedPayoutMonth": "2026-10",
                    "PaymentInstrumentType": "Credit card",
                    "PaymentSentDate": null,
                    "TrialDeployment": false
                  }
                ]
              }
            }
          },
          "500": {
            "description": "Failed to find financial details"
          }
        }
      }
    },
    "/api/v1.0/usage": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "Get metered usage per dimension per day",
        "operationId": "GetUsage",
        "description": "Returns Microsoft's commercial-marketplace **Usage report** (ISVUsage) for your publisher account, pulled\nfrom Partner Center every night together with the Revenue report and returned as ingested.\n\n**What a row is.** A daily aggregate of metered usage for one subscription and one meter dimension.\nMicrosoft aggregates per distinct combination of the descriptive columns, so one subscription-day-dimension\ncan appear as several rows when plan, price, private offer or anomaly attributes differ. Rows are **not**\nindividual usage events: there is no `UsageEventId` or effective hour here. Use it to compare daily totals\nper dimension (`MeteredUsage`) against what you reported through the charge endpoint, and as the\nper-dimension detail behind the SKU-level totals in `/financials`.\n\n**Which id is which.** For SaaS custom meters the SaaS subscription id (the one you see in\n`GET /subscriptions` and use when charging) is in `ReferenceId`; Microsoft's `MarketplaceSubscriptionId`\ncolumn is the **customer's Azure subscription**. The `subscriptionId` filter matches either. `MeterId` is\nthe Partner Center dimension id you pass as `dimensionId` when charging.\n\n**Filters.** All optional. Without filters the call returns your whole history, which for a\nconsumption offer is large; pass `subscriptionId` and a `from`/`to` window (inclusive usage days,\nISO 8601). The source only changes nightly, so poll at most once a day. Note that the nightly refresh\nreplaces the table; a request during that window can return fewer rows than the day before.\n",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "query",
            "required": false,
            "description": "Only rows for this subscription. Matches the SaaS subscription id (referenceId; the id from GET /subscriptions and the charge endpoint) or the customer's Azure subscription id (marketplaceSubscriptionId).",
            "schema": {
              "type": "string"
            },
            "example": "aa930163-2330-45c2-a17c-dd325f9f2d44"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First usage day to include, ISO 8601 date or date-time (UTC).",
            "schema": {
              "type": "string"
            },
            "example": "2026-08-01"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last usage day to include, inclusive. A date-time is truncated to its day.",
            "schema": {
              "type": "string"
            },
            "example": "2026-08-31"
          }
        ],
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "One subscription, one month",
            "source": "curl \"https://yoursubdomain.wetransact.io/api/v1.0/usage?subscriptionId=aa930163-2330-45c2-a17c-dd325f9f2d44&from=2026-08-01&to=2026-08-31\" \\\n  -H \"x-api-key: YOUR_API_KEY\"\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Usage lines ordered by usageDate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UsageLine"
                  }
                },
                "example": [
                  {
                    "Id": "8e1c4d2b-7a3f-4b9e-a1c5-3d6f8e9a0b2c",
                    "Publisher": "Default",
                    "MarketplaceSubscriptionId": "0b7e2f7c-3d51-4a8e-9f10-6c2d5e4b3a21",
                    "ReferenceId": "aa930163-2330-45c2-a17c-dd325f9f2d44",
                    "MonthStartDate": "2026-08-01T00:00:00",
                    "UsageDate": "2026-08-14T00:00:00",
                    "OfferType": "SaaS",
                    "OfferName": "Northwind On Demand",
                    "OfferId": "northwind-on-demand",
                    "SKU": "On Demand",
                    "PlanId": "on-demand",
                    "SKUBillingType": "Usage Based",
                    "CustomerCompanyName": "Contoso Ltd",
                    "CustomerCountry": "GB",
                    "CustomerCurrencyCC": "GBP",
                    "MeterId": "transaction_tier_1",
                    "MeterDimension": "Transactions tier 1",
                    "RawUsage": 1250,
                    "MeteredUsage": 1250,
                    "NormalizedUsage": 1250,
                    "UsageUnit": "transaction",
                    "PriceCC": 0.87,
                    "EstimatedPricePC": 0.87,
                    "PayoutCurrencyPC": "GBP",
                    "EstimatedExtendedChargeCC": 1087.5,
                    "EstimatedExtendedChargePC": 1087.5,
                    "ListPriceUSD": 1,
                    "DiscountedPriceUSD": 1,
                    "IsPrivateOffer": false,
                    "PartnerCenterDetectedAnomaly": false,
                    "PublisherMarkedAnomaly": false
                  }
                ]
              }
            }
          },
          "400": {
            "description": "from or to unparsable, not ISO 8601, or from after to.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "'from' must not be after 'to'"
                }
              }
            }
          },
          "500": {
            "description": "Failed to find usage details"
          }
        }
      }
    },
    "/api/v1.0/dealregistration/findcompany": {
      "get": {
        "tags": [
          "DealRegistration"
        ],
        "summary": "Find a company by country and name",
        "operationId": "FindCompany",
        "parameters": [
          {
            "name": "countryCode",
            "in": "query",
            "required": true,
            "description": "ISO country code (e.g. US, GB, NL).",
            "schema": {
              "type": "string",
              "example": "US"
            }
          },
          {
            "name": "companyName",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "WeTransact"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company lookup result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Company match result returned by the deal-registration service."
                }
              }
            }
          },
          "400": {
            "description": "Country code and company name are required"
          },
          "500": {
            "description": "Failed to find company"
          }
        }
      }
    },
    "/api/v1.0/marketplaceleads": {
      "get": {
        "tags": [
          "MarketplaceLeads"
        ],
        "summary": "Get all marketplace leads",
        "operationId": "GetMarketplaceLeads",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "Only return leads created on or after this UTC timestamp (ISO-8601).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00Z"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the list of marketplace leads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceLead"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to get marketplace leads"
          }
        }
      }
    },
    "/api/v1.0/marketplaceleads/{marketplaceLeadId}": {
      "get": {
        "tags": [
          "MarketplaceLeads"
        ],
        "summary": "Get a marketplace lead by ID",
        "operationId": "GetMarketplaceLead",
        "parameters": [
          {
            "name": "marketplaceLeadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the marketplace lead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceLead"
                }
              }
            }
          },
          "404": {
            "description": "Marketplace lead not found"
          },
          "500": {
            "description": "Failed to get marketplace lead"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UsageLine": {
        "type": "object",
        "description": "One row of Microsoft's commercial-marketplace Usage report (ISVUsage dataset): a daily aggregate for a subscription and a meter dimension (further split when plan, price, private-offer or anomaly attributes differ). Field names and values are Microsoft's as ingested; WeTransact adds only id and publisher. Boolean flags are null when Microsoft's export used a form the importer does not read (0/1, Yes/No), and decimals are stored with two decimal places. CC = customer currency, PC = your payout currency, USD = Microsoft reporting currency. VM-specific columns (vmSize, coreSize, normalizedUsage, cloudInstanceName, deploymentMethod) are empty for SaaS.",
        "properties": {
          "Id": {
            "type": "string",
            "format": "uuid",
            "description": "WeTransact's id for this row."
          },
          "Publisher": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Partner Center publisher (seller) the row belongs to. Default for single-publisher accounts."
          },
          "MarketplaceSubscriptionId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft's column of that name: the CUSTOMER'S AZURE subscription id, not the SaaS subscription. For SaaS use referenceId."
          },
          "MonthStartDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "First day of the month the usage belongs to. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "UsageDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The day the usage occurred. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "OfferType": {
            "type": [
              "string",
              "null"
            ],
            "description": "SaaS, Azure Application (Managed App), Virtual Machine, ...",
            "example": "SaaS"
          },
          "OfferName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace offer display name."
          },
          "OfferId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace offer id."
          },
          "SKU": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plan display name."
          },
          "PlanId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Partner Center plan id."
          },
          "AzureLicenseType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer's Azure agreement type: Enterprise, Pay as You Go, Microsoft Customer Agreement, ..."
          },
          "MarketplaceLicenseType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Billed through Azure, or Bring Your Own License."
          },
          "SKUBillingType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Usage Based for metered dimensions; Subscription for flat recurring plans.",
            "example": "Usage Based"
          },
          "CustomerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerCompanyName": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerCountry": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2 country code.",
            "example": "GB"
          },
          "CustomerCurrencyCC": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code of the customer's billing currency (the CC columns).",
            "example": "GBP"
          },
          "CustomerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "BillingAccountId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft billing account of the customer."
          },
          "BillingId": {
            "type": [
              "string",
              "null"
            ]
          },
          "IsPrivateOffer": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when the usage was billed under a private offer."
          },
          "IsPrivatePlan": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "PrivateOfferId": {
            "type": [
              "string",
              "null"
            ]
          },
          "PrivateOfferName": {
            "type": [
              "string",
              "null"
            ]
          },
          "IsPreviewSKU": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "IsNewCustomer": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "IsMultisolution": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "DeploymentMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "VMSize": {
            "type": [
              "string",
              "null"
            ]
          },
          "CoreSize": {
            "type": [
              "integer",
              "null"
            ]
          },
          "CloudInstanceName": {
            "type": [
              "string",
              "null"
            ]
          },
          "NormalizedUsage": {
            "type": [
              "number",
              "null"
            ],
            "description": "VM offers only: usage hours normalised to cores. Mirrors rawUsage for SaaS."
          },
          "RawUsage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Raw metered quantity Microsoft recorded for the dimension on this day."
          },
          "MeteredUsage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Quantity billed to the customer for the dimension on this day (aggregate across that day's usage events), in usageUnit. Compare the daily total with what you reported through the charge endpoint."
          },
          "UsageUnit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The dimension's unit.",
            "example": "transaction"
          },
          "UsageReference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft's reference for the usage line (charge or adjustment)."
          },
          "ReferenceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "For SaaS custom meters: the SaaS subscription id. Same value as marketplaceSubscriptionId in GET /subscriptions and assetId in /financials.",
            "example": "aa930163-2330-45c2-a17c-dd325f9f2d44"
          },
          "PriceCC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Unit price in the customer's currency."
          },
          "EstimatedPricePC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Unit price converted to your payout currency."
          },
          "PayoutCurrencyPC": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code of your payout currency (the PC columns).",
            "example": "GBP"
          },
          "EstimatedExtendedChargeCC": {
            "type": [
              "number",
              "null"
            ],
            "description": "meteredUsage × priceCC, in the customer's currency."
          },
          "EstimatedExtendedChargePC": {
            "type": [
              "number",
              "null"
            ],
            "description": "meteredUsage × estimatedPricePC, in your payout currency."
          },
          "ListPriceUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Public list unit price in USD."
          },
          "DiscountedPriceUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Unit price after private-offer or plan discount, USD."
          },
          "CustomerAdjustmentUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Adjustments Microsoft applied for the customer, USD."
          },
          "TrialEndDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "End of the customer's free trial, if any. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "PlanType": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerAccess": {
            "type": [
              "string",
              "null"
            ]
          },
          "PublisherAccess": {
            "type": [
              "string",
              "null"
            ]
          },
          "MultiParty": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True for multiparty private offers."
          },
          "ResalePartner": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "PartnerInfo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reseller details on multiparty private offers."
          },
          "MeterId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Partner Center dimension id: the value you pass as dimensionId to the charge endpoint.",
            "example": "transaction_tier_1"
          },
          "MeterDimension": {
            "type": [
              "string",
              "null"
            ],
            "description": "The dimension's display name in Partner Center."
          },
          "EstimatedFinancialImpactUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Microsoft's estimate of the financial impact of a flagged anomaly, USD."
          },
          "PartnerCenterDetectedAnomaly": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when Microsoft flagged this usage as anomalous."
          },
          "PublisherMarkedAnomaly": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when the publisher marked this usage as anomalous in Partner Center."
          },
          "NewReportedUsage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Corrected quantity after an anomaly review, if any."
          },
          "ActionTakenAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the anomaly action was taken. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "ActionTakenBy": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RevenueLine": {
        "type": "object",
        "description": "One row of Microsoft's commercial-marketplace Revenue report: a purchase line for one month. Field names and values are Microsoft's; WeTransact adds only partnerCenterRevenueId and publisher. Amounts are doubles. CC = customer transaction currency, PC = your payout currency, USD = Microsoft reporting currency.",
        "properties": {
          "PartnerCenterRevenueId": {
            "type": "string",
            "format": "uuid",
            "description": "WeTransact's id for this row. Stable across nightly refreshes only as long as Microsoft does not restate the line."
          },
          "Publisher": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Partner Center publisher (seller) the row belongs to. \"Default\" for single-publisher accounts."
          },
          "AssetId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Join key to the subscription. For SaaS this equals the marketplaceSubscriptionId returned by GET /subscriptions."
          },
          "SalesChannel": {
            "type": [
              "string",
              "null"
            ],
            "description": "How the customer bought. Microsoft values include Enterprise, MCA, Cloud Solution Provider, Go to Market, Pay as you go.",
            "example": "Enterprise"
          },
          "BillingAccountId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft billing account of the customer."
          },
          "CustomerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerCompanyName": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerState": {
            "type": [
              "string",
              "null"
            ]
          },
          "CustomerCountry": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2 country code.",
            "example": "GB"
          },
          "OfferName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace offer display name."
          },
          "OfferType": {
            "type": [
              "string",
              "null"
            ],
            "description": "SaaS, Azure Application (Managed App), Virtual Machine, ...",
            "example": "SaaS"
          },
          "SKU": {
            "type": [
              "string",
              "null"
            ],
            "description": "The plan id (Partner Center plan / SKU) the line belongs to."
          },
          "BillingModel": {
            "type": [
              "string",
              "null"
            ],
            "description": "UsageBased for metered consumption; otherwise a recurring subscription charge.",
            "example": "UsageBased"
          },
          "Units": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unit of quantity for usage-based lines (the dimension's unit). Empty for subscription lines."
          },
          "Quantity": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seats for subscription lines; total metered units in the month for usage-based lines (all dimensions of the SKU summed)."
          },
          "PurchaseRecordId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft's purchase record. Together with lineItemId identifies one purchase line; use this pair, not assetId alone, when an asset has several orders."
          },
          "LineItemId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Line within the purchase record. Together with monthStartDate identifies one usage month."
          },
          "MonthStartDate": {
            "type": "string",
            "description": "First day of the month this row covers. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "TermStartDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Start of the billing term this line belongs to. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "TermEndDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "End of the billing term. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "TransactionAmountCC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount billed to the customer, in the customer's currency."
          },
          "TransactionAmountPC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount billed to the customer, converted to your payout currency."
          },
          "TransactionAmountUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount billed to the customer, in USD."
          },
          "EarningAmountCC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your earning after Microsoft's marketplace fee, in the customer's currency."
          },
          "EarningAmountPC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your earning after Microsoft's marketplace fee, in your payout currency."
          },
          "EarningAmountUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your earning after Microsoft's marketplace fee, in USD."
          },
          "EarningCurrencyCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code of your payout currency (the PC columns).",
            "example": "GBP"
          },
          "EarningExchangeRatePC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Rate used to convert the earning to your payout currency. 1 when no conversion applied."
          },
          "Revenue": {
            "type": [
              "number",
              "null"
            ],
            "description": "Microsoft's billed revenue for the line (USD). Microsoft's own \"Revenue\" column, unchanged."
          },
          "EstimatedRevenuePC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated revenue in your payout currency. Payout you should expect = estimatedRevenuePC × incentiveRate / 100."
          },
          "EstimatedRevenueUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated revenue in USD."
          },
          "ExchangeRateDate": {
            "type": "string",
            "description": "Date of the exchange rates used on this row. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "ExchangeRatePC": {
            "type": [
              "number",
              "null"
            ],
            "description": "USD → payout currency rate. 1 when no conversion applied."
          },
          "ExchangeRateUSD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Customer currency → USD rate. 1 when no conversion applied."
          },
          "IncentiveRate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your share of the transaction in percent (100 minus Microsoft's fee), e.g. 97 for a new sale, 98.5 for a renewal.",
            "example": 97
          },
          "PayoutStatus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Microsoft payout state. Sent = paid to you; Upcoming = scheduled; Unprocessed / Unreconciled / Reprocessing = still being processed by Microsoft; Uncollected = Microsoft has not collected from the customer yet; Not eligible = will not be paid out (e.g. trial or zero-value line).",
            "example": "Upcoming"
          },
          "EstimatedPayoutMonth": {
            "type": [
              "string",
              "null"
            ],
            "description": "Month Microsoft expects to pay, yyyy-MM.",
            "example": "2026-10"
          },
          "PaymentInstrumentType": {
            "type": [
              "string",
              "null"
            ],
            "description": "How the customer paid (Credit card, Invoice, ...)."
          },
          "PaymentSentDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "When Microsoft sent the payout. Null until payoutStatus is Sent. ISO 8601 date-time without offset (Microsoft report dates carry no time zone; treat as UTC dates)."
          },
          "TrialDeployment": {
            "type": "boolean",
            "description": "True when the line comes from a free trial and carries no earning."
          }
        }
      },
      "ChargeResponse": {
        "type": "object",
        "description": "Result of a usage report. success/message/meterId/meterName/unit/quantity/timestamp are the original fields; usageReportEventId, effectiveStartTime, retryable and microsoft were added so a charge can be retried safely. Returned on 200, 409, 422 and 502.",
        "properties": {
          "Timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "MeterId": {
            "type": "string",
            "description": "The Partner Center dimension id that was charged.",
            "example": "transaction_tier_1"
          },
          "MeterName": {
            "type": "string",
            "example": "Transactions tier 1"
          },
          "Unit": {
            "type": "string",
            "example": "transaction"
          },
          "Quantity": {
            "type": "integer",
            "example": 5
          },
          "Success": {
            "type": "boolean"
          },
          "Message": {
            "type": "string"
          },
          "UsageReportEventId": {
            "type": "string",
            "format": "uuid",
            "description": "WeTransact's record of this report. Quote it to support when a charge is disputed."
          },
          "EffectiveStartTime": {
            "type": "string",
            "format": "date-time",
            "description": "The usage hour that was reported, UTC. Resend the same value when retrying.",
            "example": "2026-09-07T10:00:00Z"
          },
          "Retryable": {
            "type": "boolean",
            "description": "True only when Microsoft was unreachable or answered 5xx (HTTP 502). Never true on 2xx, 409 or 422."
          },
          "Warning": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set on an accepted charge when the caller is doing something that will hurt them later. Today: effectiveStartTime was omitted, so a retry after the hour boundary would be a new, billable event. Null when there is nothing to warn about."
          },
          "Microsoft": {
            "type": "object",
            "description": "Microsoft's own verdict, relayed unchanged. Microsoft is the authority on whether usage landed.",
            "properties": {
              "StatusCode": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "HTTP status Microsoft returned. Null when Microsoft was not called (our own dedupe hit).",
                "example": 200
              },
              "Status": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Accepted, Duplicate, ResourceNotActive, ResourceNotFound, InvalidDimension, Expired, BadArgument, ...",
                "example": "Accepted"
              },
              "UsageEventId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Microsoft's id for the accepted usage event. On Duplicate, the id of the event accepted earlier.",
                "example": "6f8b3c1e-9a2d-4b7e-8c1f-2d3e4f5a6b7c"
              },
              "Message": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "ChargeError": {
        "type": "object",
        "description": "Returned on 400 and 404, before any usage report exists.",
        "properties": {
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "Link": {
        "type": "object",
        "properties": {
          "Href": {
            "type": "string",
            "example": "https://<yourdomain>.wetransact.io/api/v1.0/subscriptions/aa930163-2330-45c2-a17c-dd325f9f2d44"
          },
          "Rel": {
            "type": "string",
            "example": "self"
          },
          "Method": {
            "type": "string",
            "example": "GET"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "MarketplaceSubscriptionId": {
            "type": "string",
            "example": "aa930163-2330-45c2-a17c-dd325f9f2d44"
          },
          "Created": {
            "type": "string",
            "format": "date-time",
            "example": "2025-11-25T00:00:00Z"
          },
          "CustomerTenantId": {
            "type": "string",
            "example": "36a5a162-2d92-4255-8f01-0a6b35dba770"
          },
          "CompanyName": {
            "type": "string",
            "example": "WeTransact"
          },
          "MarketplaceOfferId": {
            "type": "string",
            "example": "my-product"
          },
          "MarketplacePlanId": {
            "type": "string",
            "example": "my-sku"
          },
          "SeatQuantity": {
            "type": "string",
            "example": "10"
          },
          "TermUnit": {
            "type": "string",
            "example": "P1M | P1Y | P2Y | P3Y"
          },
          "InitialUserEmail": {
            "type": "string",
            "example": "test@wetransact.io"
          },
          "AdditionalDetails": {
            "type": "string",
            "example": "{ 'phonenumber':'445533663388' }"
          },
          "Status": {
            "type": "string",
            "example": "New | Approved | Cancelled | Suspended | Rejected | ApproveBy | Succeeded | Failed | Deleted"
          },
          "MeteringDetails": {
            "type": "object",
            "description": "Present when includeMeters=true and the plan has metered dimensions.",
            "properties": {
              "Meters": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "MeterId": {
                      "type": "string",
                      "description": "The Partner Center dimension id. This is the value to pass as dimensionId to the charge endpoint.",
                      "example": "transaction_tier_1"
                    },
                    "PartnerCenterMeterId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Same value as meterId, named explicitly. Null on releases before September 2026.",
                      "example": "transaction_tier_1"
                    },
                    "MeterName": {
                      "type": "string",
                      "example": "Transactions tier 1"
                    },
                    "Unit": {
                      "type": "string",
                      "example": "transaction"
                    },
                    "Price": {
                      "type": "number",
                      "description": "Unit price of the dimension in the plan's base currency (USD). 0 on releases before September 2026.",
                      "example": 0.85
                    }
                  }
                }
              }
            }
          },
          "Links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      },
      "Plan": {
        "type": "object",
        "properties": {
          "PlanId": {
            "type": "string",
            "example": "87a7771c-a171-4b61-8545-d0a9f2699544"
          },
          "PlanName": {
            "type": "string",
            "example": "WeTransact"
          },
          "PlanStatus": {
            "type": "string",
            "example": "Published"
          },
          "PlanDescription": {
            "type": "string",
            "example": "<p>Included: ...</p>"
          },
          "PricingModel": {
            "type": "string",
            "example": "flatrate"
          },
          "Countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "US",
              "GB"
            ]
          },
          "Created": {
            "type": "string",
            "format": "date-time",
            "example": "2024-03-25T15:41:55Z"
          },
          "HasFreeTrial": {
            "type": "boolean",
            "example": false
          },
          "HasDimensions": {
            "type": "boolean",
            "example": false
          },
          "MinUsersEnabled": {
            "type": "boolean",
            "example": false
          },
          "MaxUsersEnabled": {
            "type": "boolean",
            "example": false
          },
          "MinUsers": {
            "type": [
              "integer",
              "null"
            ],
            "example": 1
          },
          "MaxUsers": {
            "type": [
              "integer",
              "null"
            ],
            "example": 100
          },
          "FlatratePricingConfiguration": {
            "type": "object",
            "properties": {
              "PricingOptions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "Price": {
                      "type": "number",
                      "example": 4999
                    },
                    "BillingTerm": {
                      "type": "string",
                      "example": "2"
                    },
                    "PaymentCycle": {
                      "type": "string",
                      "example": "1"
                    },
                    "Currency": {
                      "type": "string",
                      "example": "EUR"
                    }
                  }
                }
              }
            }
          },
          "PerUserPricingConfiguration": {
            "type": [
              "object",
              "null"
            ]
          },
          "CustomDimensionConfiguration": {
            "type": [
              "object",
              "null"
            ]
          },
          "PrivatePlanTenantIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "PartnerCenterPlanId": {
            "type": "string",
            "example": "87a7771c-a171-4b61-8545-d0a9f4499570-1"
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "ProductId": {
            "type": "string",
            "format": "uuid",
            "example": "c82329c5-5331-4580-96af-2d2cb6aebde9"
          },
          "ProductName": {
            "type": "string",
            "example": "WeTransact"
          },
          "Status": {
            "type": "string",
            "example": "Published"
          },
          "Created": {
            "type": "string",
            "format": "date-time",
            "example": "2024-02-13T13:35:56Z"
          },
          "ProductDescription": {
            "type": "string",
            "example": "<p>Introducing WeTransact...</p>"
          },
          "GettingStartedInstructions": {
            "type": "string",
            "example": "Getting Started Instructions"
          },
          "SearchKeyword1": {
            "type": "string",
            "example": "Marketplace Publishing"
          },
          "SearchKeyword2": {
            "type": "string",
            "example": "Integration"
          },
          "SearchKeyword3": {
            "type": "string",
            "example": "Go-to-Market"
          },
          "LogoUrl": {
            "type": "string",
            "example": "https://xyz.blob.core.windows.net/productlogos/logo.png"
          },
          "Screenshots": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "https://xyz.blob.core.windows.net/files/screenshot.png"
            ]
          },
          "SupportingFiles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Description": {
                  "type": "string",
                  "example": "WeTransact_supporting_doc.pdf"
                },
                "Url": {
                  "type": "string",
                  "example": "https://xyz.blob.core.windows.net/files/WeTransact_3_Pager.pdf"
                }
              }
            }
          },
          "Videos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "https://www.youtube.com/watch?v=xyz"
            ]
          },
          "TagLine": {
            "type": "string",
            "example": "Publish and Sell on Azure Marketplace with ease!"
          },
          "PrivacyPolicyUrl": {
            "type": "string",
            "example": "https://www.wetransact.io/privacy"
          },
          "SupportUrl": {
            "type": "string",
            "example": "https://www.wetransact.io/support"
          },
          "TermsAndConditionsAmendmentText": {
            "type": [
              "string",
              "null"
            ],
            "example": "Custom amendment text for this offer."
          },
          "TermsAndConditionsType": {
            "type": "string",
            "example": "msftcontract"
          },
          "TermsAndConditionsLink": {
            "type": [
              "string",
              "null"
            ],
            "example": "https://www.wetransact.io/terms"
          },
          "PartnerCenterOfferId": {
            "type": "string",
            "example": "c82329c5-5331-4580-96af-2c2cb6aebab9"
          },
          "HasUnpublishedDetails": {
            "type": "boolean",
            "example": true
          },
          "ProductType": {
            "type": "string",
            "example": "SaaS"
          },
          "SelectedPublisher": {
            "type": "string",
            "example": "EMEA"
          },
          "Plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "SubscriptionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "343ebc84-7a85-45fc-8fce-82ca0b358784"
            ]
          },
          "IsFullyHostedInAzure": {
            "type": "boolean",
            "example": true
          },
          "Links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      },
      "MarketplaceLead": {
        "type": "object",
        "properties": {
          "MarketplaceLeadId": {
            "type": "string",
            "format": "uuid",
            "example": "4f8a2b7c-1a23-4567-89ab-cdef01234567"
          },
          "LeadSource": {
            "type": "string",
            "example": "AzureMarketplace"
          },
          "ActionCode": {
            "type": "string",
            "example": "INS"
          },
          "OfferTitle": {
            "type": "string",
            "example": "WeTransact SaaS Offer"
          },
          "Description": {
            "type": "string",
            "example": "New install from Azure Marketplace"
          },
          "Created": {
            "type": "string",
            "format": "date-time",
            "example": "2026-04-22T10:15:00Z"
          },
          "FirstName": {
            "type": "string",
            "example": "Jane"
          },
          "LastName": {
            "type": "string",
            "example": "Doe"
          },
          "Email": {
            "type": "string",
            "example": "jane.doe@contoso.com"
          },
          "Phone": {
            "type": "string",
            "example": "+31 20 000 0000"
          },
          "Country": {
            "type": "string",
            "example": "NL"
          },
          "Company": {
            "type": "string",
            "example": "Contoso"
          },
          "Title": {
            "type": "string",
            "example": "Cloud Architect"
          },
          "Links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "api_key": []
    }
  ]
}