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
Before updating a trip for paid submission, confirm the tenant's current billing readiness using the API Billing Readiness guide. Headless API integrations should not assume every tenant requires the portal Stripe Checkout flow; follow the tenant's configured approval or billing next step instead.
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 '{
"items": {
"passportNumber": "569569595",
"nameEnglish": "John Doe",
"dateOfBirth": "1991-05-29",
"gender": "gender.male",
"attachmentPassport": "123|passport.pdf",
"personalPhoto": "124|photo.jpg"
},
"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",
"attachmentPassport": "123|passport.pdf",
"personalPhoto": "124|photo.jpg"
},
"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.
Upload each file first using Upload Document Item Attachment, with the multipart field named file.
In the response, use the attachment id and fileName to build the corresponding items value as a string in the form
"<attachment-id>|<file-name>". For example, if the response contains id: 31577 and fileName: "passport.pdf", send
"passportFile": "31577|passport.pdf".
Do not send documentFileId, a bare attachment ID, an object, or an array as the item value. The upload is not linked to the
application yet, so an upload response with ownerId: 0 is expected. This PATCH links the attachment to the document item;
no owner parameters or separate linking request are needed. Save the file items while the application is still in Draft,
then update its state separately.
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:
These endpoints allow you to recognize document data from an image and store it as structured identity information.
The steps below describe the interactive portal Checkout flow. This is not the universal headless API billing path. For API clients, confirm the tenant's billing readiness and follow the approved administrator or support next step before paid 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.
- 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_a1weSayiHvw9a8gVV6cIuICiZ48zcOg8RA5slLBHGXp9NAUir1DkWF9WAw
After 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
}
Replace every angle-bracket value, such as <TRAVEL_SERVICE_ID> and <YOUR_TENANT_ID>, with the actual value before sending a request.
For file-valued document items, use the attachment id|fileName string format described above; do not send a bare ID.