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

# Get the checkout link for a quote

> Returns the Emailx page where an owner or admin pays for the quote. The API never charges anything.

Permission: `infrastructure:purchase`

[Read the recovery rules](https://docs.emailx.ai/en/api-reference/idempotency.md) before retrying a write. Keep the same key and body for the same logical operation.


## OpenAPI

````yaml openapi/emailx.en.json POST /workspaces/{workspace_id}/infrastructure/checkouts
openapi: 3.0.3
info:
  title: Emailx API
  version: 1.0.0-beta
  description: >-
    Customer and agency integrations for Emailx. Beta access is operator-issued.
    The v1 beta supports bounded People CSV/XLSX imports, saved email-template
    settings, selected email generation with explicit AI-credit confirmation,
    exact-message approval, reviewed email activation for native scheduled
    sending, and explicitly confirmed inbox replies bound to saved context when
    host capabilities permit. Inbox context is bounded and may be incomplete or
    stale; no provider refresh occurs. Manual LinkedIn imports, reviewed
    activation and reviewed resume of paused campaigns are separate gated
    workflows. Reply drafts, knowledge, team, infrastructure quotes with hosted
    checkout and agency administration are covered by separate scopes. Signed
    webhooks report durable operation outcomes. It does not support immediate
    batches or direct card charges.
servers:
  - url: https://app.emailx.ai/api/v1
    description: Emailx application · access must be enabled
security: []
tags:
  - name: Getting started
  - name: Workspaces
  - name: Contacts
  - name: Templates
  - name: Campaigns
  - name: Inbox
  - name: Senders
  - name: Team
  - name: Analytics
  - name: Imports
  - name: Operations
  - name: Knowledge
  - name: Infrastructure
  - name: Agency
paths:
  /workspaces/{workspace_id}/infrastructure/checkouts:
    post:
      tags:
        - Domains and mailboxes
      summary: Get the checkout link for a quote
      description: >-
        Returns the Emailx page where an owner or admin pays for the quote. The
        API never charges anything.


        Permission: `infrastructure:purchase`
      operationId: create_api_checkout
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
          description: Emailx workspace (Clients) ID, not the agency workspace link ID.
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_.:/-]+$
          description: Unique per logical mutation. Same path and body replay for 24 hours.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckout'
            example:
              quote_token: quo_COPY_THE_QUOTE_TOKEN
              confirm_purchase_intent: true
      responses:
        '201':
          description: Created
          headers:
            X-Request-Id:
              schema:
                type: string
            Emailx-Api-Version:
              schema:
                type: string
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Reset:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CheckoutHandoff'
                required:
                  - data
              example:
                data:
                  checkout_url: https://app.emailx.ai/mailboxes/domain-search/pre-warmed
                  quote:
                    offer: prewarmed_domains
                    quantity: 2
                    currency: eur
                    lines: []
                    due_today_before_tax: 66
                    monthly_before_tax: 42
                    expires_at: '2026-11-01T09:30:00Z'
                  payment_collected_by: emailx_hosted_checkout
                  charged: false
                  order_created: false
                  requires_signed_in_person: true
                  next_step: >-
                    A signed-in owner or admin pays on the hosted page; then
                    read orders.
        '400':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope or write permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource missing or inaccessible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict, concurrent request or uncertain original result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
        '413':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited; respect Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
        '500':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: API disabled, request storage unavailable or feature not enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: cURL
          source: >-
            curl -X POST
            "https://app.emailx.ai/api/v1/workspaces/123/infrastructure/checkouts"
            \
              -H "Authorization: Bearer $EMAILX_API_KEY" \
              -H "Content-Type: application/json" \
              -H "Idempotency-Key: example-operation-001" \
              --data '{"quote_token":"quo_COPY_THE_QUOTE_TOKEN","confirm_purchase_intent":true}'
        - lang: Python
          source: |-
            import os, requests

            response = requests.post(
                "https://app.emailx.ai/api/v1/workspaces/123/infrastructure/checkouts",
                headers={"Authorization": "Bearer " + os.environ["EMAILX_API_KEY"], "Idempotency-Key": "example-operation-001"},
                json={'quote_token': 'quo_COPY_THE_QUOTE_TOKEN', 'confirm_purchase_intent': True},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          source: >-
            const response = await
            fetch("https://app.emailx.ai/api/v1/workspaces/123/infrastructure/checkouts",
            {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.EMAILX_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "example-operation-001" },
              body: JSON.stringify({"quote_token": "quo_COPY_THE_QUOTE_TOKEN", "confirm_purchase_intent": true}),
              signal: AbortSignal.timeout(30000),
            });

            if (!response.ok) throw new Error(`Emailx: ${response.status}`);

            console.log(await response.json());
components:
  schemas:
    CreateCheckout:
      type: object
      properties:
        quote_token:
          type: string
          pattern: ^quo_
          maxLength: 4096
        confirm_purchase_intent:
          type: boolean
          enum:
            - true
      required:
        - quote_token
        - confirm_purchase_intent
      additionalProperties: false
      description: >-
        Owner or admin only. Returns a hosted page; nothing is charged through
        the API.
    CheckoutHandoff:
      type: object
      properties:
        checkout_url:
          type: string
          format: uri
        quote:
          type: object
          properties:
            offer:
              type: string
              enum:
                - prewarmed_domains
                - mailboxes
            quantity:
              type: integer
              minimum: 1
            currency:
              type: string
              enum:
                - usd
                - eur
            lines:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  description:
                    type: string
                  quantity:
                    type: integer
                    minimum: 1
                  unit_amount:
                    type: number
                    minimum: 0
                  amount:
                    type: number
                    minimum: 0
                  recurrence:
                    type: string
                    enum:
                      - monthly
                      - one_time
                required:
                  - code
                  - description
                  - quantity
                  - unit_amount
                  - amount
                  - recurrence
            due_today_before_tax:
              type: number
              minimum: 0
            monthly_before_tax:
              type: number
              minimum: 0
            expires_at:
              type: string
              format: date-time
          required:
            - offer
            - quantity
            - currency
            - lines
            - due_today_before_tax
            - monthly_before_tax
            - expires_at
        payment_collected_by:
          type: string
          enum:
            - emailx_hosted_checkout
        charged:
          type: boolean
          enum:
            - false
        order_created:
          type: boolean
          enum:
            - false
        requires_signed_in_person:
          type: boolean
          enum:
            - true
        next_step:
          type: string
      required:
        - checkout_url
        - quote
        - payment_collected_by
        - charged
        - order_created
        - requires_signed_in_person
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
            - request_id
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        ex_test_ or ex_live_ key issued by an Emailx operator. Never use
        provider keys or session cookies.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.