# Flow Builder **Category:** Admin **Base URL:** `/admin/flow-builder` **Authentication:** Required **Routes:** 10 routes documented ## Overview This section documents 10 API routes for flow builder. > ⚠️ **These endpoints operate on your live store.** `POST`/`PUT`/`DELETE` operations here — including sync, push, resync, and cache operations — modify or delete production data, and some trigger downstream effects such as warehouse orders or customer emails. `DELETE` operations are generally irreversible. Verify IDs and parameters carefully before calling them from scripts. ## Quick Reference | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/admin/flow-builder` | // GET /admin/flow-builder/flows - List all flows | | POST | `/admin/flow-builder` | No description | | GET | `/admin/flow-builder/:id` | // GET /admin/flow-builder/:id - Get flow by ID | | POST | `/admin/flow-builder/:id` | No description | | DELETE | `/admin/flow-builder/:id` | // DELETE /admin/flow-builder/:id - Delete flow | | GET | `/admin/flow-builder/:id/analytics` | // GET /admin/flow-builder/:id/analytics - Get flow analytic... | | GET | `/admin/flow-builder/:id/buttons` | // GET /admin/flow-builder/:id/buttons - List flow buttons | | POST | `/admin/flow-builder/:id/buttons` | No description | | PUT | `/admin/flow-builder/:id/buttons` | // PUT is used instead of PATCH for better OmniCart compatibil... | | GET | `/admin/flow-builder/:id/embed-code` | // GET /admin/flow-builder/:id/embed-code - Generate embed c... | | GET | `/admin/flow-builder/:id/generate-demo` | // GET /admin/flow-builder/:id/generate-demo - Generate down... | | GET | `/admin/flow-builder/:id/publish-site` | // GET /admin/flow-builder/:id/publish-site - Get linked sit... | | POST | `/admin/flow-builder/:id/publish-site` | // POST /admin/flow-builder/:id/publish-site - Publish flow ... | | GET | `/admin/flow-builder/:id/urls` | // GET /admin/flow-builder/:id/urls - List all URLs for a fl... | | POST | `/admin/flow-builder/:id/urls` | No description | | GET | `/admin/flow-builder/buttons/:buttonId` | // GET /admin/flow-builder/buttons/:buttonId - Get button | | POST | `/admin/flow-builder/buttons/:buttonId` | No description | | DELETE | `/admin/flow-builder/buttons/:buttonId` | // DELETE /admin/flow-builder/buttons/:buttonId - Delete but... | | POST | `/admin/flow-builder/urls/:urlId` | No description | | DELETE | `/admin/flow-builder/urls/:urlId` | // DELETE /admin/flow-builder/urls/:urlId - Delete URL | --- ## GET Admin Flow-builder **Endpoint:** `GET /admin/flow-builder` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/flows - List all flows ### Response **Success:** ```typescript { flows, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder **Endpoint:** `POST /admin/flow-builder` **Authentication:** Admin (Required) ### Request Body | Field | Type | Required | |-------|------|----------| | `name` | string | Yes | | `slug` | string | Yes | | `description` | string | No | ### Response **Success:** ```typescript { flow, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id **Endpoint:** `GET /admin/flow-builder/:id` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id - Get flow by ID ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { flow, buttons, urls, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder :id **Endpoint:** `POST /admin/flow-builder/:id` **Authentication:** Admin (Required) ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `name` | string | No | | `slug` | string | No | | `description` | string | No | | `status` | enum(draft, active) | No | | `entry_button_id` | string | No | | `flow_data` | any | No | ### Response **Success:** ```typescript { flow, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/:id' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## DELETE Admin Flow-builder :id **Endpoint:** `DELETE /admin/flow-builder/:id` **Authentication:** Admin (Required) ### Description // DELETE /admin/flow-builder/:id - Delete flow ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { id, deleted, } ``` ### Example Request ```bash curl -X DELETE 'https://your-store.omnicart.cc/admin/flow-builder/:id' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Analytics **Endpoint:** `GET /admin/flow-builder/:id/analytics` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/analytics - Get flow analytics ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { flow_id, sessions, events, revenue, metrics, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/analytics' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Buttons **Endpoint:** `GET /admin/flow-builder/:id/buttons` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/buttons - List flow buttons ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { buttons, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/buttons' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder :id Buttons **Endpoint:** `POST /admin/flow-builder/:id/buttons` **Authentication:** Admin (Required) ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `label` | string | Yes | | `button_text` | string | Yes | | `group_key` | string | No | | `lines_config` | array | No | | `display_price` | number | No | | `currency_code` | string | No | | `success_next_button_id` | string | No | | `decline_next_button_id` | string | No | | `success_redirect_url` | unknown | No | | `decline_redirect_url` | unknown | No | | `is_terminal_success` | boolean | No | | `is_terminal_decline` | boolean | No | | `position_x` | number | No | | `position_y` | number | No | | `split_test_enabled` | boolean | No | | `split_test_variants` | array | No | | `split_test_variants_decline` | array | No | ### Response **Success:** ```typescript { button, } ``` **Error (400):** ```typescript { message, errors, } ``` **Error (500):** ```typescript { message, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/:id/buttons' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## PUT Admin Flow-builder :id Buttons **Endpoint:** `PUT /admin/flow-builder/:id/buttons` **Authentication:** Admin (Required) ### Description // PUT is used instead of PATCH for better client compatibility ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `label` | string | Yes | | `button_text` | string | Yes | | `group_key` | string | No | | `lines_config` | array | No | | `display_price` | number | No | | `currency_code` | string | No | | `success_next_button_id` | string | No | | `decline_next_button_id` | string | No | | `success_redirect_url` | unknown | No | | `decline_redirect_url` | unknown | No | | `is_terminal_success` | boolean | No | | `is_terminal_decline` | boolean | No | | `position_x` | number | No | | `position_y` | number | No | | `split_test_enabled` | boolean | No | | `split_test_variants` | array | No | | `split_test_variants_decline` | array | No | ### Response **Success (200):** ```typescript { success, updated, orphaned_linked, message, } ``` **Error (400):** ```typescript { error, message, cyclePath, } ``` **Error (500):** ```typescript { success, message, } ``` ### Example Request ```bash curl -X PUT 'https://your-store.omnicart.cc/admin/flow-builder/:id/buttons' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Embed-code **Endpoint:** `GET /admin/flow-builder/:id/embed-code` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/embed-code - Generate embed code ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { flow, quick_start_code, full_implementation_code, checkout_integration_code, setup_instructions, api_url, } ``` **Error (400):** ```typescript { error, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/embed-code' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Generate-demo **Endpoint:** `GET /admin/flow-builder/:id/generate-demo` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/generate-demo - Generate downloadable demo funnel ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Error (400):** ```typescript { error, } ``` **Error (400):** ```typescript { error, } ``` **Error (500):** ```typescript { error, details, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/generate-demo' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Publish-site **Endpoint:** `GET /admin/flow-builder/:id/publish-site` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/publish-site - Get linked sites for a flow ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { sites, count, } ``` **Also returns:** ```typescript { sites, count, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/publish-site' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder :id Publish-site **Endpoint:** `POST /admin/flow-builder/:id/publish-site` **Authentication:** Admin (Required) ### Description // POST /admin/flow-builder/:id/publish-site - Publish flow to a new site ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `name` | string | No | | `slug` | string | No | | `deploy_to_vercel` | boolean | No | | `api_base_url` | unknown | No | ### Response **Success:** ```typescript { success, site, flow_id, files_generated, message, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/:id/publish-site' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder :id Urls **Endpoint:** `GET /admin/flow-builder/:id/urls` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/:id/urls - List all URLs for a flow ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { urls, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/:id/urls' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder :id Urls **Endpoint:** `POST /admin/flow-builder/:id/urls` **Authentication:** Admin (Required) ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `name` | string | Yes | | `url` | unknown | Yes | | `description` | string | No | | `url_type` | enum(success, decline, external) | No | ### Response **Success:** ```typescript { url, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/:id/urls' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Flow-builder Buttons :buttonId **Endpoint:** `GET /admin/flow-builder/buttons/:buttonId` **Authentication:** Admin (Required) ### Description // GET /admin/flow-builder/buttons/:buttonId - Get button ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `buttonId` | string | Yes | ButtonId identifier | ### Response **Success:** ```typescript { button, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/flow-builder/buttons/:buttonId' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder Buttons :buttonId **Endpoint:** `POST /admin/flow-builder/buttons/:buttonId` **Authentication:** Admin (Required) ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `buttonId` | string | Yes | ButtonId identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `label` | string | No | | `button_text` | string | No | | `group_key` | string | No | | `lines_config` | array | No | | `display_price` | number | No | | `currency_code` | string | No | | `success_next_button_id` | string | No | | `decline_next_button_id` | string | No | | `success_redirect_url` | unknown | No | | `decline_redirect_url` | unknown | No | | `is_terminal_success` | boolean | No | | `is_terminal_decline` | boolean | No | | `position_x` | number | No | | `position_y` | number | No | | `split_test_enabled` | boolean | No | | `split_test_variants` | array | No | | `split_test_variants_decline` | array | No | ### Response **Success:** ```typescript { button, } ``` **Error (400):** ```typescript { message, errors, } ``` **Error (500):** ```typescript { message, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/buttons/:buttonId' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## DELETE Admin Flow-builder Buttons :buttonId **Endpoint:** `DELETE /admin/flow-builder/buttons/:buttonId` **Authentication:** Admin (Required) ### Description // DELETE /admin/flow-builder/buttons/:buttonId - Delete button ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `buttonId` | string | Yes | ButtonId identifier | ### Response **Success:** ```typescript { id, deleted, } ``` ### Example Request ```bash curl -X DELETE 'https://your-store.omnicart.cc/admin/flow-builder/buttons/:buttonId' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Flow-builder Urls :urlId **Endpoint:** `POST /admin/flow-builder/urls/:urlId` **Authentication:** Admin (Required) ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `urlId` | string | Yes | UrlId identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `name` | string | No | | `url` | unknown | No | | `description` | string | No | | `url_type` | enum(success, decline, external) | No | ### Response **Success:** ```typescript { url, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/flow-builder/urls/:urlId' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## DELETE Admin Flow-builder Urls :urlId **Endpoint:** `DELETE /admin/flow-builder/urls/:urlId` **Authentication:** Admin (Required) ### Description // DELETE /admin/flow-builder/urls/:urlId - Delete URL ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `urlId` | string | Yes | UrlId identifier | ### Response **Success:** ```typescript { id, deleted, } ``` ### Example Request ```bash curl -X DELETE 'https://your-store.omnicart.cc/admin/flow-builder/urls/:urlId' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` ---