3rd Party Data Syncing
EndPoint
You will be provided our system API endpoint by our developer when you get onboard. When provided the API endpoint, you will replace the “DATA _SYNC_API_ENDPOINT” mentioned in the document descriptions below when actually making the API call from your end.
Authentication
Our developer will provide you with an access token that must be sent along with any request to th server to authenticate your request.
You must add the provided token with the request as a header entry with the key “3rd-party-secret-key”. Below is a sample of adding the header using PHP – curl.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'DATA_SYNC_API_ENPOINT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'3rd-party-secret-key: 7eQ9rNE2uPfDo3rqIGa01Hwfsdw0ggOu'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Vendor CRUD
You can create/update/delete vendor records on our server by making POST, GET, PATCH, DELETE request to the provided api endpoint below.
https://“DATA_SYNC_API_ENPOINT”/vendors
Sample Request:
{
"name": "Vendor One",
"description": "",
"delivery_fee": 10,
"delivery_range": 40,
"tax": 0,
"phone": "+966555519058",
"email": "sample_vendor@gmail.com",
"address": "Qays Ibn Sayfi, Al-Safa, Jeddah 23455, Saudi Arabia",
"latitude": "21.5892571",
"longitude": "39.2096954",
"pickup": 1,
"delivery": 1,
"is_active": 1,
"min_order": 20,
"max_order": 1000000,
"prepare_time": "30",
"delivery_time": "60",
//sync_code is the external vendor ref, to indentify vendor record againt your local record,
//because return vendor id might be different from your location record id
"sync_code": "20B132-ElZmR",
"logo": "https://flyingarrow.com.sa/storage/479/A6RA1-1710444436.jpg",
"feature_image": "https://flyingarrow.com.sa/storage/495/sMJ7Y-1710709645.jpg",
"vendor_type": {
//possible slugs: food, grocery, commerce
"slug": "food"
}
}
Sample Response:
{
"message": "Vendor recorded successfully",
"vendor": {
"id": 2,
"name": "Vendor One",
"description": "",
"delivery_fee": 10,
"delivery_range": 40,
"tax": "0",
"phone": "+966555519058",
"email": "sample_vendor@gmail.com",
"address": "Qays Ibn Sayfi, Al-Safa, Jeddah 23455, Saudi Arabia",
"latitude": "21.5892571",
"longitude": "39.2096954",
"commission": 0,
"pickup": 1,
"delivery": 1,
"is_active": 1,
"charge_per_km": 0,
"is_open": true,
"vendor_type_id": 2,
"auto_assignment": 1,
"auto_accept": 0,
"allow_schedule_order": false,
"has_sub_categories": false,
"min_order": "0",
"max_order": "1000000",
"use_subscription": false,
"has_drivers": 0,
"prepare_time": null,
"delivery_time": null,
"in_order": 1,
"featured": 0,
"created_at": "2024-04-02 08:44:26",
"updated_at": "2024-04-02 08:59:33",
"deleted_at": null,
"creator_id": null,
"sync_code": "20B132-ElZmR",
"third_party_token_id": 4,
"reviews_count": 0,
"formatted_date": "02 Apr 2024",
"logo": "http://flyingarrow.com.sa/images/default.png",
"feature_image": "http://flyingarrow.com.sa/images/default.png",
"rating": 5,
"can_rate": false,
"slots": [],
"is_package_vendor": 1,
"has_subscription": true,
"document_requested": false,
"pending_document_approval": false,
"vendor_type": {
"id": 2,
"name": "Food Delivery ",
"color": "#97b500",
"description": "Buy the best meal from your nearby restaurant",
"slug": "food",
"is_active": 1,
"in_order": 2,
"created_at": "2021-06-30 10:45:53",
"updated_at": "2024-03-26 12:50:04",
"deleted_at": null,
"formatted_date": "30 Jun 2021",
"logo": "http://flyingarrow.com.sa/images/default.png",
"website_header": "",
"has_banners": 0
},
"fees": [],
"days": []
}
}
Product Crud
You can create/update/delete product records on our server by making POST, GET, PATCH, DELETE requests to the provided API endpoint below.
https://“DATA_SYNC_API_ENPOINT”/products
Sample Request:
{
"name": "Fried Rice",
"description": "Nice meal for the month",
"price": 250,
"discount_price": 100,
"sync_code": "20B132-ElZmR",
"photo": "https://images.unsplash.com/photo-1711816769781-0a8194f44399?q=80&w=1968&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"vendor_id": 2
}
Sample Response:
{
"message": "Product recorded successfully",
"product": {
"id": 2,
"name": "Fried Rice",
"sku": null,
"barcode": null,
"description": "Nice meal for the month",
"price": 250,
"discount_price": 100,
"capacity": "1",
"unit": "kg",
"package_count": null,
"available_qty": null,
"featured": 0,
"deliverable": 1,
"is_active": 1,
"plus_option": 1,
"digital": 0,
"age_restricted": false,
"vendor_id": 2,
"in_order": 1,
"approved": 0,
"created_at": "2024-04-02 09:09:56",
"updated_at": "2024-04-02 09:11:25",
"deleted_at": null,
"sync_code": "20B132-ElZmR",
"third_party_token_id": 4,
"reviews_count": 0,
"formatted_date": "02 Apr 2024",
"sell_price": 100,
"photo": "http://flyingarrow.com.sa/images/default.png",
"is_favourite": false,
"rating": 0,
"option_groups": [],
"photos": [
"http://flyingarrow.com.sa/images/default.png"
],
"digital_files": [],
"token":"eyJpdiI6IkErcnBkZWVWYTg2azVPeDBiTm9SVGc9PSIsInZhbHVlIjoiZk5jTUxrV1RkN3RCVE9yRG85b2NJR3kyY1JSRXVwTFpCREZLREd1aGljUkhDeXRKbnRibzA4SFBhNzBPYUJGbTZJNTNGMXhMQ29wQlVEem13OUNQMnc9PSIsIm1hYy",
"vendor": {
"id": 2,
"name": "أصول الكبدة - osool Elkebdah",
"الكبدة تخصصنا" :"description",
"base_delivery_fee": 5,
"delivery_fee": 1,
"delivery_range": 40,
"tax": "0",
"phone": "+966555519058",
"email": "shmjh345@gmail.com",
"address": "Qays Ibn Sayfi, Al-Safa, Jeddah 23455, Saudi Arabia",
"latitude": "21.5892571",
"longitude": "39.2096954",
"commission": 5,
"pickup": 1,
"delivery": 1,
"is_active": 1,
"charge_per_km": 0,
"is_open": true,
"vendor_type_id": 2,
"auto_assignment": 1,
"auto_accept": 0,
"allow_schedule_order": false,
"has_sub_categories": false,
"min_order": "0",
"max_order": "1000000",
"use_subscription": false,
"has_drivers": 0,
"prepare_time": null,
"delivery_time": null,
"in_order": 1,
"featured": 0,
"created_at": "2024-04-02 08:44:26",
"updated_at": "2024-04-02 08:59:33",
"deleted_at": null,
"creator_id": null,
"sync_code": "20B132-ElZmR",
"third_party_token_id": 4,
"reviews_count": 0,
"formatted_date": "02 Apr 2024",
"logo": "http://flyingarrow.com.sa/images/default.png",
"feature_image": "http://flyingarrow.com.sa/images/default.png",
"rating": 5,
"can_rate": false,
"slots": [],
"is_package_vendor": 1,
"has_subscription": true,
"document_requested": false,
"pending_document_approval": false,
"vendor_type": {
"id": 2,
"name": "Food Delivery ",
"color": "#97b500",
"description": "Buy the best meal from your nearby restaurant",
"slug": "food",
"is_active": 1,
"in_order": 2,
"created_at": "2021-06-30 10:45:53",
"updated_at": "2024-03-26 12:50:04",
"deleted_at": null,
"formatted_date": "30 Jun 2021",
"logo": "http://flyingarrow.com.sa/images/default.png",
"website_header": "",
"has_banners": 0
},
"fees": [],
"days": []
},
"tags": []
}
}
Order Crud
You can make a call to the order API endpoint to record orders on our system. You can create a new order, update the status/payment_status of any already created order, or delete an order.
Api Endpoint:
https://“DATA_SYNC_API_ENPOINT”/orders
Sample Request:
{
"code": "30997091142360",
"verification_code": "5923393",
"note": "no spice",
"payment_status": "pending",
"sub_total": 62,
"tip": 0,
"discount": 0,
"delivery_fee": 20.83,
"commission": 0,
"tax": 0,
"tax_rate": 0,
"total": 82.83,
"delivery_address_id": 59,
"pickup_date": null,
"pickup_time": null,
"package_type_id": null,
"weight": 0,
"width": 0,
"length": 0,
"height": 0,
"payer": 1,
"payment_method_id": 1,
"vendor_id": 2,
"user_id": 1,
"driver_id": null,
"status": "ready",
"attachments": [],
"user": {"id": 1,
"code": "3sp1Oq",
"name": "Mohamed zaky",
"email": "Mohamedzaky252@yahoo.com",
"phone": "+966533862521",
"country
code": "SA",
"sync_code": "26F356-v5bcO",
"photo": "https://flyingarrow.com.sa/images/user.png",}
"driver": null,
"products": [
{
"id": 13,
"quantity": 2,
"price": 31,
"options": "",
"options_ids": "",
"product_id": 299,
"product": {
"name": "Fried Rice",
"description": "Nice meal for the month",
"price": 250,
"discount_price": 100,
"sync_code": "20B132-ElZmR",
"photo": "https://images.unsplash.com/photo-1711816769781-0a8194f44399?q=80&w=1968&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"vendor_id": 2
}
}
],
"delivery_address": {
"id": 59,
"name": "heraa",
"description": null,
"address": "JCMB306,jeddah",
"latitude": 21.5459086,
"longitude": 39.2123393,
"city":"Jeddah",
"state":"Makkah",
"country":"Saudi,
"is_default": 0,
"user_id": 1,
},
"payment_method": {
"slug": "cash"
},
"vendor": {
"name": "أصول الكبدة - osool Elkebdah",
"description":"Kebdah experince",
"base_delivery_fee": 16,
"delivery_fee": 1,
"delivery_range": 40,
"tax": "0",
"phone": "+966555519058",
"email": "shmjh345@gmail.com",
"address": "Qays Ibn Sayfi, Al-Safa, Jeddah 23455, Saudi Arabia",
"latitude": "21.5892571",
"longitude": "39.2096954",
"commission": 5,
"pickup": 1,
"delivery": 1,
"is_active": 1,
"min_order": 20,
"max_order": 1000000,
"prepare_time": "30",
"delivery_time": "60",
"sync_code": "20B132-ElZmR",
"logo": "https://flyingarrow.com.sa/storage/479/A6RA1-1710444436.jpg",
"feature_image": "https://flyingarrow.com.sa/storage/495/sMJ7Y-1710709645.jpg",
"vendor_type": {
"slug": "food"
}
}
}
Sample Response
{
"message": "Order recorded successfully",
"order": {
"id": 3,
"code": "30997091142360",
"verification_code": "5923393",
"note": "no spice",
"reason": null,
"payment_status": "pending",
"sub_total": 62,
"tip": 0,
"discount": 0,
"delivery_fee": 20.83,
"commission": 0,
"tax": 0,
"tax_rate": 0,
"fees": "[]",
"total": 82.83,
"delivery_address_id": 1,
"pickup_date": null,
"pickup_time": null,
"package_type_id": null,
"weight": 0,
"width": 0,
"length": 0,
"height": 0,
"payer": 1,
"payment_method_id": 1,
"vendor_id": 2,
"user_id": 6,
"driver_id": null,
"created_at": "2024-03-28 09:33:53",
"updated_at": "2024-04-02 09:28:42",
"deleted_at": null,
"third_party_token_id": 4,
"payment_link": "http://flyingarrow.com.sa/order/payment?code=30997091142360",
"formatted_date": "28 Mar 2024",
"type": "food",
"formatted_type": "Food Delivery ",
"can_rate": false,
"can_rate_driver": false,
"can_cancel": false,
"status": "ready",
"pickup_location": null,
"dropoff_location": null,
"photo": "http://flyingarrow.com.sa/images/default.png",
"signature": "",
"attachments": [],
"user": {
"id": 6,
"code": null,
"name": "Mohamed zaky",
"email": "Mohamedzaky252@yahoo.com",
"phone": "+966533862521",
"country_code": "SA",
"commission": 0,
"email_verified_at": null,
"vendor_id": null,
"is_active": 1,
"is_online": 0,
"creator_id": null,
"language": "en",
"created_at": "2024-03-23T16:17:26.000000Z",
"updated_at": "2024-03-23T16:17:26.000000Z",
"deleted_at": null,
"syn_code": "26F356-v5bcO",
"third_party_token_id": null,
"role_name": "",
"role_id": "",
"formatted_date": "23 Mar 2024",
"photo": "http://flyingarrow.com.sa/images/user.png",
"rating": "3",
"assigned_orders": 0,
"raw_phone": "0533862521",
"is_taxi_driver": false,
"document_requested": false,
"pending_document_approval": false,
"roles": [],
"media": [],
}
"driver": null,
"statuses": [
{
"id": 13,
"name": "ready",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-04-02 09:28:44",
"updated_at": "2024-04-02 09:28:44",
}
{
"id": 12,
"name": "ready",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-04-02 09:28:42",
"updated_at": "2024-04-02 09:28:42",
}
{
"id": 11,
"name": "ready",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-04-02 09:23:42",
"updated_at": "2024-04-02 09:23:42",
}
{
"id": 10,
"name": "ready",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-04-02 08:34:00",
"updated_at": "2024-04-02 08:34:00",
}
{
"id": 6,
"name": "ready",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-03-28 09:37:07"
"updated_at": "2024-03-28 09:37:07",
}
{
"id": 5,
"name": "pending",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-03-28 09:36:51",
"updated_at": "2024-03-28 09:36:51",
}
{
"id": 4,
"name": "pending",
"reason": null,
"model_type": "App\\Models\\Order",
"model_id": 3,
"created_at": "2024-03-28 09:33:53",
"updated_at": "2024-03-28 09:33:53"
}
,]
"stops": [],
"order_service": null,
"taxi_order": null,
"vendor": {
"id": 2,
"name": "أصول الكبدة - osool Elkebdah",
"description":"healthy",
"base_delivery_fee": 5,
"delivery_fee": 1,
"delivery_range": 40,
"tax": "0",
"phone": "+966555519058",
"email": "shmjh345@gmail.com",
"address": "Qays Ibn Sayfi, Al-Safa, Jeddah 23455, Saudi Arabia"
"latitude": "21.5892571",
"longitude": "39.2096954",
"commission": 5,
"pickup": 1,
"delivery": 1,
"is_active": 1,
"charge_per_km": 1,
"is_open": true,
"vendor_type_id": 2,
"auto_assignment": 1,
"auto_accept": 0,
"allow_schedule_order": false,
"has_sub_categories": false,
"min_order": "0",
"max_order": "1000000",
"use_subscription": false,
"has_drivers": 0,
"prepare_time": null,
"delivery_time": null,
"in_order": 1,
"featured": 0,
"created_at": "2024-04-02 08:44:26",
"updated_at": "2024-04-02 09:23:42",
"deleted_at": null,
"creator_id": null,
"sync_code": "20B132-ElZmR",
"third_party_token_id": 4,
"reviews_count": 0,
"formatted_date": "02 Apr 2024",
"logo": "http://flyingarrow.com.sa/images/default.png",
"feature_image": "http://flyingarrow.com.sa/images/default.png",
"rating": 5,
"can_rate": false,
"slots": [],
"is_package_vendor": 1,
"has_subscription": true,
"document_requested": false,
"pending_document_approval": false,
"vendor_type": {
"id": 2,
"name": "Food Delivery ",
"color": "#97b500",
"description": "Buy the best meal from your nearby restaurant",
"slug": "food",
"is_active": 1,
"in_order": 2,
"created_at": "2021-06-30 10:45:53",
"updated_at": "2024-03-26 12:50:04",
"deleted_at": null,
"formatted_date": "30 Jun 2021",
"logo": "http://flyingarrow.com.sa/images/default.png",
"website_header": "",
"has_banners": 0
},
"fees": [],
"days": []
}
}
}