Create Booking
This api is used to create booking for 1mg order.
- The booking keys required in the request payload are configured in vendor configurations at 1mg.
- A vendor can create cart for all possible lab, test combinations. For example, combinations like lab1, test1 and lab2, test2 for keys
lab_id
,test_id
respectively can be specified. These will result in creation of individual bookings for each combination. These bookings will have common Order group id, which is generated in Create booking api response. (Refer to key -data[0]._order_group_id
in response) - Only cash
payment_mode
is allowed for third party orders. - Email is sent to vendor based on the communication key specified in vendor configurations. The email contains all the charges and booking details.
::: requestmodel
Property | Type? | Required? |
---|---|---|
cart | List | Required |
cart[i].lab_id | Integer | Required |
cart[i].test_id | Integer | Required |
city | String | Required |
state | String | Required, if specified in booking keys in vendor configuration |
street | String | Required |
locality | String | Required |
landmark | String | Required |
patient_name | String | Required |
mobile_number | String | Required |
String | Required | |
gender | String | Required |
age | Integer | Required |
collection_time | String | Required |
pin_code | String | Required |
payment_mode | String | Optional, default value is CASH |
referral | String | Required, if specified in booking keys in vendor configuration |
merchant_paid | Integer | Required |
user_paid | Integer | Required |
coupon_code | String | Required, if specified in booking keys in vendor configuration |
merchant_id | String | Required. An identifier that you would like to use later for identification of your order at 1mg side, you can pass that in merchant_id. Else you can pass empty string |
policy_id | String | Optional. An identifier that you would like to use later for identification of your order at 1mg side, related to customer order |
referrence_id | String | Optional. An identifier that you would like to use later for identification of your order at 1mg side, related to vendor reference. This is similar to merchant_id |
Header Parameters
- Content-Type stringExample: application/json
- x-access-key stringExample: 1mg_client_public_access_key
- X-Authorization stringExample: {{X-Authorization}}
- application/json
Request Body
- object
Responses
- 200
OK
Response Headers
Date string
Content-Type string
Transfer-Encoding string
Connection string
vary string
x-request-id string
set-cookie string
visitor-id string
x-visitor-id string
access-control-allow-methods string
access-control-allow-headers string
access-control-allow-origin string
CF-Cache-Status string
Server string
CF-RAY string
Content-Encoding string
- application/json
- Schema
- Example (from schema)
- Example
Schema
- object
{}
{
"data": [
{
"loyalty_burned": null,
"loyalty_burned_extra_charges": null,
"is_cp_order": null,
"loyalty_to_be_earned": null,
"loyalty_credited": null,
"create_time": 1700569416,
"vas": null,
"_booking_id": "SB2709022656-386",
"_test_id": 1743,
"_lab_id": 95,
"_test_name": "Complete Haemogram",
"_lab_name": "Tata 1mg Labs (Tata 1mg Technologies Private Limited)",
"_price": 441,
"_discount_percent": 90,
"_commission_percent": null,
"_home_visit_charges": 0,
"_email": "[email protected]",
"_patient_name": "Tony Stark",
"_age": 30,
"_gender": "male",
"_mobile_number": "8920856405",
"_street": "5 TARAK DUTTA ROAD, 1ST FLOOR, BESIDE KARAYA POLICE STATION",
"_city": "GURGAON",
"_state": "Dl",
"_pin_code": "122001",
"_entry_time": "21 Nov 2023 12:23 PM",
"_order_group_id": "SO3431419971-156",
"_catalog_price": null,
"_catalog_commission_percent": null,
"_fe_name": null,
"_fe_mobile_number": null,
"_collection_time": null,
"_status": "booked",
"_source": null,
"_source_version": null,
"_coupon_code": null,
"_payable_price": 44,
"_coupon_discount": null,
"_discounted_price": 44,
"_report_url": null,
"_logo_url": "https://onemg.gumlet.io/diagnostics/13745198-de27-11eb-b6a9-028c4b29e266.png?format=auto",
"_charges": null,
"_payment_mode": "CASH",
"_txn_id": null,
"_refund_status": null,
"_refund_amount": null,
"_collection_time_slot": {
"date": "July 23, 2024",
"time_slot_difference": 60,
"slot": "09:00 PM - 10:00 PM",
"epoch_time": 1721751173
},
"_last_modified": 1700569416,
"_super_order_id": "SO3431419971-156",
"_locality": "GURGAON",
"_cancel_reason": null,
"_vendor_id": null,
"_vendor_order_id": null,
"_cashback_availed": 0,
"_landmark": "Aadarsh nager",
"_user_paid": 22,
"_user_id": null,
"_report_tat": 24,
"_tat_date": null,
"_tat_text": null,
"_tat_date_text": null,
"_category": null,
"_precautions": [
"No special preparation required"
],
"_vendor_name": null,
"_lead_vendor_id": null,
"_lead_vendor_reference_code": null,
"_lead_vendor_name": null,
"_track_link": null,
"_dos_code": null,
"_is_validated": null,
"_delivery_time": null,
"_coupon_cashback": null,
"_lab_locality": null,
"_bar_codes": null,
"_is_assert": null,
"_agent_email": null,
"_is_validated_real_time": null,
"_report_delay_reason": null,
"_is_cancellable": true,
"_is_patient_editable": true,
"_is_delivered": false,
"_price_info": {
"mrp": 441,
"discount_percent": 90,
"offered_price": 44,
"discount": 397,
"coupon_discount": 0,
"cashback_redeemed": 0,
"refund_initiated": 0,
"refund_processed": 0
},
"_referral": "EXAMPLE_VENDOR_API",
"_message": null,
"payment_instrument": null,
"payment_modes_count": 0
}
],
"partial_complete": false,
"is_success": true,
"status_code": 200
}
Loading...