> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexprice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a marketplace agreement (AWS, GCP, or Azure)

> Registers an AWS, GCP, or Azure Marketplace buyer agreement against an existing Flexprice subscription, upserting plan/subscription/customer integration mappings in one call. Set "provider" to the target marketplace and populate the matching aws/gcp/azure block.



## OpenAPI

````yaml /api-reference/openapi.json post /marketplace/agreements
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /marketplace/agreements:
    post:
      tags:
        - Marketplace
      summary: Register a marketplace agreement (AWS, GCP, or Azure)
      description: >-
        Registers an AWS, GCP, or Azure Marketplace buyer agreement against an
        existing Flexprice subscription, upserting plan/subscription/customer
        integration mappings in one call. Set "provider" to the target
        marketplace and populate the matching aws/gcp/azure block.
      requestBody:
        description: Agreement registration request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterMarketplaceAgreementRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterMarketplaceAgreementResponse'
components:
  schemas:
    RegisterMarketplaceAgreementRequest:
      required:
        - customer_id
        - plan_id
        - provider
        - subscription_id
      type: object
      properties:
        aws:
          $ref: '#/components/schemas/AWSMarketplaceAgreement'
        azure:
          $ref: '#/components/schemas/AzureMarketplaceAgreement'
        customer_id:
          type: string
        gcp:
          $ref: '#/components/schemas/GCPMarketplaceAgreement'
        plan_id:
          type: string
        provider:
          $ref: '#/components/schemas/types.SecretProvider'
        subscription_id:
          type: string
    RegisterMarketplaceAgreementResponse:
      type: object
      properties:
        customer_mapping_id:
          type: string
        plan_mapping_id:
          type: string
        status:
          type: string
        subscription_mapping_id:
          type: string
    AWSMarketplaceAgreement:
      required:
        - customer_aws_account_id
        - dimension
        - license_arn
        - product_code
      type: object
      properties:
        concurrent_agreements:
          type: boolean
          description: if true, ProductCode is omitted when reporting
        customer_aws_account_id:
          type: string
          description: '-> BatchMeterUsage''s CustomerAWSAccountId'
        dimension:
          type: string
          description: >-
            -> BatchMeterUsage's Dimension (always "usage_fee" in the cents
            model)
        license_arn:
          type: string
          description: '-> BatchMeterUsage''s LicenseArn; identifies the buyer''s agreement'
        product_code:
          type: string
          description: '-> BatchMeterUsage''s ProductCode (omitted when ConcurrentAgreements)'
    AzureMarketplaceAgreement:
      required:
        - beneficiary_account_id
        - dimension
        - plan_id
        - resource_id
      type: object
      properties:
        beneficiary_account_id:
          type: string
          description: writes the customer mapping; not read in the report payload
        dimension:
          type: string
          description: '-> usageEvent''s dimension (always "usage_fee" in the cents model)'
        plan_id:
          type: string
          description: >-
            -> usageEvent's planId; Azure's plan id, distinct from the request's
            top-level PlanID
        resource_id:
          type: string
          description: '-> usageEvent''s resourceId; the Azure SaaS subscription id'
    GCPMarketplaceAgreement:
      required:
        - account_id
        - metric_name
        - service_name
        - usage_reporting_id
      type: object
      properties:
        account_id:
          type: string
          description: writes the customer mapping; not read in the report payload
        metric_name:
          type: string
          description: '-> services.report''s metricName (always "{service_name}/usage_fee")'
        service_name:
          type: string
          description: '-> services.report URL''s service_name; identifies the product'
        usage_reporting_id:
          type: string
          description: '-> services.report''s consumerId; identifies the buyer'
    types.SecretProvider:
      type: string
      enum:
        - flexprice
        - stripe
        - s3
        - hubspot
        - razorpay
        - chargebee
        - quickbooks
        - zoho_books
        - nomod
        - moyasar
        - paddle
        - whop
        - tabs
        - aws_marketplace
        - gcp_marketplace
        - azure_marketplace
      x-enum-comments:
        SecretProviderS3: supports multiple connections per environment
      x-enum-varnames:
        - SecretProviderFlexPrice
        - SecretProviderStripe
        - SecretProviderS3
        - SecretProviderHubSpot
        - SecretProviderRazorpay
        - SecretProviderChargebee
        - SecretProviderQuickBooks
        - SecretProviderZohoBooks
        - SecretProviderNomod
        - SecretProviderMoyasar
        - SecretProviderPaddle
        - SecretProviderWhop
        - SecretProviderTabs
        - SecretProviderAWSMarketplace
        - SecretProviderGCPMarketplace
        - SecretProviderAzureMarketplace
      x-speakeasy-name-override: SecretProvider

````