{
  "openapi": "3.1.0",
  "info": {
    "title": "AfterLaunch API",
    "version": "1.0.0",
    "description": "The client-facing backend for your workspace: services, orders, and enquiries. Authenticate with a per-workspace API key (Bearer). Publishable keys (wpk_) are browser-safe; secret keys (wsk_) are server-side."
  },
  "servers": [
    {
      "url": "https://afterlaunch.app/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Workspace API key (wpk_ or wsk_)."
      }
    }
  },
  "paths": {
    "/config": {
      "get": {
        "summary": "Workspace config for the embed SDK",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/services": {
      "get": {
        "summary": "List services (catalog + multi-currency prices)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/services/{slug}": {
      "get": {
        "summary": "Get one service",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/orders": {
      "post": {
        "summary": "Create an order + checkout",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "planId",
                  "email"
                ],
                "properties": {
                  "planId": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "answers": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Invalid request"
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "summary": "Order status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/enquiries": {
      "post": {
        "summary": "Submit an enquiry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "message"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "productSlug": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/enquiries/{id}": {
      "get": {
        "summary": "Enquiry status + thread",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/clients/register": {
      "post": {
        "summary": "Register a client in the workspace",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "409": {
            "description": "Exists"
          }
        }
      }
    },
    "/clients/login": {
      "post": {
        "summary": "Client login → session tokens",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Invalid credentials"
          }
        }
      }
    }
  },
  "x-webhooks": {
    "events": [
      "order.created",
      "order.completed",
      "payment.succeeded",
      "enquiry.created",
      "ticket.updated"
    ],
    "signature": "HMAC-SHA256 of the raw body using the endpoint secret, sent as x-afterlaunch-signature."
  }
}