> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://open-api-docs.dice.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://open-api-docs.dice.tech/_mcp/server.

# create Trip

POST https://heimdall.eka.io/apis/external/trips/create
Content-Type: application/json

### Trip Creation API Description:

The Trip Creation API facilitates the seamless creation of trips for users. With its intuitive interface and robust functionality, developers can easily integrate this API into their applications, enabling users to plan and organize their journeys effortlessly.

Reference: https://open-api-docs.dice.tech/dice-standardized-ap-is-v-2-copy/trip/create-trip

## Servers

- `https://heimdall.eka.io` (https://heimdall.eka.io, default)
- `https://heimdall.eka.ioapis` (https://heimdall.eka.ioapis)

## Request

### Headers

- `DICE-APP-ID` (string, optional)
- `X-CLIENT-ID` (string, optional)
- `X-CLIENT-SECRET` (string, optional)

### Body (application/json)

- `data` (object, required)
  - `additionalAmount` (integer, required)
  - `title` (string, required)
  - `origin` (object, required)
    - `cityName` (string, required)
    - `date` (string, required)
  - `cities` (list of object, required)
    - `cityName` (string, required)
    - `days` (integer, required)
    - `end` (string, required)
    - `start` (string, required)
    - `stay` (object, required)
      - `type` (string, required)
    - `travel` (object, required)
      - `type` (string, required)
  - `Draft` (boolean, required)
  - `admin` (boolean, required)
  - `return` (object, required)
    - `cityName` (string, required)
    - `travel` (object, required)
      - `type` (string, required)
- `EmployeeCode` (string, required)

## Response

### 200

Successful response

## Examples

**Request**

```json
{
  "data": {
    "additionalAmount": 0,
    "title": "test",
    "origin": {
      "cityName": "Mumbai",
      "date": "11-04-2024"
    },
    "cities": [
      {
        "cityName": "Delhi",
        "days": 1,
        "end": "12-04-2024",
        "start": "11-04-2024",
        "stay": {
          "type": "None"
        },
        "travel": {
          "type": "Flight"
        }
      },
      {
        "cityName": "Chennai",
        "days": 0,
        "end": "12-04-2024",
        "start": "2024-12-03T18:30:00.000Z",
        "stay": {
          "type": "string"
        },
        "travel": {
          "type": "Flight"
        }
      }
    ],
    "Draft": true,
    "admin": true,
    "return": {
      "cityName": "Mumbai",
      "travel": {
        "type": "None"
      }
    }
  },
  "EmployeeCode": "0001"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Trip_create Trip_example
import requests

url = "https://heimdall.eka.io/apis/external/trips/create"

payload = {
    "data": {
        "additionalAmount": 0,
        "title": "test",
        "origin": {
            "cityName": "Mumbai",
            "date": "11-04-2024"
        },
        "cities": [
            {
                "cityName": "Delhi",
                "days": 1,
                "end": "12-04-2024",
                "start": "11-04-2024",
                "stay": { "type": "None" },
                "travel": { "type": "Flight" }
            },
            {
                "cityName": "Chennai",
                "days": 0,
                "end": "12-04-2024",
                "start": "2024-12-03T18:30:00.000Z",
                "stay": { "type": "string" },
                "travel": { "type": "Flight" }
            }
        ],
        "Draft": True,
        "admin": True,
        "return": {
            "cityName": "Mumbai",
            "travel": { "type": "None" }
        }
    },
    "EmployeeCode": "0001"
}
headers = {
    "DICE-APP-ID": "{{Company Code}}",
    "X-CLIENT-ID": "{{API Client ID}}",
    "X-CLIENT-SECRET": "{{API Client Secret}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Trip_create Trip_example
const url = 'https://heimdall.eka.io/apis/external/trips/create';
const options = {
  method: 'POST',
  headers: {
    'DICE-APP-ID': '{{Company Code}}',
    'X-CLIENT-ID': '{{API Client ID}}',
    'X-CLIENT-SECRET': '{{API Client Secret}}',
    'Content-Type': 'application/json'
  },
  body: '{"data":{"additionalAmount":0,"title":"test","origin":{"cityName":"Mumbai","date":"11-04-2024"},"cities":[{"cityName":"Delhi","days":1,"end":"12-04-2024","start":"11-04-2024","stay":{"type":"None"},"travel":{"type":"Flight"}},{"cityName":"Chennai","days":0,"end":"12-04-2024","start":"2024-12-03T18:30:00.000Z","stay":{"type":"string"},"travel":{"type":"Flight"}}],"Draft":true,"admin":true,"return":{"cityName":"Mumbai","travel":{"type":"None"}}},"EmployeeCode":"0001"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Trip_create Trip_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://heimdall.eka.io/apis/external/trips/create"

	payload := strings.NewReader("{\n  \"data\": {\n    \"additionalAmount\": 0,\n    \"title\": \"test\",\n    \"origin\": {\n      \"cityName\": \"Mumbai\",\n      \"date\": \"11-04-2024\"\n    },\n    \"cities\": [\n      {\n        \"cityName\": \"Delhi\",\n        \"days\": 1,\n        \"end\": \"12-04-2024\",\n        \"start\": \"11-04-2024\",\n        \"stay\": {\n          \"type\": \"None\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      },\n      {\n        \"cityName\": \"Chennai\",\n        \"days\": 0,\n        \"end\": \"12-04-2024\",\n        \"start\": \"2024-12-03T18:30:00.000Z\",\n        \"stay\": {\n          \"type\": \"string\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      }\n    ],\n    \"Draft\": true,\n    \"admin\": true,\n    \"return\": {\n      \"cityName\": \"Mumbai\",\n      \"travel\": {\n        \"type\": \"None\"\n      }\n    }\n  },\n  \"EmployeeCode\": \"0001\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("DICE-APP-ID", "{{Company Code}}")
	req.Header.Add("X-CLIENT-ID", "{{API Client ID}}")
	req.Header.Add("X-CLIENT-SECRET", "{{API Client Secret}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Trip_create Trip_example
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/trips/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["DICE-APP-ID"] = '{{Company Code}}'
request["X-CLIENT-ID"] = '{{API Client ID}}'
request["X-CLIENT-SECRET"] = '{{API Client Secret}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"additionalAmount\": 0,\n    \"title\": \"test\",\n    \"origin\": {\n      \"cityName\": \"Mumbai\",\n      \"date\": \"11-04-2024\"\n    },\n    \"cities\": [\n      {\n        \"cityName\": \"Delhi\",\n        \"days\": 1,\n        \"end\": \"12-04-2024\",\n        \"start\": \"11-04-2024\",\n        \"stay\": {\n          \"type\": \"None\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      },\n      {\n        \"cityName\": \"Chennai\",\n        \"days\": 0,\n        \"end\": \"12-04-2024\",\n        \"start\": \"2024-12-03T18:30:00.000Z\",\n        \"stay\": {\n          \"type\": \"string\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      }\n    ],\n    \"Draft\": true,\n    \"admin\": true,\n    \"return\": {\n      \"cityName\": \"Mumbai\",\n      \"travel\": {\n        \"type\": \"None\"\n      }\n    }\n  },\n  \"EmployeeCode\": \"0001\"\n}"

response = http.request(request)
puts response.read_body
```

```java Trip_create Trip_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/trips/create")
  .header("DICE-APP-ID", "{{Company Code}}")
  .header("X-CLIENT-ID", "{{API Client ID}}")
  .header("X-CLIENT-SECRET", "{{API Client Secret}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"additionalAmount\": 0,\n    \"title\": \"test\",\n    \"origin\": {\n      \"cityName\": \"Mumbai\",\n      \"date\": \"11-04-2024\"\n    },\n    \"cities\": [\n      {\n        \"cityName\": \"Delhi\",\n        \"days\": 1,\n        \"end\": \"12-04-2024\",\n        \"start\": \"11-04-2024\",\n        \"stay\": {\n          \"type\": \"None\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      },\n      {\n        \"cityName\": \"Chennai\",\n        \"days\": 0,\n        \"end\": \"12-04-2024\",\n        \"start\": \"2024-12-03T18:30:00.000Z\",\n        \"stay\": {\n          \"type\": \"string\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      }\n    ],\n    \"Draft\": true,\n    \"admin\": true,\n    \"return\": {\n      \"cityName\": \"Mumbai\",\n      \"travel\": {\n        \"type\": \"None\"\n      }\n    }\n  },\n  \"EmployeeCode\": \"0001\"\n}")
  .asString();
```

```php Trip_create Trip_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/trips/create', [
  'body' => '{
  "data": {
    "additionalAmount": 0,
    "title": "test",
    "origin": {
      "cityName": "Mumbai",
      "date": "11-04-2024"
    },
    "cities": [
      {
        "cityName": "Delhi",
        "days": 1,
        "end": "12-04-2024",
        "start": "11-04-2024",
        "stay": {
          "type": "None"
        },
        "travel": {
          "type": "Flight"
        }
      },
      {
        "cityName": "Chennai",
        "days": 0,
        "end": "12-04-2024",
        "start": "2024-12-03T18:30:00.000Z",
        "stay": {
          "type": "string"
        },
        "travel": {
          "type": "Flight"
        }
      }
    ],
    "Draft": true,
    "admin": true,
    "return": {
      "cityName": "Mumbai",
      "travel": {
        "type": "None"
      }
    }
  },
  "EmployeeCode": "0001"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'DICE-APP-ID' => '{{Company Code}}',
    'X-CLIENT-ID' => '{{API Client ID}}',
    'X-CLIENT-SECRET' => '{{API Client Secret}}',
  ],
]);

echo $response->getBody();
```

```csharp Trip_create Trip_example
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/trips/create");
var request = new RestRequest(Method.POST);
request.AddHeader("DICE-APP-ID", "{{Company Code}}");
request.AddHeader("X-CLIENT-ID", "{{API Client ID}}");
request.AddHeader("X-CLIENT-SECRET", "{{API Client Secret}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"additionalAmount\": 0,\n    \"title\": \"test\",\n    \"origin\": {\n      \"cityName\": \"Mumbai\",\n      \"date\": \"11-04-2024\"\n    },\n    \"cities\": [\n      {\n        \"cityName\": \"Delhi\",\n        \"days\": 1,\n        \"end\": \"12-04-2024\",\n        \"start\": \"11-04-2024\",\n        \"stay\": {\n          \"type\": \"None\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      },\n      {\n        \"cityName\": \"Chennai\",\n        \"days\": 0,\n        \"end\": \"12-04-2024\",\n        \"start\": \"2024-12-03T18:30:00.000Z\",\n        \"stay\": {\n          \"type\": \"string\"\n        },\n        \"travel\": {\n          \"type\": \"Flight\"\n        }\n      }\n    ],\n    \"Draft\": true,\n    \"admin\": true,\n    \"return\": {\n      \"cityName\": \"Mumbai\",\n      \"travel\": {\n        \"type\": \"None\"\n      }\n    }\n  },\n  \"EmployeeCode\": \"0001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Trip_create Trip_example
import Foundation

let headers = [
  "DICE-APP-ID": "{{Company Code}}",
  "X-CLIENT-ID": "{{API Client ID}}",
  "X-CLIENT-SECRET": "{{API Client Secret}}",
  "Content-Type": "application/json"
]
let parameters = [
  "data": [
    "additionalAmount": 0,
    "title": "test",
    "origin": [
      "cityName": "Mumbai",
      "date": "11-04-2024"
    ],
    "cities": [
      [
        "cityName": "Delhi",
        "days": 1,
        "end": "12-04-2024",
        "start": "11-04-2024",
        "stay": ["type": "None"],
        "travel": ["type": "Flight"]
      ],
      [
        "cityName": "Chennai",
        "days": 0,
        "end": "12-04-2024",
        "start": "2024-12-03T18:30:00.000Z",
        "stay": ["type": "string"],
        "travel": ["type": "Flight"]
      ]
    ],
    "Draft": true,
    "admin": true,
    "return": [
      "cityName": "Mumbai",
      "travel": ["type": "None"]
    ]
  ],
  "EmployeeCode": "0001"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/trips/create")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```