# Finalize checkout process for a trip

> For the complete documentation index, see [llms.txt](https://developer.fluxir.com/llms.txt).

**POST** `/api/app/trip/{id}/finalize-checkout`

## Authorization

- oidc (openIdConnect)

## Header parameters

- `X-Tenant` (string)
  Tenant ID

## Path parameters

- `id` (integer, required)

## Responses

### 200

OK

- `id` (integer<int64>)
- `serviceApplications` (object[])
  - `id` (integer<int64>)
  - `personName` (string)
  - `personId` (integer<int64>)
  - `serviceType` ("Visa" | "Insurance" | "AirportLounge" | "FastTrack" | "Esim" | "FlightItineraryLetter" | "HotelItineraryLetter")
  - `providerName` (string)
  - `serviceIntentKey` (string)
  - `destinationCode` (string)
  - `originationCode` (string)
  - `description` (string)
  - `price` (integer<int32>)
  - `creationTime` (string<date-time>)
  - `state` ("Draft" | "ReadyForPayment" | "ReadyForReview" | "InReview" | "ReadyForApplication" | "ReviewFailed" | "Appointment" | "Applied" | "ApplicationRejected" | "ApplicationConfirmed" | "Cancelled" | "Aborted" | "InitialApprove")
  - `checkoutStatus` ("Unknown" | "Open" | "Completed" | "Expired")
  - `hasDownloadableContent` (boolean)
  - `serviceTypeId` (integer<int64>)
  - `documentsSchemeVersionId` (integer<int64>)
  - `applyingTime` (string<date-time>)
  - `dueDate` (string<date>)
  - `expectedCompletionDate` (string<date>)
  - `issuanceTime` (string<date-time>)
  - `tenantId` (string<uuid>)
  - `tripId` (integer<int64>)
  - `appointments` (object[])
    - `id` (integer<int64>)
    - `status` ("Pending" | "Scheduled" | "Accomplished" | "Canceled")
    - `visitDate` (string<date>)
    - `visitTime` (string<time>)
    - `address` (string)
    - `notes` (string)
    - `tenantId` (string<uuid>)
- `visaType` (object)
  - `id` (integer<int64>)
  - `isJoint` (boolean)
  - `destinationCountry` (string)
  - `destinationCountries` (string[])
  - `restrictionMode` ("None" | "Allow" | "Deny")
  - `restrictedOriginationCountryCodes` (string[])
  - `name` (string)
  - `description` (string)
  - `categoryName` (string)
  - `entryLimitation` ("Single" | "Multi" | "Double")
  - `validityPeriod` (integer<int32>)
  - `validityPeriodUnit` ("Days" | "Weeks" | "Months" | "Years")
  - `stayDuration` (integer<int32>)
  - `stayDurationUnit` ("Days" | "Weeks" | "Months" | "Years")
  - `applicationMethod` ("VisaFree" | "Online" | "Embassy" | "OnArrival" | "NotApplicable")
  - `tags` (string[])
  - `requirements` (string)
  - `versions` (object[])
    - `id` (integer<int64>)
    - `name` (string)
    - `description` (string)
    - `state` ("InDevelopment" | "NeedReview" | "PublishCandidate" | "Published" | "Paused" | "Revoked")
    - `ownerType` ("None" | "Visa" | "Passport" | "Insurance" | "TravelServiceProvider" | "FlightItineraryLetter" | "HotelItineraryLetter" | "TravelerProfile" | "AirportLounge" | "FastTrack")
    - `lastModificationTime` (string<date-time>)
    - `applicationFormTemplates` (object[])
      - `id` (integer<int64>)
      - `documentsSchemeVersionId` (integer<int64>)
      - `countryCode` (string)
      - `documentFileId` (integer<int64>)
      - `templateItems` (object[])
        - `id` (integer<int64>)
        - `applicationFormTemplateId` (integer<int64>)
        - `nameId` (string)
        - `value` (string)
        - `pageNumber` (integer<int32>)
        - `xCoordinate` (number<double>)
        - `yCoordinate` (number<double>)
        - `fontSize` (number<float>)
        - `isBold` (boolean)
        - `isItalic` (boolean)
        - `isUnderlined` (boolean)
        - `isPinned` (boolean)
        - `repetitiveItemMargin` (number<float>)
        - `resizable` (boolean)
        - `width` (number<float>)
        - `height` (number<float>)
        - `withLabel` (boolean)
        - `labelPosition` ("Left" | "Top")
        - `labelSize` (number<float>)
        - `labelFontSize` (number<float>)
        - `labelBold` (boolean)
        - `labelItalic` (boolean)
        - `labelUnderlined` (boolean)
        - `previewContent` (string)
      - `templateSections` (object[])
        - `id` (integer<int64>)
        - `nameId` (string)
        - `marginTop` (number<double>)
      - `defaultFontSize` (number<float>)
      - `isDynamic` (boolean)
      - `defaultRepetitiveItemMargin` (number<float>)
    - `onlineFormTemplates` (object[])
      - `id` (integer<int64>)
      - `documentsSchemeVersionId` (integer<int64>)
      - `countryCode` (string)
      - `url` (string)
      - `items` (object[])
        - `id` (integer<int64>)
        - `nameId` (string)
        - `path` (string)
  - `onlineApplicationUrl` (string)
  - `conditionalExemptions` (object[])
    - `id` (integer<int64>)
    - `originationCountryCode` (string)
    - `documentType` ("ResidencePermit" | "ThirdCountryVisa")
    - `documentCountryCode` (string)
    - `documentSubtype` (string)
    - `conditionsText` (string)
    - `internalNotes` (string)
    - `minimumValidityMonths` (integer<int32>)
    - `isActive` (boolean)
  - `documentEligibilities` (object[])
    - `id` (integer<int64>)
    - `visaTypeId` (integer<int64>)
    - `originationCountryCode` (string)
    - `documentTypeId` (integer<int64>)
    - `documentTypeName` (string)
- `originationCode` (string)
- `destinationCode` (string)
- `description` (string)
- `notes` (string)
- `from` (string<date>)
- `to` (string<date>)
- `tenantId` (string<uuid>)

Example:

```json
{
  "id": 0,
  "serviceApplications": [
    {
      "id": 0,
      "personName": "string",
      "personId": 0,
      "serviceType": "Visa",
      "providerName": "string",
      "serviceIntentKey": "string",
      "destinationCode": "string",
      "originationCode": "string",
      "description": "string",
      "price": 0,
      "creationTime": "1970-01-01T00:00:00.000Z",
      "state": "Draft",
      "checkoutStatus": "Unknown",
      "hasDownloadableContent": true,
      "serviceTypeId": 0,
      "documentsSchemeVersionId": 0,
      "applyingTime": "1970-01-01T00:00:00.000Z",
      "dueDate": "2024-01-01",
      "expectedCompletionDate": "2024-01-01",
      "issuanceTime": "1970-01-01T00:00:00.000Z",
      "tenantId": "00000000-0000-0000-0000-000000000000",
      "tripId": 0,
      "appointments": [
        {
          "id": 0,
          "status": "Pending",
          "visitDate": "2024-01-01",
          "visitTime": "string",
          "address": "string",
          "notes": "string",
          "tenantId": "00000000-0000-0000-0000-000000000000"
        }
      ]
    }
  ],
  "visaType": {
    "id": 0,
    "isJoint": true,
    "destinationCountry": "string",
    "destinationCountries": [
      "string"
    ],
    "restrictionMode": "None",
    "restrictedOriginationCountryCodes": [
      "string"
    ],
    "name": "string",
    "description": "string",
    "categoryName": "string",
    "entryLimitation": "Single",
    "validityPeriod": 0,
    "validityPeriodUnit": "Days",
    "stayDuration": 0,
    "stayDurationUnit": "Days",
    "applicationMethod": "VisaFree",
    "tags": [
      "string"
    ],
    "requirements": "string",
    "versions": [
      {
        "id": 0,
        "name": "string",
        "description": "string",
        "state": "InDevelopment",
        "ownerType": "None",
        "lastModificationTime": "1970-01-01T00:00:00.000Z",
        "applicationFormTemplates": [
          {
            "id": 0,
            "documentsSchemeVersionId": 0,
            "countryCode": "string",
            "documentFileId": 0,
            "templateItems": [
              null
            ],
            "templateSections": [
              null
            ],
            "defaultFontSize": 0,
            "isDynamic": true,
            "defaultRepetitiveItemMargin": 0
          }
        ],
        "onlineFormTemplates": [
          {
            "id": 0,
            "documentsSchemeVersionId": 0,
            "countryCode": "string",
            "url": "string",
            "items": [
              null
            ]
          }
        ]
      }
    ],
    "onlineApplicationUrl": "string",
    "conditionalExemptions": [
      {
        "id": 0,
        "originationCountryCode": "string",
        "documentType": "ResidencePermit",
        "documentCountryCode": "string",
        "documentSubtype": "string",
        "conditionsText": "string",
        "internalNotes": "string",
        "minimumValidityMonths": 0,
        "isActive": true
      }
    ],
    "documentEligibilities": [
      {
        "id": 0,
        "visaTypeId": 0,
        "originationCountryCode": "string",
        "documentTypeId": 0,
        "documentTypeName": "string"
      }
    ]
  },
  "originationCode": "string",
  "destinationCode": "string",
  "description": "string",
  "notes": "string",
  "from": "2024-01-01",
  "to": "2024-01-01",
  "tenantId": "00000000-0000-0000-0000-000000000000"
}
```

### 400

Bad Request

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 401

Unauthorized

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 403

Forbidden

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 404

Not Found

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 500

Internal Server Error

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 501

Not Implemented

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```