TestWell Checkout API

The Checkout API from TestWell, for checkout.

GitHub OpenAPI

Operations 5

POST /api/agent/create_checkout Create a checkout session #
POST /api/agent/update_checkout Update a checkout session #
POST /api/agent/get_checkout Read a checkout session #
POST /api/agent/cancel_checkout Cancel a checkout session #
POST /api/agent/complete_checkout Pay and place the order #

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/test-well-com:test-well-com-checkout-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

test-well-com-checkout-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TestWell Agent Checkout API
  version: 1.2.0
  description: 'Cash-pay lab tests without insurance: search TestWell''s catalog, get all-in quotes by state (Quest, Labcorp, BioReference in NY/NJ), find draw sites by ZIP, look up physician-reviewed reference ranges, convert units, calculate free testosterone, compare providers and read guides. Read-only; purchases complete on test-well.com.


    Pricing rule: sticker prices plus one flat $6.00 lab processing fee per order. All endpoints are public, read-only and rate limited (120 requests/minute/IP).'
  contact:
    name: TestWell
    url: https://www.test-well.com/developers
    email: support@test-well.com
  termsOfService: https://www.test-well.com/terms
servers:
- url: https://www.test-well.com
tags:
- name: Checkout
paths:
  /api/agent/create_checkout:
    post:
      operationId: create_checkout
      summary: Create a checkout session
      description: 'Start a TestWell order for the user: tests/panels, the US state where they will visit the lab (required for pricing and lab routing), and the buyer''s name, email and phone.'
      tags:
      - Checkout
      x-openai-isConsequential: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  minItems: 1
                  maxItems: 25
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 120
                        description: Test or panel slug/id
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 1
                    required:
                    - id
                state:
                  description: US state code or name where the blood will be drawn
                  type: string
                  minLength: 2
                  maxLength: 40
                buyer:
                  type: object
                  properties:
                    first_name:
                      type: string
                      maxLength: 80
                    last_name:
                      type: string
                      maxLength: 80
                    email:
                      type: string
                      format: email
                      pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                    phone_number:
                      type: string
                      maxLength: 20
                dry_run:
                  description: Price only; do not create a session
                  type: boolean
              required:
              - items
            examples:
              example1:
                summary: Preview pricing for two tests in Florida
                value:
                  items:
                  - id: tsh
                  - id: vitamin-d
                  state: FL
                  dry_run: true
              example2:
                summary: Create a session ready for payment
                value:
                  items:
                  - id: general-wellness-panel
                  state: TX
                  buyer:
                    first_name: Ana
                    last_name: Ruiz
                    email: ana@example.com
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - create_checkout
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                        enum:
                        - not_ready_for_payment
                        - ready_for_payment
                        - in_progress
                        - completed
                        - canceled
                      currency:
                        type: string
                        const: usd
                      line_items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            item:
                              type: object
                              properties:
                                id:
                                  type: string
                                quantity:
                                  type: number
                              required:
                              - id
                              - quantity
                              additionalProperties: false
                            base_amount:
                              type: number
                            subtotal:
                              type: number
                            total:
                              type: number
                            name:
                              type: string
                            lab:
                              type: string
                            url:
                              type: string
                          required:
                          - id
                          - item
                          - base_amount
                          - subtotal
                          - total
                          additionalProperties: {}
                      totals:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            display_text:
                              type: string
                            amount:
                              type: number
                          required:
                          - type
                          - display_text
                          - amount
                          additionalProperties: false
                      messages:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                              - info
                              - error
                            content:
                              type: string
                            param:
                              type: string
                          required:
                          - type
                          - content
                          additionalProperties: {}
                      fulfillment_options:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              const: digital
                            id:
                              type: string
                            title:
                              type: string
                          required:
                          - type
                          - id
                          - title
                          additionalProperties: {}
                      links:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            url:
                              type: string
                          required:
                          - type
                          - url
                          additionalProperties: false
                      pay_online_url:
                        description: Prefilled cart for browser payment when the platform has no payment token
                        anyOf:
                        - type: string
                        - type: 'null'
                      order:
                        type: object
                        properties:
                          id:
                            type: string
                          checkout_session_id:
                            type: string
                          permalink_url:
                            type: string
                        required:
                        - id
                        - checkout_session_id
                        - permalink_url
                        additionalProperties: false
                      dry_run:
                        type: boolean
                    required:
                    - id
                    - status
                    - currency
                    - line_items
                    - totals
                    - messages
                    - fulfillment_options
                    - links
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/update_checkout:
    post:
      operationId: update_checkout
      summary: Update a checkout session
      description: Change items, state or buyer details on an open checkout session and get it re-priced. Returns the same session object as create_checkout.
      tags:
      - Checkout
      x-openai-isConsequential: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                checkout_session_id:
                  type: string
                  minLength: 8
                  maxLength: 80
                items:
                  minItems: 1
                  maxItems: 25
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 120
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 1
                    required:
                    - id
                state:
                  type: string
                  minLength: 2
                  maxLength: 40
                buyer:
                  type: object
                  properties:
                    first_name:
                      type: string
                      maxLength: 80
                    last_name:
                      type: string
                      maxLength: 80
                    email:
                      type: string
                      format: email
                      pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                    phone_number:
                      type: string
                      maxLength: 20
              required:
              - checkout_session_id
            examples:
              example1:
                summary: Re-route to BioReference pricing for New York
                value:
                  checkout_session_id: cs_agent_…
                  state: NY
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - update_checkout
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                      line_items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            total:
                              type: number
                          required:
                          - id
                          - total
                          additionalProperties: {}
                      totals:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            display_text:
                              type: string
                            amount:
                              type: number
                          required:
                          - type
                          - display_text
                          - amount
                          additionalProperties: false
                      messages:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                              - info
                              - error
                            content:
                              type: string
                          required:
                          - type
                          - content
                          additionalProperties: {}
                    required:
                    - id
                    - status
                    - line_items
                    - totals
                    - messages
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/get_checkout:
    post:
      operationId: get_checkout
      summary: Read a checkout session
      description: Current state of a checkout session (status, line items, totals, messages, order once paid). Read-only.
      tags:
      - Checkout
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                checkout_session_id:
                  type: string
                  minLength: 8
                  maxLength: 80
              required:
              - checkout_session_id
            examples:
              example1:
                summary: Poll a session
                value:
                  checkout_session_id: cs_agent_…
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - get_checkout
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                      line_items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            total:
                              type: number
                          required:
                          - id
                          - total
                          additionalProperties: {}
                      totals:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            display_text:
                              type: string
                            amount:
                              type: number
                          required:
                          - type
                          - display_text
                          - amount
                          additionalProperties: false
                      messages:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                              - info
                              - error
                            content:
                              type: string
                          required:
                          - type
                          - content
                          additionalProperties: {}
                    required:
                    - id
                    - status
                    - line_items
                    - totals
                    - messages
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/cancel_checkout:
    post:
      operationId: cancel_checkout
      summary: Cancel a checkout session
      description: Cancel an open (unpaid) checkout session. Paid sessions cannot be canceled here — the patient's complete-details email explains refunds.
      tags:
      - Checkout
      x-openai-isConsequential: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                checkout_session_id:
                  type: string
                  minLength: 8
                  maxLength: 80
              required:
              - checkout_session_id
            examples:
              example1:
                summary: User changed their mind
                value:
                  checkout_session_id: cs_agent_…
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - cancel_checkout
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                    required:
                    - id
                    - status
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/complete_checkout:
    post:
      operationId: complete_checkout
      summary: Pay and place the order
      description: 'Charge the payment credential the platform obtained for a session that is ready_for_payment and create the order. Input follows the ChatGPT payment-sheet contract: checkout_session_id, buyer, payment_data { token, provider: ''stripe'', billing_address }.'
      tags:
      - Checkout
      x-openai-isConsequential: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                checkout_session_id:
                  type: string
                  minLength: 8
                  maxLength: 80
                buyer:
                  anyOf:
                  - type: object
                    properties:
                      name:
                        anyOf:
                        - type: string
                          maxLength: 160
                        - type: 'null'
                      first_name:
                        anyOf:
                        - type: string
                          maxLength: 80
                        - type: 'null'
                      last_name:
                        anyOf:
                        - type: string
                          maxLength: 80
                        - type: 'null'
                      email:
                        anyOf:
                        - type: string
                          format: email
                          pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        - type: 'null'
                      phone_number:
                        anyOf:
                        - type: string
                          maxLength: 20
                        - type: 'null'
                  - type: 'null'
                payment_data:
                  type: object
                  properties:
                    token:
                      type: string
                      minLength: 4
                      maxLength: 400
                    provider:
                      description: '''stripe'''
                      type: string
                      maxLength: 40
                    billing_address:
                      anyOf:
                      - type: object
                        properties:
                          name:
                            type: string
                          line_one:
                            type: string
                          line_two:
                            type: string
                          city:
                            type: string
                          state:
                            type: string
                          country:
                            type: string
                          postal_code:
                            type: string
                      - type: 'null'
                  required:
                  - token
                idempotency_key:
                  type: string
                  maxLength: 128
              required:
              - checkout_session_id
              - payment_data
            examples:
              example1:
                summary: Complete with a shared payment token
                value:
                  checkout_session_id: cs_agent_…
                  buyer:
                    first_name: Ana
                    last_name: Ruiz
                    email: ana@example.com
                  payment_data:
                    token: spt_…
                    provider: stripe
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - complete_checkout
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                      totals:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            display_text:
                              type: string
                            amount:
                              type: number
                          required:
                          - type
                          - display_text
                          - amount
                          additionalProperties: false
                      messages:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                              - info
                              - error
                            content:
                              type: string
                          required:
                          - type
                          - content
                          additionalProperties: {}
                      order:
                        type: object
                        properties:
                          id:
                            type: string
                          checkout_session_id:
                            type: string
                          permalink_url:
                            type: string
                        required:
                        - id
                        - checkout_session_id
                        - permalink_url
                        additionalProperties: false
                    required:
                    - id
                    - status
                    - totals
                    - messages
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
components:
  schemas:
    ToolError:
      type: object
      properties:
        error:
          type: string
        issues:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
      - error
externalDocs:
  url: https://www.test-well.com/developers
  description: Developer documentation
x-mcp:
  url: https://www.test-well.com/mcp
  serverCard: https://www.test-well.com/.well-known/mcp/server-card.json