# Creating a New Trip

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

This tutorial shows you how to create and submit a service application for a new trip in Fluxir. It guides you through the process of creating a new service application in Fluxir.

At a high level, integrating with Fluxir follows a simple flow: you first <strong>search</strong> for the service the traveler needs (Fluxir returns <strong>service intents</strong>), then you <strong>create a trip</strong> based on the chosen service intent, <strong>provide the required traveler and trip details</strong>, and finally <strong>complete the configured billing step</strong> before submission or processing.

Before any paid submission, check the tenant's current billing readiness using the [API Billing Readiness guide](https://developer.fluxir.com/api-guides/billing-readiness/). Headless API integrations should treat readiness as advisory and follow the configured administrator or support next step; they should not assume a portal Stripe Checkout flow is required for every tenant.

<strong>Key steps</strong>

1. <strong>Search for the desired service</strong> — the search response contains one or more <strong>service intents</strong> (available services you can apply for).

2. <strong>Create a new trip</strong> by selecting a service intent and providing its details (the chosen service intent identifies what will be applied for).

3. <strong>Fill in the application data</strong> — complete all <strong>mandatory</strong> fields and any <strong>optional but recommended</strong> fields to avoid delays during review.

4. <strong>Check billing readiness and complete the configured approval or payment step</strong> for the tenant before submission. For interactive portal billing, Stripe Checkout is a portal workflow; headless API clients should use the readiness result and approved administrator guidance instead of assuming Checkout is the universal path.

5. <strong>Submit the application</strong> — once the tenant is ready and the service application passes validation, our team reviews the application and proceeds with processing.

## Workflow

**1.**

### Retrieve Service Intents

Send a POST request to retrieve service intents for a specific trip context:

**[Get Service Intents](https://developer.fluxir.com/api/post-travel-services-service-intents/)**

> **Supported Countries**
>
> Use the [Get all supported countries for trip planning](https://developer.fluxir.com/api/get-trip-countries/) or refer to the [Supported Countries](https://developer.fluxir.com/api/introduction/reference/supported-countries/) for a list of countries available for planning a trip.

**Request**

```sh
curl -X POST 'https://api.fluxir.com/api/app/travel-services/service-intents' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>' \
  --data-raw '{
    "serviceTypesFilter": [],
    "tripContext": {
      "items": {
        "system.tripFrom": "2025-07-30",
        "system.tripTo":   "2025-08-20",
        "system.tripOrigination": "JOR",
        "system.tripDestination": "ARE"
      },
      "travelerContexts": []
    },
    "inputRestrictionMode": "ByPassOnMissing",
    "continuationToken": ""
  }'
```

**Response**

```json
{
  "items": [
    {
      "serviceType": "Insurance",
      "provider": "TamkeenInsurance",
      "destinationCountryCode": null,
      "serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
      "title": "Insurance",
      "description": "Tamkeen Insurance",
      "info": "75000$ Coverage - Trip Cancellation - Lugguage Cover",
      "tags": [],
      "documentSchemeVersionId": 781,
      "pricingRecords": [
        {
          "serviceType": "Insurance",
          "referenceId": null,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Insurance Fee",
          "fee": 0,
          "commission": 0,
          "code": null
        }
      ],
      "serviceTypeId": null,
      "fee": 0,
      "callToActions": [],
      "extraProperties": {
        "stayDuration": "90",
        "stayDurationUnit": "Days"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-2",
      "title": "United Arab Emirates eVisa",
      "description": "United Arab Emirates eVisa",
      "info": "A one month tourist visa for the United Arab Emirates allows an individual to visit the UAE for a period of up to 30 days. This type of visa is typically issued for single entry, meaning that the holder can only enter the UAE once during the validity of the visa. The purpose of the visit must be tourism or business, and the visa holder is not allowed to work or engage in any other activities that are not related to tourism or business.",
      "tags": [],
      "documentSchemeVersionId": 792,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 2,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Government Fee",
          "fee": 86,
          "commission": 0,
          "code": "GOV-1"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application",
          "fee": 35,
          "commission": 0,
          "code": "VisaComplexityLow_Individual"
        }
      ],
      "serviceTypeId": 2,
      "fee": 121,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "497",
        "approvalRate": "98",
        "stayDuration": "30",
        "stayDurationUnit": "Days",
        "validityPeriod": "2",
        "validityPeriodUnit": "Months",
        "requirements": "Mandatory requirements

Completed application form
6x6cm photograph in colour (minimum of 600x600 pixels) with a white background (at least 80% of your face should be visible)
Colour copy of your passport showing your full name, nationality, date and place of birth, passport number, date of issue and expiry, name of father / legal guardian, and the name of your mother
Valid passport with at least six months validity at the time of travel
Confirmed ticket travelling into Abu Dhabi Airport and onwards from Abu Dhabi to a third destination
",
        "visaFormat": "eVisa",
        "entries": "Single",
        "expectedProcessingTimeUnit": "Day(s)",
        "expectedProcessingTime": "3"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-4",
      "title": "United Arab Emirates eVisa",
      "description": "United Arab Emirates eVisa",
      "info": "Tourism visa 2 months",
      "tags": [],
      "documentSchemeVersionId": 793,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 4,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Government Fee",
          "fee": 220,
          "commission": 0,
          "code": "GOV-3"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application Fee (Individual)",
          "fee": 0,
          "commission": 0,
          "code": "VisaComplexityNone_Individual"
        }
      ],
      "serviceTypeId": 4,
      "fee": 220,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "6",
        "approvalRate": "83",
        "stayDuration": "60",
        "stayDurationUnit": "Days",
        "validityPeriod": "2",
        "validityPeriodUnit": "Months",
        "requirements": "Mandatory requirements

Completed application form
6x6cm photograph in colour (minimum of 600x600 pixels) with a white background (at least 80% of your face should be visible)
Colour copy of your passport showing your full name, nationality, date and place of birth, passport number, date of issue and expiry, name of father / legal guardian, and the name of your mother
Valid passport with at least six months validity at the time of travel
Confirmed ticket travelling into Abu Dhabi Airport and onwards from Abu Dhabi to a third destination",
        "visaFormat": "eVisa",
        "entries": "Single",
        "expectedProcessingTimeUnit": "Day(s)",
        "expectedProcessingTime": "3"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-25",
      "title": " United Arab Emirates eVisa (Urgent)",
      "description": " United Arab Emirates eVisa (Urgent)",
      "info": "Urgent one month tourist visa for the United Arab Emirates allows an individual to visit the UAE for a period of up to 30 days. This type of visa is typically issued for single entry, meaning that the holder can only enter the UAE once during the validity of the visa. The purpose of the visit must be tourism or business, and the visa holder is not allowed to work or engage in any other activities that are not related to tourism or business.",
      "tags": [],
      "documentSchemeVersionId": 794,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 25,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Government Fee",
          "fee": 150,
          "commission": 0,
          "code": "GOV-22"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application",
          "fee": 75,
          "commission": 0,
          "code": "VisaComplexityHigh_Individual"
        }
      ],
      "serviceTypeId": 25,
      "fee": 225,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "61",
        "approvalRate": "100",
        "stayDuration": "30",
        "stayDurationUnit": "Days",
        "validityPeriod": "2",
        "validityPeriodUnit": "Months",
        "requirements": "Mandatory requirements
Passport
Completed application form
6x6cm photograph in colour (minimum of 600x600 pixels) with a white background (at least 80% of your face should be visible)
Colour copy of your passport showing your full name, nationality, date and place of birth, passport number, date of issue and expiry, name of father / legal guardian, and the name of your mother
Valid passport with at least six months validity at the time of travel
Confirmed ticket travelling into Abu Dhabi Airport and onwards from Abu Dhabi to a third destination",
        "visaFormat": "eVisa",
        "entries": "Single",
        "expectedProcessingTimeUnit": "Hour(s)"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-596",
      "title": "United Arab Emirates eVisa",
      "description": "United Arab Emirates eVisa",
      "info": "Multiple entry 1 month eVisa",
      "tags": [],
      "documentSchemeVersionId": 795,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 596,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Goverment Fee",
          "fee": 220,
          "commission": 0,
          "code": "GOV-596"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application",
          "fee": 50,
          "commission": 0,
          "code": "VisaComplexityMedium_Individual"
        }
      ],
      "serviceTypeId": 596,
      "fee": 270,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "0",
        "approvalRate": "100",
        "stayDuration": "1",
        "stayDurationUnit": "Months",
        "validityPeriod": "58",
        "validityPeriodUnit": "Days",
        "requirements": "",
        "visaFormat": "eVisa",
        "entries": "Multiple",
        "expectedProcessingTimeUnit": "Day(s)",
        "expectedProcessingTime": "3"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-597",
      "title": "United Arab Emirates eVisa",
      "description": "United Arab Emirates eVisa",
      "info": "Multiple entry 2 months eVisa",
      "tags": [],
      "documentSchemeVersionId": 780,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 597,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Goverment Fee",
          "fee": 300,
          "commission": 0,
          "code": "GOV-597"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application",
          "fee": 75,
          "commission": 0,
          "code": "VisaComplexityHigh_Individual"
        }
      ],
      "serviceTypeId": 597,
      "fee": 375,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "0",
        "approvalRate": "100",
        "stayDuration": "2",
        "stayDurationUnit": "Months",
        "validityPeriod": "60",
        "validityPeriodUnit": "Days",
        "requirements": "",
        "visaFormat": "eVisa",
        "entries": "Multiple",
        "expectedProcessingTimeUnit": "Day(s)",
        "expectedProcessingTime": "3"
      },
      "isDisabled": false,
      "disableReasons": []
    },
    {
      "serviceType": "Visa",
      "provider": "Fluxir",
      "destinationCountryCode": "ARE",
      "serviceIntentKey": "Visa-Fluxir-ARE-604",
      "title": "UAE e-VISA Renewal ",
      "description": "UAE e-VISA Renewal ",
      "info": "Extension for an existing e-Visa.",
      "tags": [],
      "documentSchemeVersionId": 827,
      "pricingRecords": [
        {
          "serviceType": "Visa",
          "referenceId": 604,
          "feeScope": "PerService",
          "paymentModel": "OneTime",
          "title": "Goverment Fee",
          "fee": 300,
          "commission": 0,
          "code": "GOV-604"
        },
        {
          "serviceType": "Visa",
          "referenceId": null,
          "feeScope": "Global",
          "paymentModel": "OneTime",
          "title": "Application",
          "fee": 75,
          "commission": 0,
          "code": "VisaComplexityHigh_Individual"
        }
      ],
      "serviceTypeId": 604,
      "fee": 375,
      "callToActions": [],
      "extraProperties": {
        "visaFree": "false",
        "appliersCount": "2",
        "approvalRate": "100",
        "stayDuration": "30",
        "stayDurationUnit": "Days",
        "validityPeriod": "30",
        "validityPeriodUnit": "Days",
        "requirements": "Valid UAE e-Visa",
        "visaFormat": "eVisa",
        "entries": "Single",
        "expectedProcessingTimeUnit": "Day(s)",
        "expectedProcessingTime": "7"
      },
      "isDisabled": false,
      "disableReasons": []
    }
  ]
}
```

The response will be an array of available service intents for the defined trip context. Select a service intent to be used in the next steps.

**2.**

### Fetch Documents Scheme

This request will retrieve the data you'll need to fill for the chosen service. You need the `documentSchemeVersionId` from the service intent selected on Step 1.

**[Get Documents Scheme by Visa Version](https://developer.fluxir.com/api/get-documents-scheme-by-visa-version/)**

**Request**

```sh
curl -X GET 'https://api.fluxir.com/api/app/documents-scheme/?visaSchemeVersionId=<VERSION_ID>&normalized=true' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>'
```

**Response**

```json
[
  {
    "documentsSchemeVersionId": 781,
    "nameId": "mainSection",
    "order": 0,
    "isOptional": false,
    "isRecurrent": false,
    "maxRecurrency": 0,
    "description": null,
    "title": {
      "nameId": "mainSection.title",
      "isSystem": false,
      "values": [
        {
          "language": "English",
          "value": "Main Section",
          "id": 19
        }
      ],
      "isMarkdown": false,
      "id": 26
    },
    "items": [
      {
        "nameId": "passportNumber",
        "description": {
          "nameId": "passportNumber.description",
          "isSystem": false,
          "values": [],
          "isMarkdown": false,
          "id": 4217
        },
        "order": 0,
        "isSystem": false,
        "title": {
          "nameId": "system.passportNo",
          "isSystem": true,
          "values": [
            {
              "language": "English",
              "value": "Passport No.",
              "id": 1
            }
          ],
          "isMarkdown": false,
          "id": 1
        },
        "itemType": "String",
        "enumValue": null,
        "validationIsRequired": true,
        "validationMinLength": null,
        "validationMaxLength": null,
        "validationRegexp": null,
        "calculationExpression": null,
        "isPii": null,
        "availabilityCondition": null,
        "hasAvailabilityCondition": null,
        "id": 3463
      },
      {
        "nameId": "nameEnglish",
        "description": {
          "nameId": "nameEnglish.description",
          "isSystem": false,
          "values": [],
          "isMarkdown": false,
          "id": 4218
        },
        "order": 1,
        "isSystem": false,
        "title": {
          "nameId": "nameEnglish.title",
          "isSystem": false,
          "values": [
            {
              "language": "English",
              "value": "Full name ",
              "id": 2147
            }
          ],
          "isMarkdown": false,
          "id": 2374
        },
        "itemType": "String",
        "enumValue": null,
        "validationIsRequired": true,
        "validationMinLength": null,
        "validationMaxLength": null,
        "validationRegexp": null,
        "calculationExpression": null,
        "isPii": null,
        "availabilityCondition": null,
        "hasAvailabilityCondition": null,
        "id": 3465
      },
      {
        "nameId": "dateOfBirth",
        "description": {
          "nameId": "dateOfBirth.description",
          "isSystem": false,
          "values": [],
          "isMarkdown": false,
          "id": 4219
        },
        "order": 2,
        "isSystem": false,
        "title": {
          "nameId": "system.dateOfBirth",
          "isSystem": true,
          "values": [
            {
              "language": "English",
              "value": "Date of birth",
              "id": 7
            }
          ],
          "isMarkdown": false,
          "id": 7
        },
        "itemType": "Date",
        "enumValue": null,
        "validationIsRequired": true,
        "validationMinLength": null,
        "validationMaxLength": null,
        "validationRegexp": null,
        "calculationExpression": null,
        "isPii": null,
        "availabilityCondition": null,
        "hasAvailabilityCondition": null,
        "id": 3468
      },
      {
        "nameId": "gender",
        "description": {
          "nameId": "gender.description",
          "isSystem": false,
          "values": [],
          "isMarkdown": false,
          "id": 4220
        },
        "order": 3,
        "isSystem": false,
        "title": {
          "nameId": "gender.title",
          "isSystem": false,
          "values": [
            {
              "language": "English",
              "value": "Gender",
              "id": 2148
            }
          ],
          "isMarkdown": false,
          "id": 2375
        },
        "itemType": "Enum",
        "enumValue": {
          "nameId": "system.gender",
          "isSystem": true,
          "enumValues": [
            {
              "nameId": "gender.male",
              "title": {
                "nameId": "system.male",
                "isSystem": true,
                "values": [
                  {
                    "language": "English",
                    "value": "Male",
                    "id": 14
                  }
                ],
                "isMarkdown": false,
                "id": 14
              },
              "description": null,
              "id": 13
            },
            {
              "nameId": "gender.female",
              "title": {
                "nameId": "system.female",
                "isSystem": true,
                "values": [
                  {
                    "language": "English",
                    "value": "Female",
                    "id": 13
                  }
                ],
                "isMarkdown": false,
                "id": 13
              },
              "description": null,
              "id": 14
            }
          ],
          "source": null,
          "id": 1
        },
        "validationIsRequired": true,
        "validationMinLength": null,
        "validationMaxLength": null,
        "validationRegexp": null,
        "calculationExpression": null,
        "isPii": null,
        "availabilityCondition": null,
        "hasAvailabilityCondition": null,
        "id": 3471
      }
    ],
    "id": 2629
  }
]
```

This response will present you with the needed information to create a travel service application ([Step 5](#create-travel-service-application)).

Here, you'll find the information your customer needs to provide for the chosen service. This is found in the `items` key of the response, which is an array of objects.

**3.**

### Create Trip

Create a new trip.

**[Create a New Trip](https://developer.fluxir.com/api/create-trip/)**

**Request**

```sh
curl -X POST 'https://api.fluxir.com/api/app/trip' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>' \
  --data-raw '{
    "originationCode": "JOR",
    "destinatonCode": "ARE",
    "description": null,
    "visaApplicationIds": null,
    "notes": null,
    "from": "2025-07-30",
    "to": "2025-08-20"
  }'
```

**Response**

```json
{
  "serviceApplications": [],
  "visaType": null,
  "originationCode": "JOR",
  "destinationCode": "ARE",
  "description": null,
  "notes": null,
  "from": "2025-07-30",
  "to": "2025-08-20",
  "tenantId": "<YOUR_TENANT_ID>",
  "id": 10798
}
```

You will later ([Step 5](#create-travel-service-application)) connect the Travel Service Application you create to this trip.

**4.**

### List Available Travelers

Retrieve a list of available travelers to select the person that will be connected to the trip.

**[List Persons](https://developer.fluxir.com/api/get-persons/)**

**Request**

```sh
curl -X GET 'https://api.fluxir.com/api/app/persons?skipCount=0&maxResultCount=15&descending=false' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>'
```

**Response**

```json
{
  "totalCount": 2,
  "items": [
    {
      "firstName": "Gabriel",
      "lastName": "Raeder",
      "email": null,
      "residenceCountry": "BRA",
      "birthDate": "1991-05-30",
      "hasVisas": null,
      "identityDocuments": [],
      "socialAccounts": null,
      "employmentInfo": [],
      "visas": [],
      "serviceApplications": [
        {
          "personName": "Gabriel Raeder",
          "personId": 7459,
          "serviceType": "Insurance",
          "providerName": "TamkeenInsurance",
          "serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
          "destinationCode": "ARE",
          "originationCode": "JOR",
          "description": "Tamkeen Insurance Policy PlanA",
          "price": 0,
          "creationTime": "2025-07-02T19:07:09.744781+00:00",
          "state": "ReadyForPayment",
          "checkoutStatus": "Unknown",
          "hasDownloadableContent": false,
          "serviceTypeId": null,
          "applyingTime": null,
          "dueDate": "2025-07-30",
          "expectedCompletionDate": null,
          "issuanceTime": null,
          "tenantId": "<YOUR_TENANT_ID>",
          "appointments": [],
          "id": 9256
        }
      ],
      "document": {
        "documentsSchemeVersionId": 899,
        "items": {
          "gender.title": "gender.title.sir",
          "traveler.dateOfBirth": "1991-05-30",
          "traveler.firstName": "Gabriel",
          "traveler.lastName": "Raeder",
          "traveler.nationality": "BRA",
          "traveler.placeOfBirth": "Rio de Janeiro"
        },
        "id": 18080
      },
      "id": 7459
    },
    {
      "firstName": "John",
      "lastName": "Doe",
      "email": "johndoe@email.com",
      "residenceCountry": null,
      "birthDate": null,
      "hasVisas": null,
      "identityDocuments": [],
      "socialAccounts": null,
      "employmentInfo": [],
      "visas": [],
      "serviceApplications": [],
      "document": {
        "documentsSchemeVersionId": 899,
        "items": {
          "traveler.firstName": "John",
          "traveler.lastName": "Doe"
        },
        "id": 18003
      },
      "id": 7426
    }
  ]
}
```

This endpoint returns a list of previously created travelers. You need to select the person you want to use, and extract the `id` to be used in the ([next step](#create-travel-service-application)).

> **Creating a new traveler**
>
> Instead of choosing an existing traveler, you can create a new one. To create a new traveler, use the following endpoint:
>
> **[Create a New Person](https://developer.fluxir.com/api/create-person/)**

**5.**

### Create Travel Service Application

Now, you need to create the travel service application, following the instructions below:

- From step 1, add the `documentVersionId` from the selected service intent.

- From step 2, use the `items` array information filled by your customer to send the needed information to create the travel service application.

- From step 3, use the trip's `id` in the `tripId` field to link the application to the trip.

  > **Service Application Limits**
  >
  > A trip cannot contain multiple service applications of the same type for the same traveler.
  > For example, you cannot add two insurance policies or two visa applications for the same person within a single trip.
  >
  > However, the same service type can be applied to <strong>different travelers</strong> in the same trip.

- From step 4, use the traveler's `id` in the `personId` field to link the application to the traveler.

**[Create a Travel Service Application](https://developer.fluxir.com/api/create-travel-service-application/)**

**Request**

```sh
curl -X POST 'https://api.fluxir.com/api/app/travel-services' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>' \
  --data-raw '{
    "serviceType":         "Insurance",
    "providerName":        "TamkeenInsurance",
    "serviceIntentKey":    "Insurance-TamkeenInsurance-PlanA",
    "personId":            <PERSON_ID_FROM_STEP_4>,
    "tripId":              <TRIP_ID_FROM_STEP_3>,
    "documentVersionId":   <DOCUMENT_VERSION_ID_FROM_STEP_1>,
    "items": {

      <LIST_OF_ITEMS_FROM_STEP_2>
    },
    "state":        "Draft",
    "serviceTypeId": null
  }'
```

**Response**

```json
{
  "personId": 7459,
  "billingTripId": 10800,
  "billingTripFrom": "2025-07-30",
  "billingTripTo": "2025-08-20",
  "serviceType": "Insurance",
  "providerName": "TamkeenInsurance",
  "serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
  "notes": null,
  "description": "Tamkeen Insurance Policy PlanA",
  "destinationCode": "ARE",
  "originationCode": "JOR",
  "state": "Draft",
  "document": {
    "documentsSchemeVersionId": 781,
    "items": {
      "passportNumber": "",
      "nameEnglish": "",
      "dateOfBirth": "",
      "gender": ""
    },
    "id": 18122
  },
  "pricingRecords": [
    {
      "serviceApplicationId": 9278,
      "feeScope": "PerService",
      "paymentModel": "OneTime",
      "serviceType": "Insurance",
      "title": "Insurance Fee",
      "fee": 0,
      "code": null,
      "id": 0
    }
  ],
  "isPaid": false,
  "travelerFirstName": "Gabriel",
  "travelerLastName": "Raeder",
  "creationTime": "2025-07-04T17:30:13.4680637+00:00",
  "lastModificationTime": null,
  "applyingTime": null,
  "dueDate": "2025-07-30",
  "expectedCompletionDate": null,
  "issuanceTime": null,
  "appointments": [],
  "id": 9278
}
```

> **Adding a New Service Application to a Trip**
>
> If you want to add a service application of a <strong>new type</strong> that hasn't been added to the trip yet,
> you must first perform a [<strong>service intent search</strong>](https://developer.fluxir.com/api/get-travel-service-applications/) to obtain the relevant `serviceIntentKey` and `documentVersionId`.
>
> These values are required to correctly create the service application for the selected service type.

**6.**

### Recognize Identity Documents (Optional)

If a new identity document is needed or an existing one should be updated, follow these steps:

**[Passport Recognition](https://developer.fluxir.com/api/post-passport-recognition/)**

**[Create Identity Document](https://developer.fluxir.com/api/post-identity-document-by-traveler-id/)**

**[Update Identity Document](https://developer.fluxir.com/api/patch-identity-document-by-id/)**

These endpoints allow you to recognize document data from an image and store it as structured identity information.

**7.**

### Updating the Travel Service Application

If the customer still needs to update their information, or if you need to change the application status, you will need to update the Travel Service Application. You'll use the following endpoint to update it:

**[Updating a Travel Service Application](https://developer.fluxir.com/api/update-travel-service-application/)**

**Request**

```sh
curl -X PATCH '/api/app/travel-services/<TRAVEL_SERVICE_ID>' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H 'X-Tenant: <YOUR_TENANT_ID>' \
  --data-raw '{
    "state": "Draft",
    "items": {
        "passportNumber": "569569595",
        "nameEnglish": "John Doe",
        "dateOfBirth": "1991-05-29",
        "gender": "gender.male",
    },
    "state": "ReadyForPayment"
  }'
```

**Response**

```json
{
  "personId": 7459,
  "billingTripId": 10800,
  "billingTripFrom": "2025-07-30",
  "billingTripTo": "2025-08-20",
  "serviceType": "Insurance",
  "providerName": "TamkeenInsurance",
  "serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
  "notes": null,
  "description": "Tamkeen Insurance Policy PlanA",
  "destinationCode": "ARE",
  "originationCode": "JOR",
  "state": "ReadyForPayment",
  "document": {
    "documentsSchemeVersionId": 781,
    "items": {
      "dateOfBirth": "1991-05-30",
      "gender": "gender.male",
      "nameEnglish": "Gabriel Goncalves",
      "passportNumber": "2121212"
    },
    "id": 18122
  },
  "pricingRecords": [
    {
      "serviceApplicationId": 9278,
      "feeScope": "PerService",
      "paymentModel": "OneTime",
      "serviceType": "Insurance",
      "title": "Insurance Fee",
      "fee": 21,
      "code": "TamkeenInsurance_PlanA_30_70",
      "id": 16877
    }
  ],
  "isPaid": false,
  "travelerFirstName": "Gabriel",
  "travelerLastName": "Raeder",
  "creationTime": "2025-07-04T17:30:13.468063+00:00",
  "lastModificationTime": "2025-07-04T17:32:03.6762563+00:00",
  "applyingTime": null,
  "dueDate": "2025-07-30",
  "expectedCompletionDate": null,
  "issuanceTime": null,
  "appointments": [],
  "id": 9278
}
```

> **Possible Statuses**
>
> Refer to the [Application Status reference page](https://developer.fluxir.com/api/introduction/reference/application-status/) for a list of possible statuses an application can have.

**8.**

  ### Interactive Checkout Process (Portal flow)

The steps below describe the interactive portal Checkout flow that may be used when a tenant or user is completing payment in the Travel Agencies Portal. This is not the required headless API billing arrangement. For headless API integrations, confirm the tenant's [billing readiness](https://developer.fluxir.com/api-guides/billing-readiness/) and follow the approved administrator or support next step before submission.

After the travel status is ready for payment, you need to present the customer with the payment URL, and, after they pay, let the system know the checkout is finalized.

1. Retrieve the checkout URL, using the `tripId`:

  **[Get Checkout URL for a Trip](https://developer.fluxir.com/api/get-trip-checkout/)**

  **Request**

  ```sh
  curl -X GET "https://api.fluxir.com/api/app/trip/<TRIP_ID>/checkout?serviceApplicationIds=<SERVICE_APP_IDS>&successUrl=<URL_ENCODED_SUCCESS_URL>&cancelUrl=<URL_ENCODED_CANCEL_URL>" \
    -H 'Accept: application/json, text/plain, */*' \
    -H 'Accept-Language: en' \
    -H "Authorization: Bearer <ACCESS_TOKEN>" \
    -H 'X-Tenant: <YOUR_TENANT_ID>'
  ```

  **Response**

  ```json
  {
    "result": "cs_test_a1weSayiHvw9a8gVV6cIuICiZ48zcOg8RA5slLBHGXp9NAUir1DkWF9WAw"
  }
  ```

     Attach the result value with the following Stripe URL:

     ```text
     https://checkout.stripe.com/c/pay/cs_test_a1weSayiHvw9a8gVV6cIuICiZ48zcOg8RA5slLBHGXp9NAUir1DkWF9WAw
     ```

     After you receive the checkout URL from the response, redirect your user there and let them complete payment.

2. Once the user is redirected to your `successUrl`, wait for at least 5 seconds, and make a request to the Finalize checkout endpoint to complete the process.

    **[Finalize Process for a Trip](https://developer.fluxir.com/api/finalize-trip-checkout/)**

    **Request**

    ```sh
    curl -X POST "https://api.fluxir.com/api/app/trip/<TRIP_ID>/finalize-checkout" \
      -H 'Accept: application/json, text/plain, */*' \
      -H 'Accept-Language: en' \
      -H "Authorization: Bearer <ACCESS_TOKEN>" \
      -H 'X-Tenant: <YOUR_TENANT_ID>' \
      --data-raw ''
    ```

     **Response**

     ```json
     {
       "serviceApplications": [
         {
           "personName": "Gabriel Goncalves",
           "personId": 7849,
           "serviceType": "Insurance",
           "providerName": "TamkeenInsurance",
           "serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
           "destinationCode": "ARE",
           "originationCode": "JOR",
           "description": "Tamkeen Insurance Policy PlanA",
           "price": 0,
           "creationTime": "2025-07-16T20:58:13.724814+00:00",
           "state": "Draft",
           "checkoutStatus": "Unknown",
           "hasDownloadableContent": false,
           "serviceTypeId": null,
           "applyingTime": null,
           "dueDate": "2025-07-30",
           "expectedCompletionDate": null,
           "issuanceTime": null,
           "tenantId": "3a1ac8ff-78cc-4324-f1d8-3c74664904ce",
           "tripId": 11174,
           "appointments": [],
           "id": 9738
         }
       ],
       "visaType": null,
       "originationCode": "JOR",
       "destinationCode": "ARE",
       "description": null,
       "notes": null,
       "from": "2025-07-30",
       "to": "2025-08-20",
       "tenantId": "3a1ac8ff-78cc-4324-f1d8-3c74664904ce",
       "id": 11174
     }
     ```

> **Placeholders**
>
> Remember to replace the placeholder values in the requests above before making real requests.