{
  "openapi": "3.1.0",
  "info": {
    "title": "Your Event Hire agent quote API",
    "version": "1.0.0",
    "description": "Quote requests only. No payments, reservations or automatic quotations. Read https://youreventhire.uk/agents/. Obtain customer consent. Public catalogue updates within approximately 60 seconds. Example product must be checked against the live catalogue."
  },
  "servers": [
    {
      "url": "https://wastaff.com/api"
    }
  ],
  "paths": {
    "/website_catalogue.php": {
      "get": {
        "operationId": "getPublishedHireCatalogue",
        "summary": "Read published products, categories, prices and seat-pad choices",
        "responses": {
          "200": {
            "description": "Public catalogue. Price amounts are GBP ex VAT guide base rates, not daily rates or live availability.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "categoryIds": {
                            "type": "array",
                            "items": {
                              "type": "integer"
                            }
                          },
                          "price": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "amount": {
                                "type": "number"
                              },
                              "currency": {
                                "const": "GBP"
                              },
                              "tax": {
                                "type": "string"
                              },
                              "basis": {
                                "type": "string"
                              }
                            }
                          },
                          "seatPadRequired": {
                            "type": "boolean"
                          },
                          "seatPads": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer"
                                },
                                "productId": {
                                  "type": "integer"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "isDefault": {
                                  "type": "boolean"
                                },
                                "price": {
                                  "type": [
                                    "object",
                                    "null"
                                  ]
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent_quote.php": {
      "get": {
        "operationId": "getAgentQuoteCapabilities",
        "summary": "Read discovery links without preparing or submitting a request",
        "responses": {
          "200": {
            "description": "API guide and catalogue links"
          }
        }
      },
      "post": {
        "operationId": "prepareOrSubmitHireQuote",
        "summary": "Validate or submit a customer-authorized quote request",
        "description": "32 KiB maximum. Anonymous submit emails customer confirmation and returns 202. Approved partner bearer keys return 200 received. Never automatically resubmit with new keys. Browser callers use text/plain to avoid hosting preflight restrictions. Request bodies, email addresses and confirmation tokens must not be logged.",
        "security": [
          {},
          {
            "partnerBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requestKey",
                  "customer_authorized",
                  "terms_accepted",
                  "name",
                  "email",
                  "phone",
                  "occasion",
                  "fulfilment",
                  "hire_start",
                  "event_date",
                  "hire_end",
                  "items"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "validate",
                      "submit"
                    ],
                    "default": "submit"
                  },
                  "requestKey": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Lowercase UUID. Reuse unchanged for retries; retained for seven days."
                  },
                  "customer_authorized": {
                    "type": "boolean",
                    "const": true,
                    "description": "Customer explicitly permitted sharing their details and receiving confirmation email."
                  },
                  "terms_accepted": {
                    "type": "boolean",
                    "const": true,
                    "description": "Customer agreed to https://wacarrandson.co.uk/terms-and-conditions/."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 150
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254,
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "pattern": "^[+()0-9 .-]{7,40}$"
                  },
                  "occasion": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "fulfilment": {
                    "type": "string",
                    "enum": [
                      "delivery",
                      "collection"
                    ]
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "hire_start": {
                    "type": "string",
                    "format": "date",
                    "description": "UK calendar date: today through three years ahead."
                  },
                  "event_date": {
                    "type": "string",
                    "format": "date",
                    "description": "On or after hire_start."
                  },
                  "hire_end": {
                    "type": "string",
                    "format": "date",
                    "description": "On or after event_date."
                  },
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 40,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "quantity"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 999
                        },
                        "seatPadId": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Required when the product has seatPads. Use seatPads[].id, not productId."
                        }
                      }
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "fulfilment": {
                          "const": "delivery"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "address",
                        "city",
                        "postcode"
                      ]
                    }
                  }
                ]
              },
              "example": {
                "action": "validate",
                "requestKey": "12345678-1234-4234-8234-123456789abc",
                "customer_authorized": true,
                "terms_accepted": true,
                "name": "Customer-supplied name",
                "email": "customer@example.com",
                "phone": "01234567890",
                "occasion": "Customer-supplied occasion",
                "fulfilment": "collection",
                "hire_start": "2027-06-12",
                "event_date": "2027-06-12",
                "hire_end": "2027-06-13",
                "notes": "Replace all example details with customer-approved information.",
                "items": [
                  {
                    "id": 1042,
                    "quantity": 1
                  }
                ]
              }
            },
            "text/plain": {
              "schema": {
                "type": "object",
                "required": [
                  "requestKey",
                  "customer_authorized",
                  "terms_accepted",
                  "name",
                  "email",
                  "phone",
                  "occasion",
                  "fulfilment",
                  "hire_start",
                  "event_date",
                  "hire_end",
                  "items"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "validate",
                      "submit"
                    ],
                    "default": "submit"
                  },
                  "requestKey": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Lowercase UUID. Reuse unchanged for retries; retained for seven days."
                  },
                  "customer_authorized": {
                    "type": "boolean",
                    "const": true,
                    "description": "Customer explicitly permitted sharing their details and receiving confirmation email."
                  },
                  "terms_accepted": {
                    "type": "boolean",
                    "const": true,
                    "description": "Customer agreed to https://wacarrandson.co.uk/terms-and-conditions/."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 150
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254,
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "pattern": "^[+()0-9 .-]{7,40}$"
                  },
                  "occasion": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "fulfilment": {
                    "type": "string",
                    "enum": [
                      "delivery",
                      "collection"
                    ]
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "hire_start": {
                    "type": "string",
                    "format": "date",
                    "description": "UK calendar date: today through three years ahead."
                  },
                  "event_date": {
                    "type": "string",
                    "format": "date",
                    "description": "On or after hire_start."
                  },
                  "hire_end": {
                    "type": "string",
                    "format": "date",
                    "description": "On or after event_date."
                  },
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 40,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "quantity"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 999
                        },
                        "seatPadId": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Required when the product has seatPads. Use seatPads[].id, not productId."
                        }
                      }
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "fulfilment": {
                          "const": "delivery"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "address",
                        "city",
                        "postcode"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validated without effects, or received for staff review for authenticated partners.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "valid",
                        "awaiting_customer_confirmation",
                        "received",
                        "review"
                      ]
                    },
                    "reference": {
                      "type": "string",
                      "description": "YEH reference; only present after staff-queue receipt."
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "message": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "request": {
                      "type": "object",
                      "required": [
                        "requestKey",
                        "customer_authorized",
                        "terms_accepted",
                        "name",
                        "email",
                        "phone",
                        "occasion",
                        "fulfilment",
                        "hire_start",
                        "event_date",
                        "hire_end",
                        "items"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "enum": [
                            "validate",
                            "submit"
                          ],
                          "default": "submit"
                        },
                        "requestKey": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Lowercase UUID. Reuse unchanged for retries; retained for seven days."
                        },
                        "customer_authorized": {
                          "type": "boolean",
                          "const": true,
                          "description": "Customer explicitly permitted sharing their details and receiving confirmation email."
                        },
                        "terms_accepted": {
                          "type": "boolean",
                          "const": true,
                          "description": "Customer agreed to https://wacarrandson.co.uk/terms-and-conditions/."
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 150
                        },
                        "email": {
                          "type": "string",
                          "maxLength": 254,
                          "format": "email"
                        },
                        "phone": {
                          "type": "string",
                          "maxLength": 40,
                          "pattern": "^[+()0-9 .-]{7,40}$"
                        },
                        "occasion": {
                          "type": "string",
                          "maxLength": 120
                        },
                        "notes": {
                          "type": "string",
                          "maxLength": 3000
                        },
                        "fulfilment": {
                          "type": "string",
                          "enum": [
                            "delivery",
                            "collection"
                          ]
                        },
                        "address": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "city": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "postcode": {
                          "type": "string",
                          "maxLength": 12
                        },
                        "hire_start": {
                          "type": "string",
                          "format": "date",
                          "description": "UK calendar date: today through three years ahead."
                        },
                        "event_date": {
                          "type": "string",
                          "format": "date",
                          "description": "On or after hire_start."
                        },
                        "hire_end": {
                          "type": "string",
                          "format": "date",
                          "description": "On or after event_date."
                        },
                        "items": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 40,
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "quantity"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "quantity": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 999
                              },
                              "seatPadId": {
                                "type": "integer",
                                "minimum": 1,
                                "description": "Required when the product has seatPads. Use seatPads[].id, not productId."
                              }
                            }
                          }
                        }
                      },
                      "allOf": [
                        {
                          "if": {
                            "properties": {
                              "fulfilment": {
                                "const": "delivery"
                              }
                            }
                          },
                          "then": {
                            "required": [
                              "address",
                              "city",
                              "postcode"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Customer confirmation required; no staff request exists yet. No token is returned to the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "valid",
                        "awaiting_customer_confirmation",
                        "received",
                        "review"
                      ]
                    },
                    "reference": {
                      "type": "string",
                      "description": "YEH reference; only present after staff-queue receipt."
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "message": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "request": {
                      "type": "object",
                      "required": [
                        "requestKey",
                        "customer_authorized",
                        "terms_accepted",
                        "name",
                        "email",
                        "phone",
                        "occasion",
                        "fulfilment",
                        "hire_start",
                        "event_date",
                        "hire_end",
                        "items"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "enum": [
                            "validate",
                            "submit"
                          ],
                          "default": "submit"
                        },
                        "requestKey": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Lowercase UUID. Reuse unchanged for retries; retained for seven days."
                        },
                        "customer_authorized": {
                          "type": "boolean",
                          "const": true,
                          "description": "Customer explicitly permitted sharing their details and receiving confirmation email."
                        },
                        "terms_accepted": {
                          "type": "boolean",
                          "const": true,
                          "description": "Customer agreed to https://wacarrandson.co.uk/terms-and-conditions/."
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 150
                        },
                        "email": {
                          "type": "string",
                          "maxLength": 254,
                          "format": "email"
                        },
                        "phone": {
                          "type": "string",
                          "maxLength": 40,
                          "pattern": "^[+()0-9 .-]{7,40}$"
                        },
                        "occasion": {
                          "type": "string",
                          "maxLength": 120
                        },
                        "notes": {
                          "type": "string",
                          "maxLength": 3000
                        },
                        "fulfilment": {
                          "type": "string",
                          "enum": [
                            "delivery",
                            "collection"
                          ]
                        },
                        "address": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "city": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "postcode": {
                          "type": "string",
                          "maxLength": 12
                        },
                        "hire_start": {
                          "type": "string",
                          "format": "date",
                          "description": "UK calendar date: today through three years ahead."
                        },
                        "event_date": {
                          "type": "string",
                          "format": "date",
                          "description": "On or after hire_start."
                        },
                        "hire_end": {
                          "type": "string",
                          "format": "date",
                          "description": "On or after event_date."
                        },
                        "items": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 40,
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "quantity"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "quantity": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 999
                              },
                              "seatPadId": {
                                "type": "integer",
                                "minimum": 1,
                                "description": "Required when the product has seatPads. Use seatPads[].id, not productId."
                              }
                            }
                          }
                        }
                      },
                      "allOf": [
                        {
                          "if": {
                            "properties": {
                              "fulfilment": {
                                "const": "delivery"
                              }
                            }
                          },
                          "then": {
                            "required": [
                              "address",
                              "city",
                              "postcode"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid partner credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Origin denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Expired request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited; respect Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Unavailable. email_unconfirmed requires customer inbox check, not automatic new submission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "code",
                    "error"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "partnerBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Optional, expiring credential issued privately to approved integrations. Never expose in browser code."
      }
    }
  }
}