openapi: 3.1.0
info:
  title: WeTransact Platform API
  description: API for managing subscriptions and metering for WeTransact Publishers.
  version: '1.0'
  contact:
    name: Support Team
    email: support@wetransact.io
servers:
  - url: https://<yoursubdomain>.wetransact.io/api/v1
    description: WeTransact Publisher API Base URL
tags:
  - name: Subscriptions
    description: >-
      All functions that relate to the subscription entity in the WeTransact
      Platform.
  - name: Products
    description: All product operations on the WeTransact Platform
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:
                  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
                      properties:
                        meters:
                          type: array
                          items:
                            type: object
                            properties:
                              meterId:
                                type: string
                                example: 0a6b35dba770
                              meterName:
                                type: string
                                example: transactions
                              unit:
                                type: string
                                example: each
                    links:
                      type: array
                      items:
                        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
        '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
          description: If true, include meters in the response.
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Returns the subscription
          content:
            application/json:
              schema:
                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
                    properties:
                      meters:
                        type: array
                        items:
                          type: object
                          properties:
                            meterId:
                              type: string
                              example: 0a6b35dba770
                            meterName:
                              type: string
                              example: transactions
                            unit:
                              type: string
                              example: each
                  links:
                    type: array
                    items:
                      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
        '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
          description: The ID of the subscription.
          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
          description: The ID of the subscription.
          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 the dimensions that are tied to a subscription
      operationId: ChargeSubscription
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: The ID of the subscription.
          schema:
            type: string
        - name: dimensionId
          in: query
          required: true
          description: The ID of the dimension to charge.
          schema:
            type: string
        - name: quantity
          in: query
          required: true
          description: The quantity to charge.
          schema:
            type: string
      responses:
        '200':
          description: Subscription charged successfully
        '500':
          description: Failed to charge the subscription
  /api/v1.0/products:
    get:
      summary: List products
      operationId: listProducts
      tags:
        - Products
      responses:
        '200':
          description: A list of products
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
              examples:
                sample:
                  summary: Example list of products
                  value:
                    - productId: c82329c5-5331-4580-96af-2d2cb6aebde9
                      productName: WeTransact
                      status: Published
                      created: '2024-02-13T13:35:56'
                      productDescription: >-
                        <p>Introducing <a
                        href="https://www.wetransact.io/">WeTransact</a>...</p>
                      gettingStartedInstructions: Getting Started Instructions
                      searchKeyword1: Marketplace Publishing
                      searchKeyword2: Integration
                      searchKeyword3: Go-to-Market
                      logoUrl: https://xyz.blob.core.windows.net/productlogos/logo.png
                      screenshots:
                        - https://xyz.blob.core.windows.net/files/screenshot.png
                      supportingFiles:
                        - description: WeTransact_supporting_doc.pdf
                          url: >-
                            https://xyz.blob.core.windows.net/files/WeTransact_3_Pager.pdf
                      videos:
                        - https://www.youtube.com/watch?v=xyz
                      tagLine: Publish and Sell on Azure Marketplace with ease!
                      privacyPolicyUrl: https://www.wetransact.io/privacy
                      supportUrl: https://www.wetransact.io/support
                      termsAndConditionsAmendmentText: null
                      termsAndConditionsType: msftcontract
                      termsAndConditionsLink: null
                      partnerCenterOfferId: c82329c5-5331-4580-96af-2c2cb6aebab9
                      hasUnpublishedDetails: true
                      productType: SaaS
                      selectedPublisher: EMEA
                      plans:
                        - planId: 87a7771c-a171-4b61-8545-d0a9f2699544
                          planName: WeTransact
                          planStatus: Published
                          planDescription: '<p>Included: ...</p>'
                          pricingModel: flatrate
                          countries:
                            - US
                            - GB
                          created: '2024-03-25T15:41:55'
                          hasFreeTrial: false
                          hasDimensions: false
                          minUsersEnabled: false
                          maxUsersEnabled: false
                          minUsers: null
                          maxUsers: null
                          flatratePricingConfiguration:
                            pricingOptions:
                              - price: 4999
                                billingTerm: '2'
                                paymentCycle: '1'
                                currency: EUR
                          perUserPricingConfiguration: null
                          customDimensionConfiguration: null
                          privatePlanTenantIds: []
                          partnerCenterPlanId: 87a7771c-a171-4b61-8545-d0a9f4499570-1
                      subscriptionIds:
                        - 343ebc84-7a85-45fc-8fce-82ca0b358784
                      isFullyHostedInAzure: true
                      links:
                        - href: >-
                            https://<yourdomain>.wetransact.io/api/v1.0/products/c82329c5-5331-4580-96af-2d2cb6aebde9
                          rel: self
                          method: GET
        '500':
          description: Failed to get products
  /api/v1.0/products/{productId}:
    get:
      summary: Get product by ID
      operationId: getProduct
      tags:
        - Products
      parameters:
        - in: path
          name: productId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The requested product
          content:
            application/json:
              schema:
                type: object
              examples:
                sample:
                  summary: Example product
                  value:
                    productId: c82329c5-5331-4580-96af-2d2cb6aebde9
                    productName: WeTransact
                    status: Published
                    created: '2024-02-13T13:35:56'
                    productDescription: >-
                      <p>Introducing <a
                      href="https://www.wetransact.io/">WeTransact</a>...</p>
                    gettingStartedInstructions: Getting Started Instructions
                    searchKeyword1: Marketplace Publishing
                    searchKeyword2: Integration
                    searchKeyword3: Go-to-Market
                    logoUrl: https://xyz.blob.core.windows.net/productlogos/logo.png
                    screenshots:
                      - https://xyz.blob.core.windows.net/files/screenshot.png
                    supportingFiles:
                      - description: WeTransact_supporting_doc.pdf
                        url: >-
                          https://xyz.blob.core.windows.net/files/WeTransact_3_Pager.pdf
                    videos:
                      - https://www.youtube.com/watch?v=xyz
                    tagLine: Publish and Sell on Azure Marketplace with ease!
                    privacyPolicyUrl: https://www.wetransact.io/privacy
                    supportUrl: https://www.wetransact.io/support
                    termsAndConditionsAmendmentText: null
                    termsAndConditionsType: msftcontract
                    termsAndConditionsLink: null
                    partnerCenterOfferId: c82329c5-5331-4580-96af-2c2cb6aebab9
                    hasUnpublishedDetails: true
                    productType: SaaS
                    selectedPublisher: EMEA
                    plans:
                      - planId: 87a7771c-a171-4b61-8545-d0a9f2699544
                        planName: WeTransact
                        planStatus: Published
                        planDescription: '<p>Included: ...</p>'
                        pricingModel: flatrate
                        countries:
                          - US
                          - GB
                        created: '2024-03-25T15:41:55'
                        hasFreeTrial: false
                        hasDimensions: false
                        minUsersEnabled: false
                        maxUsersEnabled: false
                        minUsers: null
                        maxUsers: null
                        flatratePricingConfiguration:
                          pricingOptions:
                            - price: 4999
                              billingTerm: '2'
                              paymentCycle: '1'
                              currency: EUR
                        perUserPricingConfiguration: null
                        customDimensionConfiguration: null
                        privatePlanTenantIds: []
                        partnerCenterPlanId: 87a7771c-a171-4b61-8545-d0a9f4499570-1
                    subscriptionIds:
                      - 343ebc84-7a85-45fc-8fce-82ca0b358784
                    isFullyHostedInAzure: true
                    links:
                      - href: >-
                          https://<yourdomain>.wetransact.io/api/v1.0/products/c82329c5-5331-4580-96af-2d2cb6aebde9
                        rel: self
                        method: GET
        '500':
          description: Failed to get product
  /api/v1.0/products/bypartnercenterofferid/{partnerCenterOfferId}:
    get:
      summary: Get product by partner center offer ID
      operationId: getProductByPartnerCenterOfferId
      tags:
        - Products
      parameters:
        - in: path
          name: partnerCenterOfferId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The requested product
          content:
            application/json:
              schema:
                type: object
              examples:
                sample:
                  summary: Example product
                  value:
                    productId: c82329c5-5331-4580-96af-2d2cb6aebde9
                    productName: WeTransact
                    status: Published
                    created: '2024-02-13T13:35:56'
                    productDescription: >-
                      <p>Introducing <a
                      href="https://www.wetransact.io/">WeTransact</a>...</p>
                    gettingStartedInstructions: Getting Started Instructions
                    searchKeyword1: Marketplace Publishing
                    searchKeyword2: Integration
                    searchKeyword3: Go-to-Market
                    logoUrl: https://xyz.blob.core.windows.net/productlogos/logo.png
                    screenshots:
                      - https://xyz.blob.core.windows.net/files/screenshot.png
                    supportingFiles:
                      - description: WeTransact_supporting_doc.pdf
                        url: >-
                          https://xyz.blob.core.windows.net/files/WeTransact_3_Pager.pdf
                    videos:
                      - https://www.youtube.com/watch?v=xyz
                    tagLine: Publish and Sell on Azure Marketplace with ease!
                    privacyPolicyUrl: https://www.wetransact.io/privacy
                    supportUrl: https://www.wetransact.io/support
                    termsAndConditionsAmendmentText: null
                    termsAndConditionsType: msftcontract
                    termsAndConditionsLink: null
                    partnerCenterOfferId: c82329c5-5331-4580-96af-2c2cb6aebab9
                    hasUnpublishedDetails: true
                    productType: SaaS
                    selectedPublisher: EMEA
                    plans:
                      - planId: 87a7771c-a171-4b61-8545-d0a9f2699544
                        planName: WeTransact
                        planStatus: Published
                        planDescription: '<p>Included: ...</p>'
                        pricingModel: flatrate
                        countries:
                          - US
                          - GB
                        created: '2024-03-25T15:41:55'
                        hasFreeTrial: false
                        hasDimensions: false
                        minUsersEnabled: false
                        maxUsersEnabled: false
                        minUsers: null
                        maxUsers: null
                        flatratePricingConfiguration:
                          pricingOptions:
                            - price: 4999
                              billingTerm: '2'
                              paymentCycle: '1'
                              currency: EUR
                        perUserPricingConfiguration: null
                        customDimensionConfiguration: null
                        privatePlanTenantIds: []
                        partnerCenterPlanId: 87a7771c-a171-4b61-8545-d0a9f4499570-1
                    subscriptionIds:
                      - 343ebc84-7a85-45fc-8fce-82ca0b358784
                    isFullyHostedInAzure: true
                    links:
                      - href: >-
                          https://<yourdomain>.wetransact.io/api/v1.0/products/c82329c5-5331-4580-96af-2d2cb6aebde9
                        rel: self
                        method: GET
        '500':
          description: Failed to get product
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key
security:
  - api_key: []
