Skip to main content
POST
/
client
/
billing
/
create
Create pre-booking
curl --request POST \
  --url https://v2.flabs.in/client/billing/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "patient_details": {
    "first_name": "name",
    "last_name": "surname",
    "gender": "male",
    "age": 24,
    "age_type": "year"
  },
  "integrator_id": "your_unique_integrator_id",
  "unmapped_tests": [
    "unmapped test name"
  ],
  "mapped_tests": [
    {
      "flabs_id": "FLABSTESTID"
    },
    {
      "id": "test_id"
    }
  ],
  "mapped_packages": [
    {
      "id": "package_id"
    }
  ],
  "unmapped_packages": [
    "unmapped package name"
  ],
  "unmapped_packages_with_tests": [
    {
      "package_name": "package name",
      "tests": [
        "test name 1",
        "test name 2"
      ]
    }
  ],
  "lead_source": "<lead source>"
}'
{
  "success": true,
  "message": "Booking created successfully",
  "integrator_id": "your_unique_integrator_id",
  "preBookingID": "pre_booking_id"
}

Overview

Create a pre-booking in the Flabs system to initiate the laboratory workflow. This endpoint accepts patient details and test/package information to start the billing process.

Authentication

Requires a valid Bearer token from the authentication API.

Request Parameters

Required Fields

FieldTypeDescription
patient_detailsobjectPatient information (required)
patient_details.first_namestringPatient’s first name
patient_details.genderstringPatient’s gender (male, female, other)
patient_details.ageintegerPatient’s age
patient_details.age_typestringAge unit (year, month, day)
integrator_idstringYour unique identifier for this booking
lead_sourcestringSource of the booking (contact Flabs for available sources)

Test/Package Requirements

At least one of the following is required:
FieldTypeDescription
mapped_testsarrayTests mapped with Flabs (use flabs_id or id)
unmapped_testsarrayTests not mapped with Flabs
mapped_packagesarrayPackages mapped with Flabs (use id only)
unmapped_packagesarrayPackages not mapped with Flabs
unmapped_packages_with_testsarrayPackages with associated tests not mapped with Flabs

Optional Fields

FieldTypeDescription
barCodestringUnique barcode identifier
patient_details.last_namestringPatient’s last name

Important Notes

  • Patient details are mandatory with all required fields - At least one test or package array must be provided - Barcodes must be unique across the system
  • Contact Flabs team for available lead sources
  • Use flabs_id or id for mapped tests - Only id is available for mapped packages (no flabs_id) - The preBookingID in the response is used to track the booking through the workflow

Authorizations

Authorization
string
header
required

JWT token obtained from the authentication endpoint

Body

application/json
patient_details
object
required
integrator_id
string
required

Your unique identifier for this booking

lead_source
string
required

Source of the lead (contact Flabs team for available sources)

unmapped_tests
string[]

Tests not mapped between your system and Flabs

mapped_tests
object[]

Tests mapped with Flabs system

mapped_packages
object[]

Packages mapped with Flabs system

unmapped_packages
string[]

Packages not mapped between your system and Flabs

unmapped_packages_with_tests
object[]

Packages with associated tests not mapped between your system and Flabs

barCode
string

Optional barcode (must be unique)

Response

Pre-booking created successfully

success
boolean
Example:

true

message
string
Example:

"Booking created successfully"

integrator_id
string

Your unique integrator ID

preBookingID
string

Flabs pre-booking identifier

I