{"openapi":"3.1.0","info":{"title":"DreamozTech Headless API","version":"1.0.0","description":"Build your own front end on DreamozTech. Exchange your API key/secret for a 1-hour bearer token (scoped to one web app), then read pages/products, submit contact messages, take payments through your connected gateway and look up order status. Prices are always computed server-side. All amounts are AUD."},"servers":[{"url":"https://dreamoztech.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}}},"Image":{"type":"object","properties":{"id":{"type":"integer"},"alt":{"type":"string"},"orderNo":{"type":"integer"},"url":{"type":"string"}}},"Product":{"type":"object","properties":{"enabled":{"type":"boolean"},"price":{"type":["number","null"]},"minQty":{"type":["integer","null"]},"maxQty":{"type":["integer","null"]},"shippingPrice":{"type":["number","null"]},"weight":{"type":["number","null"]}}},"Page":{"type":"object","properties":{"id":{"type":"integer"},"parentId":{"type":["integer","null"]},"orderNo":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","description":"HTML content"},"seoDescription":{"type":"string"},"keywords":{"type":"string"},"enabled":{"type":"boolean"},"embedCode":{"type":"string"},"hyperlink":{"type":"string"},"contactEnabled":{"type":"boolean"},"product":{"$ref":"#/components/schemas/Product"},"images":{"type":"array","items":{"$ref":"#/components/schemas/Image"}},"children":{"type":"array","items":{"$ref":"#/components/schemas/Page"}}}},"WebApp":{"type":"object","properties":{"webApp":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"link":{"type":"string"},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"settings":{"type":"object","properties":{"country":{"type":"string"},"logo":{"type":"string"},"favicon":{"type":"string"},"pickupEnabled":{"type":"boolean"},"pickupInstructions":{"type":["string","null"]}}},"shippingRates":{"type":"object","properties":{"byQuantity":{"type":"array","items":{"type":"object"}},"byAmount":{"type":"array","items":{"type":"object"}}}},"pages":{"type":"array","items":{"$ref":"#/components/schemas/Page"}}}},"Attachment":{"type":["object","null"],"properties":{"name":{"type":"string"},"mime":{"type":"string","enum":["application/pdf","image/png","image/jpeg","image/webp","image/gif"]},"data":{"type":"string","description":"Base64, max 1.5MB"}}}}},"paths":{"/api/public/wa/token":{"post":{"summary":"Exchange API key/secret for a bearer token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey","apiSecret"],"properties":{"apiKey":{"type":"string"},"apiSecret":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tokenType":{"type":"string","const":"Bearer"},"expiresIn":{"type":"integer"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/webapp":{"get":{"summary":"Web app, settings, shipping rates and page/product tree","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebApp"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/contacts":{"get":{"summary":"List contact messages","security":[{"bearerAuth":[]}],"parameters":[{"name":"pageId","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer","default":100}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Submit a contact message to a page with contactEnabled=true","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pageId","name","email","message"],"properties":{"pageId":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"message":{"type":"string"},"attachment1":{"$ref":"#/components/schemas/Attachment"},"attachment2":{"$ref":"#/components/schemas/Attachment"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"integer"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/store/payment-config":{"get":{"summary":"Public payment-form settings for your connected gateway","description":"Load the card SDK matching `provider`, tokenize the card in the browser, then send the single-use token as `sourceId` to checkout.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"applicationId":{"type":"string"},"clientId":{"type":"string"},"locationId":{"type":"string"},"mode":{"type":"string"},"currency":{"type":"string","const":"AUD"}}}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/checkout/pay":{"post":{"summary":"Charge an order (prices taken from your catalogue)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sourceId","items","buyer"],"properties":{"sourceId":{"type":"string"},"deliveryMethod":{"type":"string","enum":["delivery","pickup"],"default":"delivery"},"couponCode":{"type":"string","maxLength":32},"items":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","required":["pageId","qty"],"properties":{"pageId":{"type":"integer"},"qty":{"type":"integer","minimum":1,"maximum":999}}}},"buyer":{"type":"object","required":["name","email","phone","address","city","postcode"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"postcode":{"type":"string","pattern":"^\\d{4}$"}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"orderNo":{"type":"string"},"paymentId":{"type":"string"},"receiptUrl":{"type":["string","null"]},"amount":{"type":"number"},"currency":{"type":"string"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/orders/status":{"get":{"summary":"Order status and tracking (buyer email must match)","security":[{"bearerAuth":[]}],"parameters":[{"name":"orderNo","in":"query","required":true,"schema":{"type":"string"}},{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/ai/credits":{"get":{"summary":"AI Builder credit balance (AI Pro)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/ai/history":{"get":{"summary":"AI Builder history, newest first","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":20}},{"name":"page","in":"query","schema":{"type":"integer","default":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/ai/chat":{"post":{"summary":"Ask the AI Builder (1 credit; returns proposals only, nothing is saved)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string"},"history":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/wa/ai/apply":{"post":{"summary":"Save an AI Builder proposal (send the pages array from /ai/chat unchanged; pages save hidden for review, charts/tables/maps included; no credit used)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pages"],"properties":{"pages":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}