> 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.

# Cancel Booking

POST https://heimdall.eka.io/apis/external/bookings/cancel
Content-Type: application/json

### Cancel Booking

Cancels a booking previously pushed through the Booking APIs. The booking status becomes `CANCELLED` and the linked trip leg is released, so a new booking can be pushed for it. Only bookings created through these APIs can be cancelled (`403` otherwise); cancelling an already cancelled booking returns `409`. Optional `refundAmount` is saved on the booking; it must be between `0` and the booking amount (`400` otherwise). If only `cancellationCharges` is sent, the refund is calculated as booking amount − charges. Optional `cancellationCharges` and `creditNote` are stored on the booking and returned under `fields` (`refund_amount`, `cancellation_charges`, `credit_note_*`); `creditNote.creditNotePdf` is attached under `files` as **Credit Note**. Negative amounts are rejected with `409`.

### Request Parameters

| Param | Required | Description |
| --- | --- | --- |
| transId | Mandatory | Your booking reference used at creation. |
| remarks | Optional | Reason for cancellation. |
| refundAmount | Optional | Amount refunded for the cancellation. Saved on the booking. Must be between `0` and the booking amount. If omitted and `cancellationCharges` is sent, it is calculated as booking amount − `cancellationCharges`. |
| cancellationCharges | Optional | Cancellation charges deducted by the vendor / airline. Cannot be negative. |
| creditNote | Optional | Credit note details for the cancellation. Fields: `creditNoteNo`, `creditNoteDate`, `originalInvoiceNo`, `originalInvoiceDate`, `vendorGstin`, `customerGstin`, `hsn`, `reason`, `taxableAmount`, `cgst`, `sgst`, `igst`, `totalTax`, `totalAmount`, `creditNotePdf`. |

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

## 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) — Company Code of client
- `X-CLIENT-ID` (string, optional) — API Client ID
- `X-CLIENT-SECRET` (string, optional) — API Client Secret

### Body (application/json)

This endpoint expects an object.

- `transId` (string, required) — Your booking reference used at creation.
- `remarks` (string, optional) — Reason for cancellation.
- `refundAmount` (double, optional) — Amount refunded for the cancellation. Saved on the booking. Must be between `0` and the booking amount. If omitted and `cancellationCharges` is sent, it is calculated as booking amount − `cancellationCharges`.
- `cancellationCharges` (double, optional) — Cancellation charges deducted by the vendor / airline. Cannot be negative.
- `creditNote` (ApisExternalBookingsCancelPostRequestBodyContentApplicationJsonSchemaCreditNote, optional) — Credit note details for the cancellation.

## Response

### 200

OK

- `success` (boolean, optional) — Always `true` on HTTP 200.
- `transId` (string, optional) — Your booking reference.
- `transactionId` (long, optional) — Internal Dice transaction id.
- `service` (enum, optional) — Booking type.
  - Allowed values: `Flight`, `Hotel`, `Bus`
- `amount` (double, optional) — Booking amount.
- `refundAmount` (double, optional) — Refund amount saved on the booking (`0.0` when no refund was recorded).
- `currency` (string, optional) — Currency.
- `bookingStatus` (enum, optional) — Booking status.
  - Allowed values: `BOOKED`, `CANCELLED`
- `expenseStatus` (long, optional) — Expense status code: `3` = booked / active, `7` = cancelled.
- `bookingDate` (long, optional) — Booking date. Epoch time in **milliseconds** (UTC).
- `tripId` (string, optional) — Attached trip.
- `tripItineraryId` (string, optional) — Attached itinerary leg.
- `fields` (map from string to string, optional) — All captured booking attributes as key/value strings (PNR, airline, invoice fields, cancellation info, …).
- `files` (list of ApisExternalBookingsCancelPostResponsesContentApplicationJsonSchemaFilesItems, optional) — Ticket / invoice attachments.
- `ticket` (ApisExternalBookingsCancelPostResponsesContentApplicationJsonSchemaTicket, optional) — Structured ticket (flight / hotel / bus) as stored in Dice. Shape depends on `service`.

## Types

### ApisExternalBookingsCancelPostRequestBodyContentApplicationJsonSchemaCreditNote

Credit note details for the cancellation.

- `creditNoteNo` (string, optional) — Credit note number.
- `creditNoteDate` (long, optional) — Credit note date. Epoch time in **milliseconds** (UTC).
- `originalInvoiceNo` (string, optional) — Invoice number of the original booking the credit note is raised against.
- `originalInvoiceDate` (long, optional) — Date of the original invoice. Epoch time in **milliseconds** (UTC).
- `vendorGstin` (string, optional) — GSTIN of the vendor / TMC issuing the credit note.
- `customerGstin` (string, optional) — GSTIN of your company on the credit note.
- `hsn` (string, optional) — HSN / SAC code.
- `reason` (string, optional) — Reason printed on the credit note.
- `taxableAmount` (double, optional) — Taxable value of the credit note.
- `cgst` (double, optional) — CGST amount.
- `sgst` (double, optional) — SGST amount.
- `igst` (double, optional) — IGST amount.
- `totalTax` (double, optional) — Total tax on the credit note.
- `totalAmount` (double, optional) — Credit note total (taxable value + tax).
- `creditNotePdf` (string, optional) — URL of the credit note PDF. Stored as sent and attached to the booking as **Credit Note**.

### ApisExternalBookingsCancelPostResponsesContentApplicationJsonSchemaFilesItems

Attached file.

- `Id` (string, optional) — File id (note the capital `I`).
- `type` (string, optional) — File type.
- `title` (enum, optional) — `Ticket` or `Invoice`.
  - Allowed values: `Ticket`, `Invoice`
- `path` (string, optional) — File URL.

### ApisExternalBookingsCancelPostResponsesContentApplicationJsonSchemaTicket

Structured ticket (flight / hotel / bus) as stored in Dice. Shape depends on `service`.

## Examples

### All fields

**Request**

```json
{
  "transId": "EXT-FLT-50001",
  "remarks": "Trip postponed by client",
  "refundAmount": 4540,
  "cancellationCharges": 2000,
  "creditNote": {
    "creditNoteNo": "CN/2026/11/00042",
    "creditNoteDate": 1793853900000,
    "originalInvoiceNo": "INV/2026/11/00871",
    "originalInvoiceDate": 1793614500000,
    "vendorGstin": "27AAACI1234A1Z5",
    "customerGstin": "29AABCA9876K1Z2",
    "hsn": "996425",
    "reason": "Booking cancelled",
    "taxableAmount": 3847.46,
    "cgst": 346.27,
    "sgst": 346.27,
    "igst": 0,
    "totalTax": 692.54,
    "totalAmount": 4540,
    "creditNotePdf": "https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"
  }
}
```

**Response**

```json
{
  "success": true,
  "transId": "EXT-FLT-50001",
  "transactionId": 7712093,
  "service": "Flight",
  "amount": 6540,
  "refundAmount": 4540,
  "currency": "INR",
  "bookingStatus": "CANCELLED",
  "expenseStatus": 7,
  "bookingDate": 1793614500000,
  "tripId": "EXT-TRIP-1001",
  "tripItineraryId": "3f6a1c2e-9b7d-4e21-8c55-1a2b3c4d5e6f",
  "fields": {
    "airline": "IndiGo",
    "bookingDate": "1793614500000",
    "cancelRemarks": "Trip postponed by client",
    "cancellation_charges": "2000.0",
    "cancelledAt": "1793853900000",
    "cancelledBy": "EXTERNAL_API",
    "credit_note_amount": "4540.0",
    "credit_note_cgst": "346.27",
    "credit_note_customer_gstin": "29AABCA9876K1Z2",
    "credit_note_date": "1793853900000",
    "credit_note_hsn": "996425",
    "credit_note_igst": "0.0",
    "credit_note_no": "CN/2026/11/00042",
    "credit_note_original_invoice_date": "1793614500000",
    "credit_note_original_invoice_no": "INV/2026/11/00871",
    "credit_note_reason": "Booking cancelled",
    "credit_note_sgst": "346.27",
    "credit_note_taxable_amount": "3847.46",
    "credit_note_total_tax": "692.54",
    "credit_note_vendor_gstin": "27AAACI1234A1Z5",
    "departure.nano": "1794274200000",
    "flightNumber": "6E 5321",
    "journeyType": "ONE_WAY",
    "passengerNames": "Rahul Sharma",
    "pnr": "X7K9QP",
    "refund_amount": "4540.0",
    "source": "EXTERNAL_API"
  },
  "files": [
    {
      "Id": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff",
      "type": "OTHER",
      "title": "Ticket",
      "path": "https://files.acme.com/tickets/EXT-FLT-50001.pdf"
    },
    {
      "Id": "c3d4e5f6-a7b8-4911-8a2b-ccddeeff0011",
      "type": "OTHER",
      "title": "Credit Note",
      "path": "https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"
    }
  ],
  "ticket": {
    "airline": "IndiGo",
    "bookingId": "EXT-FLT-50001",
    "bookingStatus": "BOOKED",
    "destination": "BLR",
    "journeyType": "ONE_WAY",
    "origin": "BOM",
    "plugin": "EXTERNAL_API",
    "tripId": "EXT-TRIP-1001"
  }
}
```

**SDK Code**

```python All fields
import requests

url = "https://heimdall.eka.io/apis/external/bookings/cancel"

payload = {
    "transId": "EXT-FLT-50001",
    "remarks": "Trip postponed by client",
    "refundAmount": 4540,
    "cancellationCharges": 2000,
    "creditNote": {
        "creditNoteNo": "CN/2026/11/00042",
        "creditNoteDate": 1793853900000,
        "originalInvoiceNo": "INV/2026/11/00871",
        "originalInvoiceDate": 1793614500000,
        "vendorGstin": "27AAACI1234A1Z5",
        "customerGstin": "29AABCA9876K1Z2",
        "hsn": "996425",
        "reason": "Booking cancelled",
        "taxableAmount": 3847.46,
        "cgst": 346.27,
        "sgst": 346.27,
        "igst": 0,
        "totalTax": 692.54,
        "totalAmount": 4540,
        "creditNotePdf": "https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"
    }
}
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 All fields
const url = 'https://heimdall.eka.io/apis/external/bookings/cancel';
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: '{"transId":"EXT-FLT-50001","remarks":"Trip postponed by client","refundAmount":4540,"cancellationCharges":2000,"creditNote":{"creditNoteNo":"CN/2026/11/00042","creditNoteDate":1793853900000,"originalInvoiceNo":"INV/2026/11/00871","originalInvoiceDate":1793614500000,"vendorGstin":"27AAACI1234A1Z5","customerGstin":"29AABCA9876K1Z2","hsn":"996425","reason":"Booking cancelled","taxableAmount":3847.46,"cgst":346.27,"sgst":346.27,"igst":0,"totalTax":692.54,"totalAmount":4540,"creditNotePdf":"https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"}}'
};

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

```go All fields
package main

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

func main() {

	url := "https://heimdall.eka.io/apis/external/bookings/cancel"

	payload := strings.NewReader("{\n  \"transId\": \"EXT-FLT-50001\",\n  \"remarks\": \"Trip postponed by client\",\n  \"refundAmount\": 4540,\n  \"cancellationCharges\": 2000,\n  \"creditNote\": {\n    \"creditNoteNo\": \"CN/2026/11/00042\",\n    \"creditNoteDate\": 1793853900000,\n    \"originalInvoiceNo\": \"INV/2026/11/00871\",\n    \"originalInvoiceDate\": 1793614500000,\n    \"vendorGstin\": \"27AAACI1234A1Z5\",\n    \"customerGstin\": \"29AABCA9876K1Z2\",\n    \"hsn\": \"996425\",\n    \"reason\": \"Booking cancelled\",\n    \"taxableAmount\": 3847.46,\n    \"cgst\": 346.27,\n    \"sgst\": 346.27,\n    \"igst\": 0,\n    \"totalTax\": 692.54,\n    \"totalAmount\": 4540,\n    \"creditNotePdf\": \"https://files.acme.com/credit-notes/EXT-FLT-50001.pdf\"\n  }\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 All fields
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/bookings/cancel")

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  \"transId\": \"EXT-FLT-50001\",\n  \"remarks\": \"Trip postponed by client\",\n  \"refundAmount\": 4540,\n  \"cancellationCharges\": 2000,\n  \"creditNote\": {\n    \"creditNoteNo\": \"CN/2026/11/00042\",\n    \"creditNoteDate\": 1793853900000,\n    \"originalInvoiceNo\": \"INV/2026/11/00871\",\n    \"originalInvoiceDate\": 1793614500000,\n    \"vendorGstin\": \"27AAACI1234A1Z5\",\n    \"customerGstin\": \"29AABCA9876K1Z2\",\n    \"hsn\": \"996425\",\n    \"reason\": \"Booking cancelled\",\n    \"taxableAmount\": 3847.46,\n    \"cgst\": 346.27,\n    \"sgst\": 346.27,\n    \"igst\": 0,\n    \"totalTax\": 692.54,\n    \"totalAmount\": 4540,\n    \"creditNotePdf\": \"https://files.acme.com/credit-notes/EXT-FLT-50001.pdf\"\n  }\n}"

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

```java All fields
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/bookings/cancel")
  .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  \"transId\": \"EXT-FLT-50001\",\n  \"remarks\": \"Trip postponed by client\",\n  \"refundAmount\": 4540,\n  \"cancellationCharges\": 2000,\n  \"creditNote\": {\n    \"creditNoteNo\": \"CN/2026/11/00042\",\n    \"creditNoteDate\": 1793853900000,\n    \"originalInvoiceNo\": \"INV/2026/11/00871\",\n    \"originalInvoiceDate\": 1793614500000,\n    \"vendorGstin\": \"27AAACI1234A1Z5\",\n    \"customerGstin\": \"29AABCA9876K1Z2\",\n    \"hsn\": \"996425\",\n    \"reason\": \"Booking cancelled\",\n    \"taxableAmount\": 3847.46,\n    \"cgst\": 346.27,\n    \"sgst\": 346.27,\n    \"igst\": 0,\n    \"totalTax\": 692.54,\n    \"totalAmount\": 4540,\n    \"creditNotePdf\": \"https://files.acme.com/credit-notes/EXT-FLT-50001.pdf\"\n  }\n}")
  .asString();
```

```php All fields
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/bookings/cancel', [
  'body' => '{
  "transId": "EXT-FLT-50001",
  "remarks": "Trip postponed by client",
  "refundAmount": 4540,
  "cancellationCharges": 2000,
  "creditNote": {
    "creditNoteNo": "CN/2026/11/00042",
    "creditNoteDate": 1793853900000,
    "originalInvoiceNo": "INV/2026/11/00871",
    "originalInvoiceDate": 1793614500000,
    "vendorGstin": "27AAACI1234A1Z5",
    "customerGstin": "29AABCA9876K1Z2",
    "hsn": "996425",
    "reason": "Booking cancelled",
    "taxableAmount": 3847.46,
    "cgst": 346.27,
    "sgst": 346.27,
    "igst": 0,
    "totalTax": 692.54,
    "totalAmount": 4540,
    "creditNotePdf": "https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"
  }
}',
  '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 All fields
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/bookings/cancel");
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  \"transId\": \"EXT-FLT-50001\",\n  \"remarks\": \"Trip postponed by client\",\n  \"refundAmount\": 4540,\n  \"cancellationCharges\": 2000,\n  \"creditNote\": {\n    \"creditNoteNo\": \"CN/2026/11/00042\",\n    \"creditNoteDate\": 1793853900000,\n    \"originalInvoiceNo\": \"INV/2026/11/00871\",\n    \"originalInvoiceDate\": 1793614500000,\n    \"vendorGstin\": \"27AAACI1234A1Z5\",\n    \"customerGstin\": \"29AABCA9876K1Z2\",\n    \"hsn\": \"996425\",\n    \"reason\": \"Booking cancelled\",\n    \"taxableAmount\": 3847.46,\n    \"cgst\": 346.27,\n    \"sgst\": 346.27,\n    \"igst\": 0,\n    \"totalTax\": 692.54,\n    \"totalAmount\": 4540,\n    \"creditNotePdf\": \"https://files.acme.com/credit-notes/EXT-FLT-50001.pdf\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift All fields
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 = [
  "transId": "EXT-FLT-50001",
  "remarks": "Trip postponed by client",
  "refundAmount": 4540,
  "cancellationCharges": 2000,
  "creditNote": [
    "creditNoteNo": "CN/2026/11/00042",
    "creditNoteDate": 1793853900000,
    "originalInvoiceNo": "INV/2026/11/00871",
    "originalInvoiceDate": 1793614500000,
    "vendorGstin": "27AAACI1234A1Z5",
    "customerGstin": "29AABCA9876K1Z2",
    "hsn": "996425",
    "reason": "Booking cancelled",
    "taxableAmount": 3847.46,
    "cgst": 346.27,
    "sgst": 346.27,
    "igst": 0,
    "totalTax": 692.54,
    "totalAmount": 4540,
    "creditNotePdf": "https://files.acme.com/credit-notes/EXT-FLT-50001.pdf"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/bookings/cancel")! 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()
```

### Mandatory fields only

**Request**

```json
{
  "transId": "EXT-FLT-50001"
}
```

**Response**

```json
{
  "success": true,
  "transId": "EXT-FLT-50001",
  "transactionId": 7712093,
  "service": "Flight",
  "amount": 6540,
  "refundAmount": 0,
  "currency": "INR",
  "bookingStatus": "CANCELLED",
  "expenseStatus": 7,
  "bookingDate": 1793614500000,
  "tripId": "EXT-TRIP-1001",
  "tripItineraryId": "3f6a1c2e-9b7d-4e21-8c55-1a2b3c4d5e6f",
  "fields": {
    "airline": "IndiGo",
    "bookingDate": "1793614500000",
    "cancelledAt": "1793853900000",
    "cancelledBy": "EXTERNAL_API",
    "departure.nano": "1794274200000",
    "flightNumber": "6E 5321",
    "journeyType": "ONE_WAY",
    "passengerNames": "Rahul Sharma",
    "pnr": "X7K9QP",
    "source": "EXTERNAL_API"
  },
  "files": [
    {
      "Id": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff",
      "type": "OTHER",
      "title": "Ticket",
      "path": "https://files.acme.com/tickets/EXT-FLT-50001.pdf"
    }
  ],
  "ticket": {
    "airline": "IndiGo",
    "bookingId": "EXT-FLT-50001",
    "bookingStatus": "BOOKED",
    "destination": "BLR",
    "journeyType": "ONE_WAY",
    "origin": "BOM",
    "plugin": "EXTERNAL_API",
    "tripId": "EXT-TRIP-1001"
  }
}
```

**SDK Code**

```python Mandatory fields only
import requests

url = "https://heimdall.eka.io/apis/external/bookings/cancel"

payload = { "transId": "EXT-FLT-50001" }
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 Mandatory fields only
const url = 'https://heimdall.eka.io/apis/external/bookings/cancel';
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: '{"transId":"EXT-FLT-50001"}'
};

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

```go Mandatory fields only
package main

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

func main() {

	url := "https://heimdall.eka.io/apis/external/bookings/cancel"

	payload := strings.NewReader("{\n  \"transId\": \"EXT-FLT-50001\"\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 Mandatory fields only
require 'uri'
require 'net/http'

url = URI("https://heimdall.eka.io/apis/external/bookings/cancel")

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  \"transId\": \"EXT-FLT-50001\"\n}"

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

```java Mandatory fields only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://heimdall.eka.io/apis/external/bookings/cancel")
  .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  \"transId\": \"EXT-FLT-50001\"\n}")
  .asString();
```

```php Mandatory fields only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://heimdall.eka.io/apis/external/bookings/cancel', [
  'body' => '{
  "transId": "EXT-FLT-50001"
}',
  '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 Mandatory fields only
using RestSharp;

var client = new RestClient("https://heimdall.eka.io/apis/external/bookings/cancel");
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  \"transId\": \"EXT-FLT-50001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Mandatory fields only
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 = ["transId": "EXT-FLT-50001"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://heimdall.eka.io/apis/external/bookings/cancel")! 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()
```