Ship Now

Developers

Integrate The Garuda Express's REST API in your web/mobile application

1. Introduction

TGE offers to its all merchants to integrate its rest api to list, create delivery orders (pickup requests) and manage customers from their own system (could be web application or mobile application).

Please follow up below mentioned steps to integrate our rest api.


2. Get an API key

TGE only provides API key to their valid registered merchants. To get your API key please contact us.


3. API Introduction

TGE develops restfull api.

Our production base url is "https://www.thegarudaexpress.com"

You have to send your api key in header of each api requests in "apikey" header key.


3.1. Customer Address API

This api provides you to perform read/write operation for customer address.

Method URI Description
GET /api/addresses

List addresses

Request Example

curl -X GET "https://www.thegarudaexpress.com/api/addresses" -H "accept: application/json" -H "apikey: YourApiKey"

Response Sample

{
    "status": "success",
    "total_results": 2,
    "data": [{
            "id": 1,
            "name": "Ram",
            "email": null,
            "mobile": "9800000",
            "address": "Koteshwor",
            "latitude": null,
            "longitude": null,
            "district": {
                "id": 1,
                "name": "Kathmandu",
                "code": "KTM",
                "state": {
                    "id": 3,
                    "name": "State 3",
                    "code": "ST3",
                    "country": {
                        "id": 1,
                        "name": "Nepal",
                        "code": "NP",
                        "enabled": false
                    }
                }
            },
            "pin_code": null
        },
        {
            "id": 2,
            "name": "Shyam",
            "email": null,
            "mobile": "",
            "address": "Baneshwor",
            "latitude": null,
            "longitude": null,
            "district": {
                "id": 1,
                "name": "Kathmandu",
                "code": "KTM",
                "state": {
                    "id": 3,
                    "name": "State 3",
                    "code": "ST3",
                    "country": {
                        "id": 1,
                        "name": "Nepal",
                        "code": "NP",
                        "enabled": false
                    }
                }
            },
            "pin_code": null
        }
    ]
}
							
POST /api/addresses

Create new address

Request Example

curl -X POST "https://www.thegarudaexpress.com/api/addresses" -H "accept: application/json" -H "apikey: YourApiKey" -H "Content-Type: application/json" -d "{"address":{ "name": "Ram Ji", "email": "name@domain.com", "mobile": "9800000000", "address": "Koteshwor, Mahadevsthan", "district": "1", "latitude": "28.3698", "longitude": "27.2544", "pinCode": "44600"}}"

Response Sample

{
	"status": "success",
	"data": {
		"id": 3,
		"name": "Ram Ji",
		"email": "name@domain.com",
		"mobile": "9800000000",
		"address": "Koteshwor, Mahadevsthan",
		"latitude": "28.3698",
		"longitude": "27.2544",
		"district": {
			"id": 1,
			"name": "Kathmandu",
			"code": "KTM",
			"state": {
				"id": 3,
				"name": "State 3",
				"code": "ST3",
				"country": {
					"id": 1,
					"name": "Nepal",
					"code": "NP",
					"enabled": false
				}
			}
		},
		"pin_code": "44600"
	}
}
							
GET /api/addresses/{id}

Address detail

Request Example

curl -X GET "http://thegarudaexpress.test/api/addresses/3" -H "accept: application/json" -H "apikey: YourApiKey"

Response Sample

{
	"status": "success",
	"data": {
		"id": 3,
		"name": "Ram Ji",
		"email": "name@domain.com",
		"mobile": "9800000000",
		"address": "Koteshwor, Mahadevsthan",
		"latitude": "28.3698",
		"longitude": "27.2544",
		"district": {
			"id": 1,
			"name": "Kathmandu",
			"code": "KTM",
			"state": {
				"id": 3,
				"name": "State 3",
				"code": "ST3",
				"country": {
					"id": 1,
					"name": "Nepal",
					"code": "NP",
					"enabled": false
				}
			}
		},
		"pin_code": "44600"
	}
}
							
PATCH /api/addresses/{id}

Updates address

Request Example

curl -X PATCH "https://www.thegarudaexpress.com/api/addresses/3" -H "accept: application/json" -H "apikey: YourApiKey" -H "Content-Type: application/json" -d "{"address":{ "name": "Ram G", "email": "name@domain.com", "mobile": "9800000000", "address": "Koteshwor, Mahadevsthan", "district": "1", "latitude": "28.3698", "longitude": "27.2544", "pinCode": "44600"}}"

Response Sample

{
	"status": "success",
	"data": {
		"id": 3,
		"name": "Ram G",
		"email": "name@domain.com",
		"mobile": "9800000000",
		"address": "Koteshwor, Mahadevsthan",
		"latitude": "28.3698",
		"longitude": "27.2544",
		"district": {
			"id": 1,
			"name": "Kathmandu",
			"code": "KTM",
			"state": {
				"id": 3,
				"name": "State 3",
				"code": "ST3",
				"country": {
					"id": 1,
					"name": "Nepal",
					"code": "NP",
					"enabled": false
				}
			}
		},
		"pin_code": "44600"
	}
}
							

3.2. Order API

This api provides you to perform read/write operation for order.

Method URI Description
GET /api/orders

List orders

Default Parameters:
page = 1
per_page = 10

Request Example

curl -X GET "https://thegarudaexpress.com/api/orders" -H "accept: application/json" -H "apikey: YourApiKey"

Response Sample

{
	"status": "success",
	"total_results": 2,
	"data": [{
			"id": 1,
			"number": "TGE-20200311-310494",
			"package": {
				"id": 1,
				"name": "Same Day",
				"description": "Same Day",
				"active": true
			},
			"package_rule": null,
			"picked_by": null,
			"delivered_by": null,
			"pickup_address": null,
			"delivery_address": {
				"id": 1,
				"name": "Hari",
				"email": null,
				"mobile": "9800000000",
				"address": "Sankhamul",
				"latitude": null,
				"longitude": null,
				"district": {
					"id": 1,
					"name": "Kathmandu",
					"code": "KTM",
					"state": {
						"id": 3,
						"name": "State 3",
						"code": "ST3",
						"country": {
							"id": 1,
							"name": "Nepal",
							"code": "NP",
							"enabled": false
						}
					}
				},
				"pin_code": null
			},
			"status": "COMPLETE",
			"delivery_status": "DELIVERED",
			"payment_status": "COMMISSION_SETTLED",
			"package_name": null,
			"package_order_id": null,
			"package_order_amount": 1500,
			"package_unit_price": null,
			"package_invoice_number": null,
			"package_total_items": "1",
			"package_weight": "0.5",
			"package_length": null,
			"package_height": null,
			"package_width": null,
			"total_amount": 100,
			"extra_amount": null,
			"extra_distance": null,
			"note": "",
			"pickup_date": "2020-03-11T00:00:00+05:45",
			"delivery_date": "2020-03-11T15:20:16+05:45",
			"deleted_at": null,
			"created": "2020-03-11T15:19:22+05:45",
			"updated": "2020-03-11T15:25:11+05:45"
		},
		{
			"id": 2,
			"number": "TGE-20200311-796287",
			"package": {
				"id": 2,
				"name": "Next Day",
				"description": "Next Day",
				"active": true
			},
			"package_rule": null,
			"picked_by": null,
			"delivered_by": null,
			"pickup_address": null,
			"delivery_address": {
				"id": 3,
				"name": "Ram G",
				"email": null,
				"mobile": "",
				"address": "Durbar Marg",
				"latitude": null,
				"longitude": null,
				"district": {
					"id": 1,
					"name": "Kathmandu",
					"code": "KTM",
					"state": {
						"id": 3,
						"name": "State 3",
						"code": "ST3",
						"country": {
							"id": 1,
							"name": "Nepal",
							"code": "NP",
							"enabled": false
						}
					}
				},
				"pin_code": null
			},
			"status": "COMPLETE",
			"delivery_status": "DELIVERED",
			"payment_status": "COMMISSION_SETTLED",
			"package_name": null,
			"package_order_id": null,
			"package_order_amount": 1000,
			"package_unit_price": null,
			"package_invoice_number": null,
			"package_total_items": "1",
			"package_weight": "0.5",
			"package_length": null,
			"package_height": null,
			"package_width": null,
			"total_amount": 75,
			"extra_amount": null,
			"extra_distance": null,
			"note": "",
			"pickup_date": "2020-03-11T00:00:00+05:45",
			"delivery_date": "2020-03-11T15:20:38+05:45",
			"deleted_at": null,
			"created": "2020-03-11T15:19:22+05:45",
			"updated": "2020-03-11T15:23:39+05:45"
		}
	]
}
							
POST /api/orders

Create new order

Request Example

curl -X POST "https://www.thegarudaexpress.com/api/orders" -H "accept: application/json" -H "apikey: YourApiKey" -H "Content-Type: application/json" -d "{"order":{ "pickupAddress": "1", "deliveryAddress": "2", "packageWeight": "1.5", "packageTotalItems": "1", "packageOrderAmount": 1550, "pickupDate": "2020-03-12T10:44:30.535Z", "note": "Deliver in evening"}}"

Response Sample

{
	"status": "success",
	"data": {
		"id": 3,
		"number": "TGE-20200312-303312",
		"package": null,
		"package_rule": null,
		"picked_by": null,
		"delivered_by": null,
		"pickup_address": {
			"id": 1,
			"name": "ABC Company Pvt. Ltd",
			"email": "abc@abccompany.com",
			"mobile": "9800000000",
			"address": "Shantinagar",
			"latitude": null,
			"longitude": null,
			"district": {
				"id": 2,
				"name": "Bhaktapur",
				"code": "BKT",
				"state": {
					"id": 3,
					"name": "State 3",
					"code": "ST3",
					"country": {
						"id": 1,
						"name": "Nepal",
						"code": "NP",
						"enabled": false
					}
				}
			},
			"pin_code": "111"
		},
		"delivery_address": {
			"id": 2,
			"name": "Hari",
			"email": "",
			"mobile": "98000000000",
			"address": "Koteshwor",
			"latitude": null,
			"longitude": null,
			"district": {
				"id": 1,
				"name": "Kathmandu",
				"code": "KTM",
				"state": {
					"id": 3,
					"name": "State 3",
					"code": "ST3",
					"country": {
						"id": 1,
						"name": "Nepal",
						"code": "NP",
						"enabled": false
					}
				}
			},
			"pin_code": null
		},
		"status": "NEW",
		"delivery_status": "REQUESTED",
		"payment_status": "PENDING",
		"package_name": null,
		"package_order_id": null,
		"package_order_amount": 1550,
		"package_unit_price": null,
		"package_invoice_number": null,
		"package_total_items": "1",
		"package_weight": "1.5",
		"package_length": null,
		"package_height": null,
		"package_width": null,
		"total_amount": null,
		"extra_amount": null,
		"extra_distance": null,
		"note": "Deliver in evening",
		"pickup_date": "2020-03-12T16:29:30+05:45",
		"delivery_date": null,
		"deleted_at": null,
		"created": "2020-03-12T16:30:51+05:45",
		"updated": "2020-03-12T16:30:51+05:45"
	}
								}
							
GET /api/orders/{id}

Order detail

Request Example

curl -X GET "https://www.thegarudaexpress.com/api/orders/1" -H "accept: application/json" -H "apikey: YourApiKey"

Response Sample

{
	"status": "success",
	"data": {
		"id": 1,
		"number": "TGE-20200311-310494",
		"package": {
			"id": 1,
			"name": "Same Day",
			"description": "Same Day",
			"active": true
		},
		"package_rule": null,
		"picked_by": null,
		"delivered_by": null,
		"pickup_address": null,
		"delivery_address": {
			"id": 124,
			"name": "Hari",
			"email": null,
			"mobile": "9800000000",
			"address": "Koteshwor",
			"latitude": null,
			"longitude": null,
			"district": {
				"id": 1,
				"name": "Kathmandu",
				"code": "KTM",
				"state": {
					"id": 3,
					"name": "State 3",
					"code": "ST3",
					"country": {
						"id": 1,
						"name": "Nepal",
						"code": "NP",
						"enabled": false
					}
				}
			},
			"pin_code": null
		},
		"status": "COMPLETE",
		"delivery_status": "DELIVERED",
		"payment_status": "COMMISSION_SETTLED",
		"package_name": null,
		"package_order_id": null,
		"package_order_amount": 120,
		"package_unit_price": null,
		"package_invoice_number": null,
		"package_total_items": "1",
		"package_weight": "0.5",
		"package_length": null,
		"package_height": null,
		"package_width": null,
		"total_amount": 100,
		"extra_amount": null,
		"extra_distance": null,
		"note": "",
		"pickup_date": "2020-03-11T00:00:00+05:45",
		"delivery_date": "2020-03-11T15:20:16+05:45",
		"deleted_at": null,
		"created": "2020-03-11T15:19:22+05:45",
		"updated": "2020-03-11T15:25:11+05:45"
	}
}
							

3.3. District

This api provides you the list of districts.

Method URI Description
GET /api/districts List districts