# /cancelReservation

## Description:

With this functionality you can cancel an earlier created reservation. Please note that you can only cancel a completed reservation.

**HMAC calculation:**\
Base64 encode - SHA256(apiKey + reservationId\*)

* only include optional params in the HMAC if you are using those params.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Scan API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://globalticket.com/webservices/scanapi"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/cancelReservation": {
      "post": {
        "summary": "/cancelReservation",
        "description": "",
        "operationId": "completereservation-copy",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "apiKey",
                  "reservationId",
                  "HMACKey"
                ],
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "description": "Your public apiKey needs to be included in every request."
                  },
                  "reservationId": {
                    "type": "integer",
                    "description": "Reservation identifier that is provided by createReservation call",
                    "format": "int32"
                  },
                  "HMACKey": {
                    "type": "string",
                    "description": "The HMACKey is calculated based on the input fields"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n   \"success\":true,\n   \"reservationId\": 1,\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\":false,\n\t\"errorMessage\":\"Reservation not found or already cancelled.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "Reservation not found or already cancelled."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62b1d31f161f1601e7ec3d31:6a1984e12579297c98deced4"
}
```