# /createCompleteReservation

[block:api-header]
{
  "title": "Description:"
}
[/block]

This request bundles the functionality of createReservation and completeReservation together.
It's advisable to use this end-point when your application create & completes in the same second.

**Contactinfo required**
for some clients it is mandatory to add contact info to this request.
Below is the list of clients where this information is required.
Clients

[block:parameters]
{
  "data": {
    "0-0": "Maddame Taussade Amsterdam\nAmstedam Dungeon",
    "0-1": "01-01-2023\n01-01-2023",
    "h-0": "Museum name:",
    "h-1": "Requested as of:"
  },
  "cols": 2,
  "rows": 1
}
[/block]

**HMAC calculation**
Base64 encode - SHA256(apiKey + customerEmailAddress + customerFirstName + customerSurname + environment + ticketDate + ticketTime + tickets + userId)

* Sort the sign data alphabetical ascending, you can also find the sequence on the concerned API specification page.

Please note: optional fields only needs to be included when an optional field is used.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Global Reseller",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://globalreseller.nl/webservices/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/createCompleteReservation": {
      "post": {
        "summary": "/createCompleteReservation",
        "description": "",
        "operationId": "createcompletereservation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apiKey",
                  "environment",
                  "userId",
                  "tickets",
                  "ticketTypeId",
                  "ticketNumber",
                  "HMACKey"
                ],
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "description": "Your public apiKey needs to be included in every request."
                  },
                  "environment": {
                    "type": "string",
                    "description": "\"test\" or \"production\"",
                    "enum": [
                      "production",
                      "test"
                    ]
                  },
                  "userId": {
                    "type": "integer",
                    "description": "The userId is a reference to the user (museum / attraction). The userId can be requested via getAvailableUsers and can be cached in your application.",
                    "format": "int32"
                  },
                  "tickets": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int32"
                    }
                  },
                  "ticketTypeId": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "ticketNumber": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "TicketDate": {
                    "type": "string",
                    "description": "24 hours format (hh:mm), this field is optional based on the user.",
                    "format": "date"
                  },
                  "customerFirstName": {
                    "type": "string",
                    "description": "Firstname of the customer (Please read \"Contactinfo required\" below)"
                  },
                  "customerSurname": {
                    "type": "string",
                    "description": "Surname of the customer (Please read \"Contactinfo required\" below)"
                  },
                  "customerEmailAddress": {
                    "type": "string",
                    "description": "Email address of the customer (Please read \"Contactinfo required\" below)"
                  },
                  "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\":false,\n   \"error message\":\"text\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "error message": {
                      "type": "string",
                      "example": "text"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Cache-Control",
        "value": "no-cache"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62b068c7795387013326be5c:62b1c7d05bd30c051d3af553"
}
```