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"
  ],
  "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

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

Response

201
application/json

Pre-booking created successfully

The response is of type object.