---
updatedAt: 2025-11-10T23:58:10.000Z
agentTools:
  projectIndex: https://docs.interswitchgroup.com/llms.txt
---

# Create Route

Endpoint to create bus route and set fare

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "smart-move-transport-switch",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://smart-move.interswitchng.com/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/route": {
      "post": {
        "summary": "Create Route",
        "description": "Endpoint to create bus route and set fare",
        "operationId": "create-bus-route",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "string",
                    "format": "json"
                  },
                  "source": {
                    "type": "string",
                    "default": "{         \"busStop\": \"string\",         \"latitude\": 6.12232,         \"longitude\": 6.3234     }",
                    "format": "json"
                  },
                  "destination": {
                    "type": "string",
                    "default": "{         \"busStop\": \"string\",         \"latitude\": 6.12232,         \"longitude\": 6.3234     }",
                    "format": "json"
                  },
                  "fare": {
                    "type": "number",
                    "description": "Fare amount",
                    "default": 100,
                    "format": "double"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\":\"Request Successful\",\n  \"routeId\": 1\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Request Successful"
                    },
                    "routeId": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"validation Failure\",\n    \"errors\": [\n        {\n            \"fieldName\": \"username\", \"error\": \"username is required\"\n        },\n        {\n            \"fieldName\": \"password\", \"error\": \"password is required\"\n        }\n    ]\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "validation Failure"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fieldName": {
                            "type": "string",
                            "example": "username"
                          },
                          "error": {
                            "type": "string",
                            "example": "username is required"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Request Unauthorized\",\n    \"errors\": null\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Request Unauthorized"
                    },
                    "errors": {}
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Something went wrong. Contact application   support\",\n    \"errors\": null\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Something went wrong. Contact application   support"
                    },
                    "errors": {}
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```