Updating an Existing Trip
This guide shows you how to resume and update an existing trip and its associated service applications in Fluxir. This is useful for restoring draft applications, editing previously submitted data, or re-processing identity documents.
Workflow
First, you need the traveler from the trip you need to update.
- Request
- Response
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>'
{
"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
}
]
}
Retrieve the id to be used to find the service applications for this person.
With the person's unique identifier, you can retrieve this traveler's travel service applications. Use the personId query parameter shown below:
- Request
- Response
curl -L 'https://api.fluxir.com/api/app/travel-services?PersonId=<PERSON_ID>' \
-H 'Accept: text/plain' \
-H 'Authorization: Bearer <token>'
{
"totalCount": 1,
"items": [
{
"personName": "John Doe",
"personId": 7459,
"serviceType": "Insurance",
"providerName": "TamkeenInsurance",
"serviceIntentKey": "Insurance-TamkeenInsurance-PlanA",
"destinationCode": "ARE",
"originationCode": "JOR",
"description": "Tamkeen Insurance Policy PlanA",
"price": 21,
"creationTime": "2025-07-04T17:30:13.468063+00:00",
"state": "ReadyForPayment",
"checkoutStatus": "Unknown",
"hasDownloadableContent": false,
"serviceTypeId": null,
"applyingTime": null,
"dueDate": "2025-07-30",
"expectedCompletionDate": null,
"issuanceTime": null,
"tenantId": "3a1ac8ff-78cc-4324-f1d8-3c74664904ce",
"tripId": 10800,
"appointments": [],
"id": 9278
}
]
}
Now, you have access to this person's applications, and their related trips.
You can use these to both retrieve the trip data, and each service application information:
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 different travelers in the same trip.
With these, you can see what information still needs to be filled, in case your customer hasn't yet presented all needed information.
Update the application with new or corrected field values. This can include both direct field inputs and updates from passport recognition or context merges.
- Request
- Response
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"
}'
{
"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
}
The request body should include:
items: The updated document fields.state: You can optionally move the application toReadyForPayment,InReview, etc.
Refer to the Application Status reference for valid values.
If you want to add a service application of a new type that hasn't been added to the trip yet,
you must first perform a service intent search to obtain the relevant serviceIntentKey and documentVersionId.
These values are required to correctly create the service application for the selected service type.
Recognize Identity Documents (Optional)
If a new identity document is needed or an existing one should be updated, follow these steps:
Passport Recognition
Create Identity Document
Update Identity Document
Upload Attachment
These endpoints allow you to recognize document data from an image and store it as structured identity information.
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 now the checkout is finalized.
-
Retrieve the checkout URL, using the
tripId:
- Request
- Response
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>'{
"result": "cs_test_a1weSayiHvw9a8gVV6cIuICiZ48zcOg8RA5slLBHGXp9NAUir1DkWF9WAw"
}Attach the result value with the following Stripe URL:
https://checkout.stripe.com/c/pay/cs_test_a1weSayiHvw9a8gVV6cIuICiZ48zcOg8RA5slLBHGXp9NAUir1DkWF9WAwAfter you receive the checkout URL from the response, redirect your user there and let them complete payment.
-
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.
- Request
- Response
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 ''{
"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
}
Remember to replace the placeholder values in the requests above before making real requests.