{
  "openapi": "3.1.0",
  "info": {
    "title": "Omni Market orders",
    "version": "1.0.0",
    "description": "Order Omni Market's dropshipped desk tech, electronics, coffee gear, EDC hardware, and custom-printed goods and pay in USDC, over x402 version 2 or the Machine Payments Protocol (method evm). Quote first with get_quote on the MCP server https://www.hazenstudio.com/omnimarket/mcp: the price depends on the product, quantity and destination, and the 402 answer states it.",
    "contact": { "email": "contact@hazenstudio.com" }
  },
  "servers": [{ "url": "https://www.hazenstudio.com" }],
  "x-service-info": {
    "categories": ["shopping"],
    "docs": {
      "homepage": "https://www.hazenstudio.com/omnimarket/",
      "apiReference": "https://www.hazenstudio.com/omnimarket/agents/",
      "llms": "https://www.hazenstudio.com/omnimarket/llms.txt"
    }
  },
  "paths": {
    "/omnimarket/api/x402/order": {
      "post": {
        "operationId": "createOrder",
        "summary": "Order and pay in USDC",
        "description": "Without payment it answers 402 with the price twice: PAYMENT-REQUIRED (x402) and WWW-Authenticate: Payment (MPP, method evm, intent charge, credential type authorization, the EIP-3009 signature). Send the same request again with PAYMENT-SIGNATURE or Authorization: Payment. The order is placed once the payment settles.",
        "x-payment-info": {
          "intent": "charge",
          "method": "evm",
          "amount": null,
          "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "description": "USDC on Base. The amount depends on the order: the 402 challenge states it."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["product", "country", "email", "shipping"],
                "properties": {
                  "product": { "type": "string", "description": "Product id, from search_products or llms.txt." },
                  "quantity": { "type": "integer", "minimum": 1, "maximum": 5, "default": 1, "description": "Every item gets the same text." },
                  "country": { "type": "string", "pattern": "^[A-Za-z]{2}$", "description": "Destination country, ISO 3166-1 alpha-2." },
                  "personalisation": {
                    "type": "object",
                    "additionalProperties": { "type": "string" },
                    "description": "Text to print, keyed by the product's personalisation fields (get_product)."
                  },
                  "competitor_price": {
                    "anyOf": [{ "type": "number" }, { "type": "string" }],
                    "description": "Optional price match: the lowest delivered price in USD found for a comparable item."
                  },
                  "email": { "type": "string", "format": "email", "description": "For the confirmation." },
                  "shipping": {
                    "type": "object",
                    "required": ["name", "line1", "city"],
                    "properties": {
                      "name": { "type": "string", "maxLength": 100 },
                      "line1": { "type": "string", "maxLength": 200 },
                      "line2": { "type": "string", "maxLength": 200 },
                      "city": { "type": "string", "maxLength": 100 },
                      "postal_code": { "type": "string", "maxLength": 20 },
                      "state": { "type": "string", "maxLength": 100, "description": "Required for US, CA and AU." },
                      "phone": { "type": "string", "maxLength": 30 }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paid and placed. PAYMENT-RESPONSE (x402) or Payment-Receipt (MPP) carries the settlement.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "order_id": { "type": "string" },
                    "status": { "type": "string", "const": "paid" },
                    "total": { "type": "string" },
                    "delivery": { "type": "object" },
                    "transaction": { "type": "string" },
                    "order_page": { "type": "string", "format": "uri" }
                  }
                }
              }
            }
          },
          "400": { "description": "The order can't be made as sent; error says why." },
          "402": { "description": "Payment Required: the price, in PAYMENT-REQUIRED and WWW-Authenticate." },
          "413": { "description": "Request too large." },
          "502": { "description": "The facilitator gave no settlement answer, so the payment may have gone through. The order (order_id) is on hold until the chain is checked: don't pay again, follow it with get_order_status." },
          "503": { "description": "The shop isn't open yet, or USDC payments aren't set up. With status on_hold: the payment settled but the order couldn't be recorded; it is on hold, don't pay again." }
        }
      }
    }
  }
}
