{
 "openapi": "3.1.0",
 "info": {
  "title": "Nick Lawson Art shop",
  "version": "1.0",
  "description": "Public shop API: browse designs, price a cart, turn a photo into pencil art, request a custom quote. Payment is completed by the customer on the website."
 },
 "servers": [
  {
   "url": "https://nicklawsonart.azsunvalleysales.com"
  }
 ],
 "paths": {
  "/shop/catalog.json": {
   "get": {
    "operationId": "listDesigns",
    "summary": "Every design with products, options, prices and links",
    "responses": {
     "200": {
      "description": "Catalog"
     }
    }
   }
  },
  "/api/pod/catalog": {
   "get": {
    "operationId": "liveCatalog",
    "summary": "Live products and per-design availability",
    "responses": {
     "200": {
      "description": "Catalog"
     }
    }
   }
  },
  "/api/pod/price": {
   "post": {
    "operationId": "priceCart",
    "summary": "Exact cart total with shipping and US sales tax",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "items"
        ],
        "properties": {
         "items": {
          "type": "array",
          "items": {
           "type": "object",
           "required": [
            "art",
            "product",
            "variant"
           ],
           "properties": {
            "art": {
             "type": "string"
            },
            "product": {
             "type": "string"
            },
            "variant": {
             "type": "integer"
            },
            "qty": {
             "type": "integer"
            },
            "size": {
             "type": "string"
            },
            "color": {
             "type": "string"
            },
            "personalize": {
             "type": "string",
             "maxLength": 40
            },
            "k": {
             "type": "string",
             "description": "key from /api/pod/upload, for custom-photo items"
            }
           }
          }
         },
         "state": {
          "type": "string",
          "description": "2-letter US state"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Lines and totals"
     }
    }
   }
  },
  "/api/pod/upload": {
   "post": {
    "operationId": "photoToPencilArt",
    "summary": "Turn a customer's photo into pencil art and get a preview + buy link",
    "parameters": [
     {
      "name": "style",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "pencil",
        "pencil-full",
        "photo"
       ]
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "image_url"
        ],
        "properties": {
         "image_url": {
          "type": "string",
          "format": "uri"
         },
         "style": {
          "type": "string"
         }
        }
       }
      },
      "image/jpeg": {
       "schema": {
        "type": "string",
        "format": "binary"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "id, key, img, mug, avail, page (link for the customer)"
     }
    }
   },
   "get": {
    "operationId": "getPhotoPreview",
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "k",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Preview"
     }
    }
   }
  },
  "/api/pod/agent-checkout": {
   "post": {
    "operationId": "agentCheckout",
    "summary": "Create an order and get a checkout link for the customer: Stripe-hosted (card, Apple Pay, Google Pay) or PayPal (payment: paypal). No card data or logins are sent to us",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "items",
         "contact",
         "address",
         "agree"
        ],
        "properties": {
         "items": {
          "type": "array",
          "items": {
           "type": "object",
           "required": [
            "art",
            "product",
            "variant"
           ]
          }
         },
         "contact": {
          "type": "object",
          "required": [
           "name",
           "email"
          ],
          "properties": {
           "name": {
            "type": "string"
           },
           "email": {
            "type": "string"
           },
           "phone": {
            "type": "string"
           }
          }
         },
         "address": {
          "type": "object",
          "required": [
           "line1",
           "city",
           "state",
           "zip"
          ]
         },
         "gift": {
          "type": "boolean"
         },
         "giftMessage": {
          "type": "string"
         },
         "agree": {
          "type": "boolean",
          "description": "customer accepts the made-to-order terms"
         },
         "agent": {
          "type": "string"
         },
         "payment": {
          "type": "string",
          "enum": [
           "card",
           "paypal"
          ],
          "default": "card",
          "description": "card = Stripe-hosted checkout; paypal = PayPal approve link (paypal-direct 2026-11-23)"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "id, checkout_url (PayPal approve link when payment=paypal), totals, status_url"
     }
    }
   }
  },
  "/api/pod/quote-request": {
   "post": {
    "operationId": "requestCustomQuote",
    "summary": "Ask for anything custom; we email the person a quote with a pay link",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "email",
         "details"
        ],
        "properties": {
         "name": {
          "type": "string"
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "phone": {
          "type": "string"
         },
         "product": {
          "type": "string",
          "default": "custom"
         },
         "art": {
          "type": "string"
         },
         "qty": {
          "type": "integer"
         },
         "details": {
          "type": "string"
         },
         "neededBy": {
          "type": "string"
         },
         "state": {
          "type": "string"
         },
         "zip": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Request id"
     }
    }
   }
  }
 }
}