MultiMail Billing API

The Billing API from MultiMail — 8 operation(s) for billing.

GitHub OpenAPI

Operations 8

POST /v1/billing/checkout Create a first Stripe subscription checkout for an existing account #
POST /v1/billing/crypto-checkout Create a Coinbase Commerce checkout (crypto payment) #
POST /v1/billing/stripe-webhook Stripe webhook handler (public, signature-verified) #
POST /v1/billing/pricing-checkout Create account + Stripe checkout in one step (public, no auth) #
GET /v1/billing/session-key Retrieve one-time API key after pricing-page checkout #
POST /v1/billing/coinbase-webhook Coinbase Commerce webhook handler (public, signature-verified) #
POST /v1/billing/cancel Cancel subscription at end of billing period #
POST /v1/billing/portal Create a Stripe customer portal session #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/multimail-dev:multimail-dev-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

multimail-dev-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MultiMail Billing API
  version: 2.0.0
  description: Email-as-a-Service for AI agents. Inbound email converted to markdown, outbound markdown converted to HTML. Built on Cloudflare Workers.
servers:
- url: https://api.multimail.dev
tags:
- name: Billing
paths:
  /v1/billing/checkout:
    post:
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          minLength: 1
          maxLength: 200
        description: Stable random key for retries of one unchanged checkout intent. Do not include personal data. Provider comparison rejects changed parameters for the same key.
      - name: X-MultiMail-Approval-Code
        in: header
        required: false
        schema:
          type: string
        description: Operator-delivered single-use proof for the exact request. Without proof, HTTP 202 requests operator approval and does not complete the operation. Confirmation booleans and MCP UI hints cannot grant authority.
      summary: Create a first Stripe subscription checkout for an existing account
      description: Requires admin scope and request-bound operator approval. Accounts with an existing Stripe subscription receive 409 SUBSCRIPTION_EXISTS and must explicitly use /v1/billing/portal instead. The operator must review and complete payment. A stable optional Idempotency-Key is scoped to the tenant and forwarded to Stripe so retries of the same intent reuse provider results.
      security:
      - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - plan
              properties:
                plan:
                  type: string
                  enum:
                  - builder
                  - pro
                  - scale
                interval:
                  type: string
                  enum:
                  - monthly
                  - annual
                  default: monthly
                success_url:
                  type: string
                  format: uri
                cancel_url:
                  type: string
                  format: uri
      responses:
        '200':
          description: Checkout session
          content:
            application/json:
              schema:
                type: object
                properties:
                  checkout_url:
                    type: string
                  session_id:
                    type: string
        '202':
          description: Operator approval requested; operation not completed
        '409':
          description: 'Existing subscription: explicitly open the billing portal'
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                    - SUBSCRIPTION_EXISTS
                  error:
                    type: string
      tags:
      - Billing
      operationId: postV1BillingCheckout
      x-operation-id-source: derived
  /v1/billing/crypto-checkout:
    post:
      parameters:
      - name: X-MultiMail-Approval-Code
        in: header
        required: false
        schema:
          type: string
        description: Operator-delivered single-use proof for the exact request. Without proof, HTTP 202 requests operator approval and does not complete the operation. Confirmation booleans and MCP UI hints cannot grant authority.
      summary: Create a Coinbase Commerce checkout (crypto payment)
      description: Requires admin scope. One-time charge. Sensitive changes require a request-bound operator code; API-key scope alone does not authorize them.
      security:
      - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - plan
              properties:
                plan:
                  type: string
                  enum:
                  - builder
                  - pro
                  - scale
      responses:
        '200':
          description: Checkout created
          content:
            application/json:
              schema:
                type: object
                properties:
                  checkout_url:
                    type: string
                  charge_id:
                    type: string
        '202':
          description: Operator approval requested; operation not completed
      tags:
      - Billing
      operationId: postV1BillingCryptoCheckout
      x-operation-id-source: derived
  /v1/billing/stripe-webhook:
    post:
      summary: Stripe webhook handler (public, signature-verified)
      tags:
      - Billing
      operationId: postV1BillingStripeWebhook
      x-operation-id-source: derived
  /v1/billing/pricing-checkout:
    post:
      summary: Create account + Stripe checkout in one step (public, no auth)
      description: Creates an inactive tenant, provisions a default mailbox, and returns a Stripe checkout URL. After payment, call GET /v1/billing/session-key to retrieve the API key. Honors an optional Idempotency-Key request header (UUID); the same key is forwarded to Stripe so duplicate Sessions are not created on retry.
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 200
        description: Client-generated UUID. Cached for 1hr in our KV; also forwarded to Stripe (24hr server-side dedupe window).
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PricingCheckoutRequest'
      responses:
        '200':
          description: Checkout session
          content:
            application/json:
              schema:
                type: object
                properties:
                  checkout_url:
                    type: string
                    format: uri
        '400':
          description: Validation error
        '409':
          description: Operator name taken or concurrent Idempotency-Key in flight
      tags:
      - Billing
      operationId: postV1BillingPricingCheckout
      x-operation-id-source: derived
  /v1/billing/session-key:
    get:
      summary: Retrieve one-time API key after pricing-page checkout
      description: Public endpoint. Returns the API key stored during pricing-checkout, then deletes it. Key expires after 1 hour if not retrieved.
      parameters:
      - name: session_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API key + onboarding data
          content:
            application/json:
              schema:
                type: object
                properties:
                  api_key:
                    type: string
                  mailbox_id:
                    type:
                    - string
                    - 'null'
                  mailbox_address:
                    type:
                    - string
                    - 'null'
                  oversight_mode:
                    type: string
                  org_name:
                    type:
                    - string
                    - 'null'
                  oversight_email:
                    type:
                    - string
                    - 'null'
        '404':
          description: Session not found or expired
      tags:
      - Billing
      operationId: getV1BillingSessionKey
      x-operation-id-source: derived
  /v1/billing/coinbase-webhook:
    post:
      summary: Coinbase Commerce webhook handler (public, signature-verified)
      tags:
      - Billing
      operationId: postV1BillingCoinbaseWebhook
      x-operation-id-source: derived
  /v1/billing/cancel:
    post:
      parameters:
      - name: X-MultiMail-Approval-Code
        in: header
        required: false
        schema:
          type: string
        description: Operator-delivered single-use proof for the exact request. Without proof, HTTP 202 requests operator approval and does not complete the operation. Confirmation booleans and MCP UI hints cannot grant authority.
      summary: Cancel subscription at end of billing period
      description: Requires admin scope. Sets cancel_at_period_end on the Stripe subscription so the tenant retains access until the current billing period ends. Sensitive changes require a request-bound operator code; API-key scope alone does not authorize them.
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Cancellation scheduled
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: cancelling
                  cancel_at_period_end:
                    type: boolean
                  access_until:
                    type: string
                    format: date-time
        '202':
          description: Operator approval requested; operation not completed
        '400':
          description: No active subscription
      tags:
      - Billing
      operationId: postV1BillingCancel
      x-operation-id-source: derived
  /v1/billing/portal:
    post:
      parameters:
      - name: X-MultiMail-Approval-Code
        in: header
        required: false
        schema:
          type: string
        description: Operator-delivered single-use proof for the exact request. Without proof, HTTP 202 requests operator approval and does not complete the operation. Confirmation booleans and MCP UI hints cannot grant authority.
      summary: Create a Stripe customer portal session
      description: Requires admin scope. Returns a URL to the Stripe-hosted billing portal for self-service invoice, payment method, and plan management. Sensitive changes require a request-bound operator code; API-key scope alone does not authorize them.
      security:
      - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  type: string
                  format: uri
      responses:
        '200':
          description: Portal session
          content:
            application/json:
              schema:
                type: object
                properties:
                  portal_url:
                    type: string
                    format: uri
        '202':
          description: Operator approval requested; operation not completed
        '400':
          description: No Stripe customer on file
      tags:
      - Billing
      operationId: postV1BillingPortal
      x-operation-id-source: derived
components:
  schemas:
    AttributionVisit:
      type: object
      description: A single landing event — first or last touch.
      additionalProperties: false
      properties:
        ts:
          type: integer
          format: int64
          description: Epoch milliseconds at landing.
        landing_path:
          type: string
          maxLength: 256
          description: Pathname of the landing page (no host).
        params:
          type: object
          description: Tracked URL params present on the landing page. All keys optional; unknown keys are dropped server-side. additionalProperties:false enforces the allowlist at the schema layer too (adversary review iter1 ATTR-1).
          additionalProperties: false
          properties:
            utm_source:
              type: string
              maxLength: 256
            utm_medium:
              type: string
              maxLength: 256
            utm_campaign:
              type: string
              maxLength: 256
            utm_content:
              type: string
              maxLength: 256
            utm_term:
              type: string
              maxLength: 256
            gclid:
              type: string
              maxLength: 256
            fbclid:
              type: string
              maxLength: 256
            msclkid:
              type: string
              maxLength: 256
    AttributionPayload:
      type: object
      description: 'Optional client-captured conversion attribution (Phase 2 of plan 2026-04-27-003). The browser persists this in localStorage.mm_attribution_v1 and forwards it on signup. Server-side validator at src/lib/attribution.ts is the source of truth — bad shapes are silently dropped, NEVER reject the signup. additionalProperties:false on this object AND its sub-objects keeps the API Shield body-size cap honest even if the per-operation mitigation pin in scripts/sync-api-shield.sh is ever undone: an attacker cannot pad the body with arbitrary unknown keys to bypass the per-field maxLengths (adversary review iter1 finding ATTR-1).'
      additionalProperties: false
      properties:
        first:
          $ref: '#/components/schemas/AttributionVisit'
        last:
          $ref: '#/components/schemas/AttributionVisit'
        visits:
          type: integer
          format: int32
          minimum: 1
          maximum: 1000000
          description: Visit counter, incremented client-side. Server validator coerces missing/zero/negative values to 1.
        version:
          type: integer
          format: int32
          enum:
          - 1
          description: Schema version. Only 1 is currently accepted; future bumps will rotate the localStorage key client-side and add new branches server-side.
    PricingCheckoutRequest:
      type: object
      description: 'Paid signup + Stripe checkout body for POST /v1/billing/pricing-checkout. Named (rather than inline) so scripts/verify-api-shield-sync.sh can confirm the Turnstile maxLength cap, mirroring SignupRequest (see lesson #18).'
      required:
      - operator_name
      - oversight_email
      - plan
      - accepted_tos
      - accepted_operator_agreement
      - accepted_anti_spam_policy
      properties:
        operator_name:
          type: string
        oversight_email:
          type: string
          format: email
        plan:
          type: string
          enum:
          - builder
          - pro
          - scale
        interval:
          type: string
          enum:
          - monthly
          - annual
          default: monthly
        accepted_tos:
          type: boolean
        accepted_operator_agreement:
          type: boolean
        accepted_anti_spam_policy:
          type: boolean
        cf_challenge_response:
          type: string
          maxLength: 4096
          description: 'Preferred browser Turnstile token field (mirrors SignupRequest). Not read by this endpoint — Stripe handles fraud on paid checkout — but declared so API Shield''s body-size cap stays above the ~1.6KB token if a browser sends one (see lesson #18).'
        turnstile_token:
          type: string
          maxLength: 4096
          deprecated: true
          description: 'Legacy Turnstile token field. maxLength keeps API Shield''s auto-learned body-size cap above the ~1.6KB token (see lesson #18).'
        use_case:
          type: string
        oversight_mode:
          type: string
          enum:
          - gated_all
          - gated_send
          - monitored
        attribution:
          $ref: '#/components/schemas/AttributionPayload'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key (mm_live_...). Keys have scopes: read (list/read emails, mailboxes, contacts), send (send/reply/cancel emails), admin (manage mailboxes, API keys, billing, account), oversight (approve/reject pending emails).'