{
    "openapi": "3.0.0",
    "info": {
        "title": "Link Publishers Partner API",
        "version": "1.0.0"
    },
    "paths": {
        "/api/fetch-inventory": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Fetch Marketplace Inventory",
                "operationId": "bf9c8390ac772ef01e5f04d9799a25b7",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "page_no"
                                ],
                                "properties": {
                                    "page_no": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "marketplaceType": {
                                        "type": "integer",
                                        "default": 0
                                    },
                                    "min_da_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_da_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_ahref_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_ahref_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_dr": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_dr": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_authority_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_authority_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_price_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_price_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_li_price": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_li_price": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_spam_score_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_spam_score_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_trust_flow_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_trust_flow_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "min_citation_flow_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_citation_flow_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "category_filter": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "default": null
                                    },
                                    "forbidden_category_filter": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "default": null
                                    },
                                    "country_filter": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "default": null
                                    },
                                    "language_filter": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "default": null
                                    },
                                    "link_type_filter": {
                                        "type": "string",
                                        "default": null
                                    },
                                    "min_tat_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "max_tat_filter": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "newly_added": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "quick_deliverables": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "top_selling": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "digital_pr": {
                                        "type": "integer",
                                        "default": null
                                    },
                                    "search_filter": {
                                        "type": "string",
                                        "default": null
                                    },
                                    "sort_by": {
                                        "description": "Field to sort by (host_url, da, ahref, tat, backlinks, publishing_price, linkinsertion_price)",
                                        "type": "string",
                                        "default": null
                                    },
                                    "sort_direction": {
                                        "description": "Sort direction (asc or desc)",
                                        "type": "string",
                                        "default": null
                                    },
                                    "perPageData": {
                                        "description": "Number of results per page. Defaults to 25. Maximum allowed is 100.",
                                        "type": "integer",
                                        "default": 25,
                                        "maximum": 100,
                                        "minimum": 1,
                                        "example": 25
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data fetched successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "404": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart/store": {
            "post": {
                "tags": [
                    "Add/Remove from Cart"
                ],
                "summary": "Add or remove item(s) from cart",
                "operationId": "1adafb41040e7a6b748d07c1e733f9e5",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "website_id",
                                    "action",
                                    "client_token",
                                    "marketplaceType"
                                ],
                                "oneOf": [
                                    {
                                        "properties": {
                                            "website_id": {
                                                "type": "integer",
                                                "example": 123
                                            },
                                            "action": {
                                                "type": "string",
                                                "enum": [
                                                    "add",
                                                    "remove"
                                                ],
                                                "example": "add"
                                            },
                                            "client_token": {
                                                "type": "string",
                                                "example": "abc123xyz"
                                            },
                                            "marketplaceType": {
                                                "type": "integer",
                                                "example": 0
                                            }
                                        },
                                        "type": "object"
                                    },
                                    {
                                        "properties": {
                                            "website_id": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                },
                                                "example": [
                                                    123,
                                                    456
                                                ]
                                            },
                                            "action": {
                                                "type": "string",
                                                "enum": [
                                                    "add",
                                                    "remove"
                                                ],
                                                "example": "add"
                                            },
                                            "client_token": {
                                                "type": "string",
                                                "example": "abc123xyz"
                                            },
                                            "marketplaceType": {
                                                "type": "integer",
                                                "example": 0
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Cart updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "string",
                                            "example": "true"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Added to cart successfully"
                                        },
                                        "cartTotal": {
                                            "type": "integer",
                                            "example": 3
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart/gp-order-info": {
            "post": {
                "tags": [
                    "Guest Post Order Information"
                ],
                "summary": "Submit Guest Post Order Info",
                "operationId": "0f6f06af8130e193a773cd8e42a2bf07",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "type",
                                    "language",
                                    "attachment",
                                    "website_id",
                                    "client_token",
                                    "marketplaceType"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "example": "provide_content"
                                    },
                                    "language": {
                                        "type": "string",
                                        "example": "English"
                                    },
                                    "attachment": {
                                        "type": "string",
                                        "example": "sample.docx"
                                    },
                                    "special_instruction": {
                                        "type": "string",
                                        "example": "Please focus on quality, avoid any numbers or emails."
                                    },
                                    "website_id": {
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "client_token": {
                                        "type": "string",
                                        "example": "abc123xyz789"
                                    },
                                    "clearData": {
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "marketplaceType": {
                                        "type": "integer",
                                        "default": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Guest Post Order Information Saved Successfully!"
                                        },
                                        "cart": {
                                            "type": "integer",
                                            "example": 456
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request - Validation or Data Errors",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Validation failed or Cart Details Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart/li-order-info": {
            "post": {
                "tags": [
                    "Link Insertion Order Information"
                ],
                "summary": "Submit Link Insertion Order Info",
                "operationId": "206362c6e241f0d74abd752b82241330",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "website_id",
                                    "existing_post_url",
                                    "target_url",
                                    "anchor_text",
                                    "client_token",
                                    "marketplaceType"
                                ],
                                "properties": {
                                    "website_id": {
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "existing_post_url": {
                                        "type": "string",
                                        "format": "url",
                                        "example": "https://example.com/existing-post"
                                    },
                                    "target_url": {
                                        "type": "string",
                                        "format": "url",
                                        "example": "https://example.com/target-url"
                                    },
                                    "anchor_text": {
                                        "type": "string",
                                        "maxLength": 400,
                                        "example": "Click here"
                                    },
                                    "special_note": {
                                        "type": "string",
                                        "maxLength": 400,
                                        "example": "Please avoid emails or phone numbers."
                                    },
                                    "language": {
                                        "type": "string",
                                        "example": "English"
                                    },
                                    "type": {
                                        "type": "string",
                                        "example": "link_insertion"
                                    },
                                    "client_token": {
                                        "type": "string",
                                        "example": "abc123xyz"
                                    },
                                    "clearData": {
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "marketplaceType": {
                                        "type": "integer",
                                        "default": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Link Insertion Order Information Saved Successfully!"
                                        },
                                        "cart": {
                                            "type": "integer",
                                            "example": 789
                                        },
                                        "total": {
                                            "type": "string",
                                            "example": "45.00"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request - Validation or Business Logic Errors",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Validation failed"
                                        },
                                        "messages": {
                                            "type": "object",
                                            "example": {
                                                "special_note": [
                                                    "The special_note must not include emails, numbers, fiverr, or skype."
                                                ]
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart/content-gp-order-info": {
            "post": {
                "tags": [
                    "Content + Guest Post Order"
                ],
                "summary": "Submit Content + Guest Post Order Info",
                "operationId": "e289d7c35597ad1dd3d4c4b125014e13",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "website_id",
                                    "category",
                                    "keywords",
                                    "target_url",
                                    "reference_link",
                                    "anchor_text",
                                    "word_count",
                                    "target_audience",
                                    "language",
                                    "client_token",
                                    "marketplaceType"
                                ],
                                "properties": {
                                    "website_id": {
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "category": {
                                        "type": "string",
                                        "example": "Technology"
                                    },
                                    "keywords": {
                                        "type": "string",
                                        "example": "AI, machine learning, neural networks"
                                    },
                                    "target_url": {
                                        "type": "string",
                                        "format": "url",
                                        "example": "https://example.com/target-page"
                                    },
                                    "reference_link": {
                                        "type": "string",
                                        "format": "url",
                                        "example": "https://example.com/sample-article"
                                    },
                                    "anchor_text": {
                                        "type": "string",
                                        "maxLength": 100,
                                        "example": "Read more about AI"
                                    },
                                    "word_count": {
                                        "type": "string",
                                        "example": "1000 Words"
                                    },
                                    "target_audience": {
                                        "type": "string",
                                        "example": "United States"
                                    },
                                    "special_note": {
                                        "type": "string",
                                        "maxLength": 400,
                                        "example": "Please avoid any promotional tone. No email or phone."
                                    },
                                    "language": {
                                        "description": "Required. If the website supports multiple languages (e.g., 'English,Hindi'), you may enter any one of them.",
                                        "type": "string",
                                        "example": "English"
                                    },
                                    "client_token": {
                                        "type": "string",
                                        "example": "abc123xyz"
                                    },
                                    "clearData": {
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "marketplaceType": {
                                        "type": "integer",
                                        "default": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Content + Guest Post Order Information Saved Successfully!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request - Validation or Logic Errors",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Validation failed"
                                        },
                                        "messages": {
                                            "type": "object",
                                            "example": {
                                                "language": [
                                                    "Please enter a valid language from the available options."
                                                ]
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart/place-order": {
            "post": {
                "tags": [
                    "Place Order"
                ],
                "summary": "Place an order",
                "operationId": "placeOrder",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "client_token"
                                ],
                                "properties": {
                                    "client_token": {
                                        "description": "Client token for authentication",
                                        "type": "string",
                                        "example": "abc123token"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order placed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order placed successfully!!"
                                        },
                                        "flag": {
                                            "type": "integer",
                                            "example": 0
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/order-listing": {
            "post": {
                "tags": [
                    "Order Listing"
                ],
                "summary": "Get order listings with filters and sorting",
                "operationId": "orderListing",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "client_token": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "new",
                                            "progress",
                                            "approval",
                                            "delayed",
                                            "completed",
                                            "rejected"
                                        ]
                                    },
                                    "search": {
                                        "type": "string",
                                        "default": null
                                    },
                                    "sortCol": {
                                        "type": "string",
                                        "example": "created_at"
                                    },
                                    "sortColType": {
                                        "type": "string",
                                        "enum": [
                                            "asc",
                                            "desc"
                                        ],
                                        "example": "desc"
                                    },
                                    "dateFilter": {
                                        "type": "string",
                                        "default": null
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "draw": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-client-chat-message": {
            "post": {
                "tags": [
                    "Fetch Chat Message"
                ],
                "summary": "Get chat messages for a specific order.",
                "operationId": "getClientChatMessage",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "order_attribute_id": {
                                        "type": "integer"
                                    },
                                    "sender_id": {
                                        "type": "integer"
                                    },
                                    "receiver_id": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "client_token": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "order_attribute_id",
                                    "sender_id",
                                    "client_token"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Chat messages retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/unread-msg-counts": {
            "post": {
                "tags": [
                    "Fetch Unread Messages Count"
                ],
                "summary": "Get unread message count for the authenticated client",
                "description": "Returns the number of unread messages sent by users that have not yet been seen by the admin.",
                "operationId": "clientUnreadMsgCounts",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "client_token": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Unread message count",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "count": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-message": {
            "post": {
                "tags": [
                    "Send Message"
                ],
                "summary": "Send a message from client to admin",
                "description": "Sends a new chat message related to a specific order from the authenticated client.",
                "operationId": "sendMessage",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "message",
                                    "from_id",
                                    "to_id",
                                    "order_id",
                                    "client_token"
                                ],
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "example": "Hello, I have a question about the order."
                                    },
                                    "from_id": {
                                        "type": "integer",
                                        "example": 5
                                    },
                                    "to_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "order_id": {
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "client_token": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Message sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Message sent successfully!"
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 456
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/approval-to-complete": {
            "post": {
                "tags": [
                    "Complete Order From Your Approval"
                ],
                "summary": "Handle client approval and finalize order completion",
                "operationId": "ba065c1079675832ad50edaf7488bedb",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attribute_id",
                                    "client_token"
                                ],
                                "properties": {
                                    "order_attribute_id": {
                                        "type": "string",
                                        "example": "12345"
                                    },
                                    "client_token": {
                                        "type": "string",
                                        "example": "abc123xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order successfully completed and affiliate commissions processed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Order completion processed successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "redirect_url": {
                                            "type": "string",
                                            "example": "https://example.com/marketplace"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delay-to-inprogress": {
            "post": {
                "tags": [
                    "Order Delay To In Progress"
                ],
                "summary": "Move delayed order to in-progress status",
                "description": "Changes the status of a delayed order to in-progress and updates related timestamps. Sends a notification email to the publisher.",
                "operationId": "a8eb426ffc90c1b9303545b1681e9f09",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attribute_id",
                                    "client_token"
                                ],
                                "properties": {
                                    "order_attribute_id": {
                                        "description": "The ID of the order attribute to update",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "client_token": {
                                        "description": "Client validation token",
                                        "type": "string",
                                        "example": "abc123xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order successfully moved to in-progress",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order moved from delayed to In-Progress state."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delay-to-reject": {
            "post": {
                "tags": [
                    "Order Delay To Reject"
                ],
                "summary": "Reject a delayed order and trigger admin approval",
                "description": "This API is used to reject an order that was in a delayed state. It updates the reject reason, creates an admin approval record, calculates refund, and triggers emails to relevant stakeholders.",
                "operationId": "9af508598766991c07b64ae8399eae46",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attribute_id",
                                    "client_token"
                                ],
                                "properties": {
                                    "order_attribute_id": {
                                        "description": "The ID of the order attribute to be rejected",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "rejectReason": {
                                        "description": "Optional reject reason from advertiser",
                                        "type": "string",
                                        "example": "Publisher was unresponsive"
                                    },
                                    "client_token": {
                                        "description": "Client validation token",
                                        "type": "string",
                                        "example": "abc123xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order successfully moved to reject with pending admin approval",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order moved from delayed to Reject state."
                                        },
                                        "approvalMessage": {
                                            "type": "string",
                                            "example": "Waiting for admin approval"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or missing parameters"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/adv-reject-order": {
            "post": {
                "tags": [
                    "Advertiser Reject Order"
                ],
                "summary": "Advertiser Reject Order",
                "operationId": "d0346a0f27a838804845578dac1dbc6e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attr_id",
                                    "action"
                                ],
                                "properties": {
                                    "order_attr_id": {
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "price",
                                            "word_count"
                                        ],
                                        "example": "price"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order Rejected Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order Rejected Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/adv-accept-order": {
            "post": {
                "tags": [
                    "Advertiser Accept Order"
                ],
                "summary": "Advertiser Accept Order",
                "operationId": "advAcceptOrder",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "action",
                                    "order_attr_id"
                                ],
                                "properties": {
                                    "action": {
                                        "description": "The action type",
                                        "type": "string",
                                        "enum": [
                                            "price",
                                            "word_count",
                                            "article",
                                            "other"
                                        ],
                                        "example": "price"
                                    },
                                    "order_attr_id": {
                                        "description": "Order attribute ID",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "instruction": {
                                        "description": "Optional instructions from the buyer",
                                        "type": "string",
                                        "example": "Please write about SEO trends."
                                    },
                                    "attachment": {
                                        "description": "Attachment file (optional)",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order Placed Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order Placed Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/reject-to-inprogress": {
            "post": {
                "tags": [
                    "Accept Order Reject Reopen Request"
                ],
                "summary": "Move order from Rejected to In-Progress state",
                "description": "Allows an authenticated user to change an order's status from rejected to in-progress. Also updates related wallet and logs.",
                "operationId": "orderRejectToInProgress",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attribute_id"
                                ],
                                "properties": {
                                    "order_attribute_id": {
                                        "description": "ID of the order attribute to update",
                                        "type": "integer",
                                        "example": 123
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order moved from Reject to In-Progress",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order moved from Reject to In-Progress state."
                                        },
                                        "showAddFundPopup": {
                                            "type": "integer",
                                            "example": 1,
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access or invalid user session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Order already in a final state",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order is already Rejected"
                                        },
                                        "data": {
                                            "type": "string",
                                            "example": "type_data"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/reject-reopen-request": {
            "post": {
                "tags": [
                    "Reject Order Reject Reopen Request"
                ],
                "summary": "Reject an order reopen request",
                "description": "This endpoint allows an authenticated user to reject an order request and triggers a background mail notification.",
                "operationId": "orderRejectRequest",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_attribute_id"
                                ],
                                "properties": {
                                    "order_attribute_id": {
                                        "description": "ID of the order attribute to reject",
                                        "type": "integer",
                                        "example": 123
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Order has been rejected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order Request is Rejected."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized access or missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Order already processed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Order is already Accepted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-project": {
            "post": {
                "tags": [
                    "Add/Edit Project"
                ],
                "summary": "Add or Update a Project",
                "description": "This API allows a user to add a new project or update an existing one. It also handles project competitors and sends background notification emails.",
                "operationId": "addProject",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "project_url",
                                    "client_token"
                                ],
                                "properties": {
                                    "project_url": {
                                        "description": "The full URL of the project. Must be a valid URL matching the format: /^(https?:\\/\\/)?(www\\.)?[a-zA-Z0-9.-]+(\\.[a-zA-Z]{2,})(\\/.*)?$/. Invalid or incomplete URLs like 'https://www' are not allowed.",
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://example.com"
                                    },
                                    "categoryID": {
                                        "description": "Optional. Must provide either categoryID or forbiddenCategoryID (or both). If provided, must be an integer.",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "forbiddenCategoryID": {
                                        "description": "Optional. Must provide either categoryID or forbiddenCategoryID (or both). If provided, must be an integer.",
                                        "type": "integer",
                                        "example": 2
                                    },
                                    "additionalNote": {
                                        "description": "Optional. Only non-empty string allowed. Only spaces are not accepted.",
                                        "type": "string",
                                        "example": "Project related additional notes."
                                    },
                                    "project_id": {
                                        "description": "Optional. Project ID to update an existing project.",
                                        "type": "integer",
                                        "example": 10
                                    },
                                    "competitors": {
                                        "description": "Optional. List of up to 5 valid competitor URLs.",
                                        "type": "array",
                                        "items": {
                                            "description": "Competitor URL. Must be a valid URL matching regex: /^(https?:\\/\\/)?(www\\.)?[a-zA-Z0-9.-]+(\\.[a-zA-Z]{2,})(\\/.*)?$/",
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "maxItems": 5,
                                        "example": [
                                            "https://competitor1.com",
                                            "https://competitor2.com"
                                        ]
                                    },
                                    "client_token": {
                                        "description": "Mandatory. User authentication token. Only non-empty strings allowed; only spaces are not accepted.",
                                        "type": "string",
                                        "example": "abc123xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Project added successfully!"
                                        },
                                        "reloadStatus": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Project URL already exist or Validation failed"
                                        },
                                        "hosturl": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cart-listing": {
            "post": {
                "tags": [
                    "Cart Listing"
                ],
                "summary": "Fetch cart listing using client token",
                "operationId": "132a77a1a46b686facbe4c5facdf96f8",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "client_token"
                                ],
                                "properties": {
                                    "client_token": {
                                        "description": "A client token used to authenticate the user",
                                        "type": "string",
                                        "example": "abc123xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Cart listing fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "html": {
                                            "type": "string",
                                            "example": "<div>Rendered cart details</div>"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "cart details"
                                        },
                                        "websiteinfo": {
                                            "type": "string",
                                            "example": "<div>Website info HTML</div>"
                                        },
                                        "guideline": {
                                            "type": "string",
                                            "example": "Follow the website's posting guidelines"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing client_token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhookResponses": {
            "post": {
                "tags": [
                    "Webhook Responses"
                ],
                "summary": "Fetch Webhook Responses",
                "description": "Fetched webhook response records which contain updates about orders.",
                "operationId": "webhookResponses",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "client_token"
                                ],
                                "properties": {
                                    "client_token": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Responses Fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Responses Fetched successfully!"
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 456
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        },
                                        "logout": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/bga-backlink-gap-analysis": {
            "post": {
                "tags": [
                    "Backlink Gap Analysis"
                ],
                "summary": "BGA (Coming Soon)",
                "description": "Backlink Gap Analysis feature is coming soon. This endpoint is currently disabled.",
                "operationId": "bga-backlink-gap-analysis",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "503": {
                        "description": "Service Unavailable - Coming Soon",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "This feature is coming soon."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unauthorized. Please log in again."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "deprecated": true,
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Use a valid bearer token",
                "name": "Authorization",
                "in": "header",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Marketplace",
            "description": "Marketplace"
        },
        {
            "name": "Add/Remove from Cart",
            "description": "Add/Remove from Cart"
        },
        {
            "name": "Guest Post Order Information",
            "description": "Guest Post Order Information"
        },
        {
            "name": "Link Insertion Order Information",
            "description": "Link Insertion Order Information"
        },
        {
            "name": "Content + Guest Post Order",
            "description": "Content + Guest Post Order"
        },
        {
            "name": "Place Order",
            "description": "Place Order"
        },
        {
            "name": "Order Listing",
            "description": "Order Listing"
        },
        {
            "name": "Fetch Chat Message",
            "description": "Fetch Chat Message"
        },
        {
            "name": "Fetch Unread Messages Count",
            "description": "Fetch Unread Messages Count"
        },
        {
            "name": "Send Message",
            "description": "Send Message"
        },
        {
            "name": "Complete Order From Your Approval",
            "description": "Complete Order From Your Approval"
        },
        {
            "name": "Order Delay To In Progress",
            "description": "Order Delay To In Progress"
        },
        {
            "name": "Order Delay To Reject",
            "description": "Order Delay To Reject"
        },
        {
            "name": "Advertiser Reject Order",
            "description": "Advertiser Reject Order"
        },
        {
            "name": "Advertiser Accept Order",
            "description": "Advertiser Accept Order"
        },
        {
            "name": "Accept Order Reject Reopen Request",
            "description": "Accept Order Reject Reopen Request"
        },
        {
            "name": "Reject Order Reject Reopen Request",
            "description": "Reject Order Reject Reopen Request"
        },
        {
            "name": "Add/Edit Project",
            "description": "Add/Edit Project"
        },
        {
            "name": "Cart Listing",
            "description": "Cart Listing"
        },
        {
            "name": "Webhook Responses",
            "description": "Webhook Responses"
        },
        {
            "name": "Backlink Gap Analysis",
            "description": "Backlink Gap Analysis"
        }
    ]
}