Introduction

To integrate with our API, you will need to obtain a username and password from our company, Blink. These credentials will serve as your authentication information for making API requests.

Follow these steps to acquire the necessary credentials:

  1. Contact our company, Blink, to express your interest in integrating with our API. You can reach out to our support team or designated API contact for assistance.
  2. Provide the required details about your application and the purpose of integration. This information will help us understand your specific needs and ensure a smooth integration process.
  3. Once your request is approved, we will provide you with a unique username and password. These credentials will be associated with your account and grant you access to our API.
  4. Safeguard your username and password as confidential information. Treat them with the same level of security as you would for other sensitive credentials associated with your application.
  5. You are now ready to proceed with integrating our API into your application. Include the provided username and password in your API requests as part of the authentication process.
Important: Keep your credentials secure and avoid sharing them with unauthorized individuals. If you suspect any compromise or unauthorized access, contact our support team immediately.

Base URLs

Production
api.blinkco.io
Sandbox
stg-api.blinkco.io

Authorization API

The Authorization API allows you to interact with Blink API's. Obtain a bearer token using your credentials.

Endpoint

POST /interface/v1/login

Request Parameters

ParameterTypeRequiredDescription
username string required Blink will provide the required username.
password string required Blink will provide the required password.

Sample Payload

{
    "username": "xxxxxxxxx",
    "password": "xxxxxxxxx"
}

Sample Response

{
    "token_type": "Bearer",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....."
}

If your request is valid, the authorization server will return an access token. If your request is invalid, it will return an error message.

Using the Token

curl -X GET \
    URL/interface/v1/branches \
    -H 'Authorization: Bearer eyJ0eXAiOiJKV1Qi...' \
    -H 'Content-Type: application/json'

Fetch Menu

This API allows you to fetch products from your Blink restaurant's menu.

Endpoint

GET /interface/v1/fetchMenu

Response Parameters

ParameterTypeNullableDescription
total_itemsintegernoTotal number of items available across all pages.
last_pageintegernoThe last page number of the paginated response.
current_pageintegernoThe current page number in the response.
per_pageintegernoNumber of items per page.
next_page_pathstringyesURL to the next page of results.
last_page_pathstringyesURL to the last page of results.
data[]arraynoArray of menu items.
data[].idstringnoItem ID.
data[].namestringnoItem name.
data[].pricestringnoItem price.
data[].discount_pricestringyesDiscounted price if available.
data[].categoryarraynoAn array of categories the item belongs to.
data[].category[].idintegernoID of the category.
data[].category[].codestringyesOptional code of the category.
data[].category[].namestringnoName of the category.
data[].branchesarrayyesList of branches offering this item.
data[].modifiersarrayyesList of modifiers that can be applied to the item.
data[].modifiers[].idintegernoModifier ID.
data[].modifiers[].codestringyesModifier code.
data[].modifiers[].namestringnoName of the modifier group.
data[].modifiers[].is_requiredbooleannoWhether the modifier is mandatory for selection.
data[].modifiers[].max_multi_select_countintegernoMaximum number of options that can be selected.
data[].modifiers[].min_multi_select_countintegernoMinimum number of options that must be selected.
data[].modifiers[].modifier_optionsarraynoList of selectable options within a modifier.
data[].modifiers[].modifier_options[].idintegernoID of the modifier option.
data[].modifiers[].modifier_options[].codestringyesOptional code of the option.
data[].modifiers[].modifier_options[].namestringnoName of the option.
data[].modifiers[].modifier_options[].pricestringnoPrice of the option.
data[].modifiers[].modifier_options[].discount_pricestringnoDiscounted price if available.

Sample Response

{
    "total_items": 9,
    "last_page": 5,
    "current_page": 2,
    "per_page": 2,
    "next_page_path": "https://api.blinkco.io/interface/v1/fetchMenu?page=3",
    "last_page_path": "https://api.blinkco.io/interface/v1/fetchMenu?page=5",
    "data": [
        {
            "id": "",
            "name": "Parisian Platter of Mini Sandwiches",
            "price": "7199.980",
            "discount_price": "0.000",
            "category": [
                {
                    "id": 126873,
                    "code": null,
                    "name": "Cocktails & Aperitifs"
                }
            ],
            "branches": [],
            "modifiers": []
        },
        {
            "id": "",
            "name": "The PAUL Baguette with Cheese",
            "price": "1299.990",
            "discount_price": "0.000",
            "category": [
                {
                    "id": 126875,
                    "code": null,
                    "name": "Breads"
                }
            ],
            "branches": [],
            "modifiers": [
                {
                    "id": 1531139,
                    "code": null,
                    "name": "test1",
                    "is_required": false,
                    "max_multi_select_count": 3,
                    "min_multi_select_count": 2,
                    "modifier_options": [
                        {
                            "id": 12289595,
                            "code": "",
                            "name": "testa",
                            "price": "20.000",
                            "discount_price": "0.000"
                        },
                        {
                            "id": 12289596,
                            "code": "",
                            "name": "testb",
                            "price": "15.000",
                            "discount_price": "0.000"
                        }
                    ]
                }
            ]
        }
    ]
}

Stock and Price Syncing

This API allows you to manage products stock & prices in your restaurant's menu. By sending the menu data in the specified format, you can update the stock and price.

Endpoint

POST /interface/v1/syncStockAndPrice

Request Parameters

ParameterTypeRequiredDescription
productsarrayrequiredAn array containing the details of the products.
products.idstringrequiredThe ID of the product.
products.pricedecimalrequiredThe price of the product.
products.discount_pricedecimalrequiredThe discount price of the product (send 0 if no discount).
products.branchesarrayrequiredAn array containing the branches associated with the product.
products.branches.idstringrequiredThe ID of the branch.
products.branches.pricedecimalsometimesThe price of the product in the specific branch (null if price is same).
products.branches.discount_pricedecimalsometimesThe discounted price of the product in the specific branch (null if price is same).
products.branches.stock_quantityintegersometimesThe stock of the product in the specific branch.

Sample Payload

{
    "products": [
        {
            "id": "97358ecc-06aa-4a8c-8249-6113261ac5a8",
            "price": 94.72,
            "discount_price": 94.72,
            "branches": [
                {
                    "id": "12345",
                    "is_active": true,
                    "price": 94.72,
                    "discount_price": 94.72,
                    "stock_quantity": 1
                }
            ]
        }
    ]
}

Order Status Webhook

The Order Status Webhook allows you to manage order status in your restaurant's system.

Receive Order Status Updates

A webhook is a mechanism used to inform external applications about specific events in real-time. Rather than requiring applications to constantly query the API for the latest data, Blink sends a webhook notification whenever a particular event occurs.

Please provide the webhook status update POST URL to Blink, in order to receive real-time orders status updates.

Webhook Timeout

Blink webhooks have a timeout of 5 seconds for requests. If your server fails to respond within this timeframe, the request will be terminated and not processed further.

Request Parameters

FieldTypeDescription
branch_idstringRepresents the branch id of blink's system.
blink_order_idstringRepresents the order id of blink's system.
statusintCurrent status of order according to order status table.
statusTextstringRepresents the status text of order i.e "Accepted"/"Dispatched"/"Delivered" etc.
commentstringReason of order rejection.
created_atdatetimeTimestamp of when the status was updated (UTC).
action_bystringRepresents who performed the action on the order.

Sample Webhook Payload

{
    "blink_order_id": "1236589",
    "branch_id": "12345",
    "status": 4,
    "statusText": "Rejected",
    "comment": "TEST ORDER",
    "created_at": "2023-10-10 12:00:00",
    "action_by": "Restaurant"
}

Branches

The API allows you to fetch all branches from blink's system.

Endpoint

GET /interface/v1/branches

Sample Response

{
    "msg": "Success",
    "success": true,
    "error": null,
    "data": [
        {
            "id": 63,
            "blink_id": 60001,
            "branch": "Clifton-Block 4",
            "branch_address": "209 Bolvard center, caspian road beside Hollywood Cafe",
            "is_live": 1,
            "is_active": 1
        },
        {
            "id": 64,
            "blink_id": 60002,
            "branch": "SMCHS-12",
            "branch_address": "Plot#212 Rae Avenue road",
            "is_live": 1,
            "is_active": 1
        }
    ]
}

Customers

The API allows you to fetch all customers from blink's system.

Endpoint

GET /interface/v1/customers

Request Parameters

FieldTypeRequiredDescription
phonestringoptionalRepresents the phone number of the customer (Format: 923XXXXXXXXX).
created_atdatetimeoptionalFilter to return users who were created after the specified date.

Sample Response

{
    "msg": "Success",
    "success": true,
    "error": null,
    "data": {
        "current_page": 1,
        "data": [
            {
                "full_name": "John Doe",
                "phone": "+9233XXXXXXX",
                "gender": "Male",
                "date_of_birth": "1990-01-01",
                "created_at": "2023-01-01 00:00:00",
                "email": "[email protected]",
                "wallet_balance": "23",
                "loyalty_points": "100"
            }
        ],
        "first_page_url": "URL/interface/v1/customers?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "URL/interface/v1/customers?page=1",
        "next_page_url": null,
        "path": "URL/interface/v1/customers",
        "per_page": 100,
        "prev_page_url": null,
        "to": 4,
        "total": 4
    }
}

Map Branches

By following these steps you can map your branches with Blink's system.

  1. Log in to your account and access the administration panel.
  2. Locate and click on the Branch Settings option in the side menu.
  3. In the Branch Settings page, you will see a list of your branches.
  4. Find the branch you want to map and click on the Edit button. This will take you to the Edit Branch Settings page, where you can configure branch-specific settings.
Edit Branch Settings
  1. Look for the tab labeled Step 2 and click on it to proceed.
  2. Enter the branch code accurately in the Third Party Branches field.
  3. After completing all the required configurations, click on the Save Branch Settings button to save your changes.
Map Branches

By following these steps, you will successfully map your system branches with our system. If you encounter any issues, please contact our support team for assistance.

Order Webhook

The Order Webhook allows you to manage orders in your restaurant's system.

Receive an Order

A webhook is a mechanism used to inform external applications about specific events in real-time. Rather than requiring applications to constantly query the API for the latest data, Blink sends a webhook notification whenever a particular event occurs.

Please provide the webhook POST URL to Blink, in order to receive real-time orders.

Webhook Timeout

Blink webhooks have a timeout of 5 seconds for requests. If your server fails to respond within this timeframe, the request will be terminated and not processed further.

Request Parameters

FieldTypeDescription
blink_order_idstringRepresents the order id of blink's system.
external_order_idstringRepresents the order id of third-party channel (e.g Foodpanda).
order_keystringThe customers have this alphanumeric order no.
typestringRepresents the type of order: "PICK-UP" / "DINE-IN" / "DELIVERY".
statusstringRepresents the status of the order (0, 1 etc).
status_textstringRepresents the status text (e.g "Pending", "Accepted").
currencystringCurrency of the order (e.g "PKR", "USD").
channelstringThe channel from which order is received (e.g ANDROID, IOS, WEBSITE, CALL-IN ORDER, QR ORDER, FOODPANDA).
channel_idstringThe channel Id (e.g ANDROID=7, IOS=8, WEBSITE=9, CALL-IN ORDER=10, QR ORDER=11, FOODPANDA=12).
brand_idstringThe ID of the brand associated with the order.
branch_idstringThe ID of the branch associated with the order.
area_namestringThe name of the area associated with the order.
blink_branch_idstringThe blink ID of the branch.
branch_latitudestringThe latitude of the branch.
branch_longitudestringThe longitude of the branch.
branch_addressstringThe address of the branch.
total_discount_amountintegerThe total amount of discount applied.
promo_codestringThe promotional code used, if any.
promo_discountintegerThe discount amount applied through the promotional code.
loyalty_amountfloatThe loyalty amount applied on order.
wallet_amountfloatThe wallet amount applied on order.
fbr_pos_chargefloatThe FBR POS charge applied on order.
taxfloatThe tax applied on order.
kitchen_notesstringAdditional notes or instructions for the kitchen.
created_atstringThe creation time (UTC).
due_atstringThe order place time (ASAP) or due time (UTC) for pre-orders.
is_pre_orderintegerThe is_pre_order will be either 0 or 1.
customer_namestringThe name of the customer placing the order.
customer_phonestringThe phone number of the customer.
customer_address_descriptionstringDescription of the customer's address.
customer_address_latitudenullThe latitude of the customer's address.
customer_address_longitudenullThe longitude of the customer's address.
paymentbooleanReturns true if paid, else false.
payment_methodstringThe payment method (Cash or other selected method).
payment_method_idstringThe payment method ID (Cash=0, or other).
delivery_chargesstringThe delivery charges.
subtotalstringThe subtotal of order.
total_pricestringThe total price of order.
productsarrayAn array of products included in the order.
products[].product_idstringThe ID of the product.
products[].quantityintegerThe quantity of the product.
products[].namestringThe name of the product.
products[].unit_pricestringThe unit price of the product.
products[].total_priceintegerThe total price of the product.
products[].item_priceintegerThe item price of the product.
products[].item_discount_priceintegerThe item discount price of the product.
products[].optionsarrayAn array of options chosen for the product.
products[].options[].modifier_option_idstringThe ID of the selected modifier option.
products[].options[].unit_pricestringThe unit price of the selected modifier option.
products[].options[].total_pricestringThe total price of the selected modifier option.
products[].options[].item_pricestringThe item price of the selected modifier option.
products[].options[].item_discount_pricestringThe item discount price of the selected modifier option.
products[].options[].namestringThe name of the selected modifier option.
products[].options[].quantityintegerThe quantity of the selected modifier option.

Webhook Payload

{
    "blink_order_id": "1236589",
    "external_order_id": "UYI-9IY",
    "order_key": "ABND-24234",
    "type": "PICK-UP",
    "status": "0",
    "status_text": "PENDING",
    "currency": "PKR",
    "channel": "IOS",
    "channel_id": "8",
    "area_name": "Precinct-11A",
    "brand_id": "2131",
    "branch_id": "12345",
    "blink_branch_id": "50220",
    "branch_latitude": "27.4654584",
    "branch_longitude": "64.846548",
    "branch_address": "XYZ road street 13",
    "total_discount_amount": 0,
    "promo_code": "",
    "promo_discount": 0,
    "wallet_amount": 0,
    "loyalty_amount": 0,
    "tax": 0,
    "fbr_pos_charge": 1,
    "kitchen_notes": "",
    "created_at": "2024-06-26 09:26:04",
    "due_at": "2024-06-26 09:26:04",
    "is_pre_order": 0,
    "customer_name": "John Doe",
    "customer_phone": "+923300000000",
    "customer_address_description": "PICK-UP",
    "customer_address_latitude": null,
    "customer_address_longitude": null,
    "products": [
        {
            "product_id": "1c54bd7abe7b",
            "quantity": 1,
            "name": "Veg Breakfast Press COMBO",
            "unit_price": "39.000",
            "total_price": 39,
            "item_price": "39.00",
            "item_discount_price": "0.00",
            "options": [
                {
                    "modifier_option_id": "cfeed7290c4c",
                    "unit_price": "0.000",
                    "total_price": "0.000",
                    "name": "Tortilla (Wrap)",
                    "quantity": 1,
                    "item_price": "0.00",
                    "item_discount_price": "0.00"
                }
            ]
        }
    ],
    "payment": true,
    "payment_method_id": "0",
    "payment_method": "Cash",
    "delivery_charges": "0",
    "subtotal": "59",
    "total_price": "66.67"
}

Orders

Submit, retrieve, and manage orders through the Blink API

Submit Order

This API allows you to push new orders to the Blink system.

Endpoint

POST /interface/v1/submitOrder

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Request Parameters

ParameterTypeRequiredDescription
blink_branch_idstringrequiredRepresents the branch id of blink's system.
delivery.house_numstringrequiredThe house/flat number of the customer.
delivery.streetstringrequiredThe street name of the customer's address.
delivery.buildingstringoptionalThe building name in the customer's address.
delivery.areastringrequiredThe area/locality of the customer's address.
delivery.citystringrequiredThe city of the customer's address.
delivery.latitudefloatoptionalThe latitude coordinate of the customer's address.
delivery.longitudefloatoptionalThe longitude coordinate of the customer's address.
customer_namestringrequiredThe name of the customer placing the order.
customer_phonestringrequiredThe phone number. Formats: +92xxxx, +92xxx-xxx
customer_emailstringoptionalThe email address of the customer.
is_scheduledintegerrequiredIndicates if the order is scheduled (1) or ASAP (0).
scheduled_delivery_timestringoptionalThe scheduled time for delivery (if applicable).
delivery_typestringrequiredThe type of delivery: dinein, pickup, or delivery.
payment_methodstringrequiredThe selected payment method: Cash or Online.
tax_amountstringoptionalThe tax amount applied to the order.
tax_percentagestringoptionalThe tax percentage applied on the subtotal.
subtotalstringrequiredThe subtotal of the order before taxes and charges.
totalstringrequiredThe final total amount of the order.
delivery_chargesstringrequiredThe charges applied for delivery.
delivery_etaintegeroptionalEstimated delivery time in minutes. Default: 60
instructionsstringoptionalAny additional instructions from the customer.
itemsarrayrequiredAn array of items included in the order.
items[].blink_item_idstringrequiredThe blink's ID of the ordered item.
items[].namestringrequiredThe name of the ordered item.
items[].descriptionstringoptionalThe description of the ordered item.
items[].notesstringoptionalAdditional notes for the item.
items[].actual_pricestringrequiredThe original price of the item.
items[].pricestringrequiredThe selling price of the item.
items[].quantitystringrequiredThe quantity of the item ordered.
items[].sub_optionsarrayoptionalAn array of sub-options/modifiers for the item.
items[].sub_options[].sub_option_idstringrequiredThe ID of the sub-option.
items[].sub_options[].pricestringrequiredThe price of the selected sub-option.
items[].sub_options[].quantitystringrequiredThe quantity of the selected sub-option.

Sample Payload

{
    "blink_branch_id": "60002",
    "delivery": {
        "house_num": "Flat B-1203",
        "street": "Rashid Minhas Road",
        "building": "Noman Grand City",
        "area": "Gulshan-e-Iqbal Block 7",
        "city": "Karachi",
        "latitude": 24.918682,
        "longitude": 67.102982
    },
    "customer_phone": "+92333-2222222",
    "customer_name": "Test Order User",
    "is_scheduled": 1,
    "scheduled_delivery_time": "22-05-2025 08:00 PM",
    "delivery_type": "delivery",
    "payment_method": "Cash",
    "tax_amount": "12",
    "tax_percentage": "0",
    "subtotal": "90",
    "total": "132",
    "delivery_charges": "30",
    "delivery_eta": 45,
    "instructions": "test note",
    "items": [
        {
            "blink_item_id": "257327",
            "name": "Nestle MilkPak Full Cream Milk 250ml",
            "description": "Nestle MilkPak Full Cream Milk 250ml",
            "notes": "test note",
            "actual_price": "110",
            "price": "85",
            "quantity": "2",
            "sub_options": [
                {
                    "sub_option_id": "596996",
                    "price": "5",
                    "quantity": "1"
                }
            ]
        }
    ]
}

Sample Response

HTTP Code: 201 Content Type: JSON
{
    "success": true,
    "msg": "Your order has been placed",
    "data": {
        "id": 988278,
        "unique_code": "2349-JLMD3"
    }
}

Fetch Order

This API allows you to get order details from blink's system.

Endpoint

GET /interface/v1/getOrder

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Query Parameters

ParameterTypeRequiredDescription
order_idstringrequiredThe ID of the order. Example: 34862444
unique_codestringoptionalThe unique code of the order.

Sample Response

HTTP Code: 201 Content Type: JSON
{
    "success": true,
    "data": {
        "id": 988309,
        "unique_code": "1T4I-C7WC1",
        "customer_name": "Test Order User",
        "customer_phone": "+923332222222",
        "latitude": "24.918682",
        "longitude": "67.102982",
        "delivery_eta": 45,
        "delivery_type": "delivery",
        "status": "ACCEPTED",
        "ordertime": "2025-05-22 08:02:10",
        "instruction": "test note",
        "payment_method": "Cash",
        "subtotal": 90,
        "total": 132,
        "delivery_charges": 30,
        "promo_code": "",
        "promo_discount": 0,
        "reject_reason": "",
        "items": [
            {
                "item_id": 257327,
                "quantity": 2,
                "price": 90,
                "actual_price": 115,
                "details": "Nestle MilkPak Full Cream Milk 250ml",
                "notes": "test note"
            }
        ]
    }
}

Order List

This API allows you to get all order details from blink's system.

Endpoint

GET /interface/v1/getOrderList

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Query Parameters

ParameterTypeRequiredDescription
order_idstringrequiredOrders with order_id greater than this value will return in response. Example: 34862444

Sample Response

HTTP Code: 200 Content Type: JSON
{
    "success": true,
    "data": [
        {
            "id": 34862445,
            "unique_code": "KXC2-SQ740",
            "customer_name": "John Doe",
            "customer_phone": "+920554897875",
            "delivery_type": "delivery",
            "status": "REJECTED",
            "ordertime": "2024-01-07 08:51:46",
            "payment_method": "Cash",
            "subtotal": 47,
            "total": 53.11,
            "delivery_charges": 0,
            "items": [
                {
                    "item_id": 1567138,
                    "quantity": 1,
                    "price": 23,
                    "actual_price": 23,
                    "details": "Chicken Bites 8 Pcs",
                    "notes": null
                }
            ]
        }
    ],
    "pagination": {
        "total": 441,
        "per_page": 30,
        "current_page": 1,
        "last_page": 15,
        "from": 1,
        "to": 30,
        "has_more": true
    }
}

Get Abandoned Carts

This API allows you to fetch abandoned cart data from blink's system. Use it to retrieve carts that customers created but did not convert into orders, enabling follow-up engagement and recovery campaigns.

Endpoint

GET /interface/v1/getAbandonedCarts

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Query Parameters

ParameterTypeRequiredDescription
start_datestringrequiredStart date-time for the query range. Format: YYYY-MM-DD HH:mm
end_datestringrequiredEnd date-time for the query range. Format: YYYY-MM-DD HH:mm

Sample Response

HTTP Code: 200 Content Type: JSON
{
    "success": true,
    "pagination": {
        "total": 177,
        "per_page": 5,
        "current_page": 1,
        "last_page": 36,
        "from": 1,
        "to": 5,
        "has_more": true
    },
    "data": {
        "current_page": 1,
        "data": [
            {
                "order_id": "",
                "branch_id": "",
                "customer": {
                    "name": "Test User",
                    "phone": "+9233XXXXXXX",
                    "address": "",
                    "latitude": "",
                    "longitude": ""
                },
                "notification": {
                    "status": "SENT",
                    "sent_at": "2026-02-09 08:34:04"
                },
                "created_at": "2026-02-09 08:08:18",
                "cart_value": 744,
                "cart_items": [
                    {
                        "dish_id": 722688,
                        "quantity": 1,
                        "details": "Abbott Similac Total Comfort 2 (6-12 Months) 360g",
                        "unit_price": "142.000",
                        "actual_unit_price": "142.000",
                        "total_price": "344.0",
                        "actual_total_price": "344.0",
                        "selected_suboption_ids": "[]",
                        "options": [
                            {
                                "id": 707758,
                                "name": "Variation",
                                "suboptions": [
                                    {
                                        "id": 6044445,
                                        "name": "per unit",
                                        "price": "0.000",
                                        "actual_price": "0.000"
                                    }
                                ]
                            },
                            {
                                "id": 191554,
                                "name": "Sauce",
                                "suboptions": [
                                    {
                                        "id": 6052048,
                                        "name": "test",
                                        "price": "0.000",
                                        "actual_price": "200.000"
                                    },
                                    {
                                        "id": 896289,
                                        "name": "Buffalo",
                                        "price": "0.000",
                                        "actual_price": "2.000"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Order Status Syncing

The Order Status API allows you to update order status in blink's system.

Endpoint

POST /interface/v1/syncOrderStatus

Order Status

StatusDescription
0 — PendingWhen the order is created in Blink it will land in the PENDING status.
1 — AcceptedWhen the order is accepted the status will be updated to ACCEPTED.
6 — ReadyWhen the order is ready for dispatch, status becomes READY.
2 — DispatchedWhen the order is dispatched, status becomes DISPATCHED.
3 — DeliveredWhen the order is delivered, status becomes DELIVERED.
4 — RejectedWhen the order is rejected, status becomes REJECTED.

Request Parameters

ParameterTypeRequiredDescription
blink_order_idstringrequiredAn order id that is provided by Blink at the time of order.
statusintrequiredCurrent status of order according to order status table above.
commentstringrequired if status is 4Reason of order rejection.

Sample Payloads

Accept an order:

{
    "blink_order_id": "123456",
    "status": 1
}

Reject an order:

{
    "blink_order_id": "123456",
    "status": 4,
    "comment": "Delivery area is too far"
}

Logistics

Manage delivery tasks through the Blink Logistics API

Introduction to Blink Logistics

To integrate with our Logistics API, you will need to obtain a token from our Blink Logistics Portal. This token will serve as your authentication information for making API requests.

Logistics Token Setting

Logistics Base URLs

Production
https://api-delivery.blinkco.io
Sandbox
https://stg-delivery.blinkco.io
Important: Keep your credentials secure and avoid sharing them with unauthorized individuals. If you suspect any compromise, contact our support team immediately.

Task Creation

The API allows you to send a task to the logistics portal.

Endpoint

POST /api/client/task

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Request Parameters

ParameterTypeRequiredDescription
sourcestringoptionalThe source of the task creation.
mappingKeystringrequiredReference Task Id.
mappingCodestringrequiredReference Task Id.
mappingBranchIdstringrequiredThe ID of the branch.
discountCodestringoptionalThe discount code used in the task.
taxdecimaloptionalThe tax value of the task.
taxPercentdecimaloptionalThe tax percentage of the task.
discountdecimaloptionalThe discount amount of the task.
deliveryChargesdecimaloptionalThe delivery charges of the task.
subTotaldecimaloptionalThe sub total of the task.
paymentTypestringrequiredPayment method: COD (Cash on Delivery) or ONLINE.
descriptionstringoptionalThe task description.
instructionstringoptionalThe task instructions.
customerNamestringrequiredThe name of the customer.
customerEmailstringoptionalThe email of the customer.
customerAddressstringrequiredThe address of the customer.
customerPhonestringrequiredThe phone number of the customer.
latstringrequiredThe latitude of the customer's address.
lngstringrequiredThe longitude of the customer's address.
pickUpTimedatetimerequiredThe pickup time of the task (UTC Format).
deliveryTimedatetimerequiredThe delivery time of the task (UTC Format).
typeintegerrequiredThe type of task: 1 (normal) or 2 (return).

Sample Payload

{
    "source": "SourceTesting",
    "mappingKey": "12345678",
    "mappingCode": "12345678",
    "mappingBranchId": "12345",
    "discountCode": "",
    "tax": 0,
    "taxPercent": 0,
    "discount": 0,
    "deliveryCharges": 120,
    "subTotal": 2080,
    "paymentType": "COD",
    "description": "Details: Milk Buffalo 1 Ltr Pouch, Quantity: 8",
    "instruction": "",
    "customerName": "Test Customer",
    "customerEmail": "[email protected]",
    "customerAddress": "Tariq Road, PECHS Block 2",
    "customerPhone": "923001234567",
    "lat": "24.871641",
    "lng": "67.059906",
    "deliveryTime": "2024-06-06T04:29:15.000Z",
    "pickUpTime": "2024-06-06T03:29:15.000Z",
    "type": 1
}

Sample Response

HTTP Code: 201 Content Type: JSON
{
    "eventId": 20,
    "event": "TASK_CREATED",
    "data": {
        "taskId": "XYZAB-12345",
        "type": 1
    }
}

Task Update

The API allows you to update an existing task.

Endpoint

PUT /api/client/task

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Request Parameters

ParameterTypeRequiredDescription
taskIdstringrequiredBlink logistics unique Id.
discountCodestringoptionalThe discount code used in the task.
taxdecimaloptionalThe tax value of the task.
taxPercentdecimaloptionalThe tax percentage of the task.
discountdecimaloptionalThe discount amount of the task.
deliveryChargesdecimaloptionalThe delivery charges of the task.
subTotaldecimaloptionalThe sub total of the task.
paymentTypestringoptionalPayment method: COD or ONLINE.
descriptionstringoptionalThe task description.
instructionstringoptionalThe task instructions.
customerNamestringoptionalThe name of the customer.
customerEmailstringoptionalThe email of the customer.
customerAddressstringoptionalThe address of the customer.
customerPhonestringoptionalThe phone number of the customer.
latstringoptionalThe latitude of the customer's address.
lngstringoptionalThe longitude of the customer's address.
pickUpTimedatetimeoptionalThe pickup time of the task (UTC Format).
deliveryTimedatetimeoptionalThe delivery time of the task (UTC Format).
typeintegerrequiredTask type: 1 (normal) or 2 (return).

Sample Response

HTTP Code: 201 Content Type: JSON
{
    "eventId": 21,
    "event": "TASK_UPDATED",
    "data": {
        "taskId": "XYZAB-12345",
        "type": 1
    }
}

Get Task Status

The API allows you to get the task updated status.

Endpoint

GET /api/client/task/status

Authorization

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9............

Query Parameters

ParameterTypeDescription
mappingKeystringReference key. Example: 12345678

Sample Response

HTTP Code: 200 Content Type: JSON
{
    "eventId": 24,
    "event": "TASK_ACCEPTED",
    "data": {
        "taskId": "XYZAB-12345",
        "type": 1,
        "reason": "",
        "agent": {
            "name": "Test Rider",
            "contact": "+923213456789"
        },
        "trackingLink": "https://delivery-stg.blinkco.io/tracking/jvkUgPIRN6f8jZg9q62xy"
    }
}

Task Status Reference

Event IdEvent NameDescription
20TASK_CREATEDA new order or shipment has been created in the system.
21TASK_UPDATEDAn existing order or shipment details have been modified.
22TASK_UNASSIGNAn order previously assigned to a driver is now unassigned.
23TASK_ASSIGNEDAn order has been allocated to a specific driver for processing.
24TASK_ACCEPTEDThe assigned driver has confirmed they can handle the order.
25TASK_ARRIVEDThe driver has reached the collection point.
26TASK_STARTEDThe driver has started moving toward the delivery location.
27TASK_FINISHEDThe goods have been delivered to the final destination.
28TASK_CANCELLEDThe order has been cancelled before completion.
29TASK_REASSIGNEDThe order has been re-assigned to a different driver.

Task Status Webhook

This webhook allows you to update order status according to task status.

Please update the webhook URL in the Blink Logistics portal in order to receive real-time task status.
Edit Branch Settings

Sample Webhook Payload

Content Type: JSON
{
    "eventId": 24,
    "event": "TASK_ACCEPTED",
    "data": {
        "taskId": "XYZAB-12345",
        "type": 1,
        "reason": "",
        "agent": {
            "name": "Test Rider",
            "contact": "+923213456789"
        },
        "trackingLink": "https://delivery-stg.blinkco.io/tracking/jvkUgPIRN6f8jZg9q62xy"
    }
}