Introduction

This page will guide you on how to start your Journey as Blinkco developer

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. This will validate your identity and allow you to access the desired API endpoints.

Note: It is important to keep your credentials secure and avoid sharing them with unauthorized individuals. If you suspect any compromise or unauthorized access to your credentials, contact our support team immediately to take appropriate actions.

Base_url For Live/Sandbox

  • Production API Base URL: api.blinkco.io
  • Sandbox API Base URL: stg-api.blinkco.io

Autorization API

The Autorization API allows you to interact with Blink API's.

Endpoint

POST /interface/v1/login

Requesting Access Token

Parameter Type Required Description
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 to get access token is valid, the authorization server will return an access token. If your request is invalid, the authorization server will return an error message

Sample Request with Authorization Header

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

Import Menu

The Products API allows you to manage products in your restaurant's menu.

Create a Product

The Menu Sync API allows you to synchronize your local menu data with our system. By sending the menu data in the specified format, you can update, add, or remove menu items from your account.

Endpoint

POST /interface/v1/importMenu

Request Parameters

Parameter Type Required Description
products array required An array containing the details of the products.
products.id string required The ID of the product.
products.sku string required The SKU (Stock Keeping Unit) of the product.
products.name string required The name of the product.
products.description string nullable The description of the product.
products.image string nullable The URL of the product image.
products.is_active boolean required Specifies whether the product is active or not.
products.price decimal required The price of the product.
products.branches array nullable An array containing the branches associated with the product.
products.branches.id string required The ID of the branch.
products.branches.is_active boolean required Specifies whether the branch is active or not.
products.branches.price decimal sometimes The price of the product in the specific branch (null if price is same).
products.branches.stock_qunatity integer sometimes The stock of the product in the specific branch.
products.category.id string required The ID of the category.
products.category.name string required The name of the category.
products.category.reference string nullable The reference of the category.
products.modifiers array nullable An array containing the modifiers associated with the product.
products.modifiers.id string required_with: products.modifiers The ID of the modifier.
products.modifiers.name string required_with: products.modifiers The name of the modifier.
products.modifiers.maximum_options integer required_with: products.modifiers The maximum number of options allowed for the modifier.
products.modifiers.priority integer required_with: products.modifiers The priority of the modifier.
products.modifiers.options array required_with: products.modifiers An array containing the options associated with the modifier.
products.modifiers.options.id string required_with: products.modifiers The ID of the option.
products.modifiers.options.name string required_with: products.modifiers The name of the option.
products.modifiers.options.is_active boolean required_with: products.modifiers Specifies whether the option is active or not.
products.modifiers.options.priority integer required_with: products.modifiers The priority of the option.
products.modifiers.options.branches array nullable An array containing the branches associated with the option.
products.modifiers.options.branches.id string required_with: products.modifiers. options.branches The ID of the branch.

Sample Payload

    {
        "products": [
            {
                "category": {
                    "id": "97358e65-33c9-400c-af7d-b43a95726e08",
                    "name": "pizza",
                    "reference": "2",
                    "image": null,
                    "deleted_at": null
                },
                "modifiers": [],
                "id": "97358ea0-242f-4ffa-818f-ab07c441c291",
                "sku": "sk-0004",
                "name": "ranch pizza",
                "description": null,
                "image": null,
                "is_active": true,
                "is_stock_product": false,
                "price": 75,
                "deleted_at": null,
                "branches": []
            },
            {
                "category": {
                    "id": "97358e65-33c9-400c-af7d-b43a95726e08",
                    "name": "pizza",
                    "reference": "2",
                    "image": null,
                    "deleted_at": null
                },
                "branches": [
                    {
                        "id": "12345",
                        "is_active": true,
                        "price": 94.72,
                        "is_in_stock": 1
                    }
                ],
                "modifiers": [
                    {
                        "options": [
                            {
                                "id": "973593a5-46ba-4e4b-868f-f55d7987bdd7",
                                "name": "ranch",
                                "sku": "sk-0010",
                                "is_active": true,
                                "price": 223.33,
                                "priority": 1,
                                "deleted_at": null,
                                "branches": [
                                    {
                                        "id": 12345,
                                        "is_active": true,
                                        "price": 94.72,
                                        "is_in_stock": 1
                                    }
                                ]
                            },
                            {
                                "id": "973593d1-7078-4968-b5ee-fc1400d88b5e",
                                "name": "sweet chili",
                                "sku": "sk-0011",
                                "is_active": true,
                                "price": 11,
                                "priority": 2,
                                "deleted_at": null,
                                "branches": []
                            }
                        ],
                        "minimum_options": 1,
                        "maximum_options": 3,
                        "priority": 0,
                        "id": "97359318-210a-451d-8a1f-88e2e46bd566",
                        "name": "sauceeE",
                        "deleted_at": null
                    }
                ],
                "id": "97358ecc-06aa-4a8c-8249-6113261ac5a8",
                "sku": "sk-0005",
                "name": "BBQ PIzza 10",
                "description": null,
                "image": "https://s3-console-sandbox.s3./images/logo.jpg",
                "is_active": true,
                "is_stock_product": false,
                "price": 94.72,
                "deleted_at": null
            }
        ]
    }
    

Stock and Price Syncing

This API allows you to manage products stock & prices in your restaurant's menu.

Syncing a Product

The Stock Sync API allows you to synchronize your local menu data with our system. By sending the menu data in the specified format, you can update the stock and price.

Endpoint

POST /interface/v1/syncStock

Request Parameters

Parameter Type Required Description
products array required An array containing the details of the products.
products.id string required The ID of the product.
products.price decimal required The price of the product.
products.discount_price decimal required The discount price of the product(send 0 if no discount).
products.branches array required An array containing the branches associated with the product.
products.branches.id string required The ID of the branch.
products.branches.price decimal sometimes The price of the product in the specific branch (null if price is same).
products.branches.discount_price decimal sometimes The discounted price of the product in the specific branch (null if price is same).
products.branches.stock_qunatity integer sometimes The 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 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 that they need to be aware of in real-time. Rather than requiring applications to constantly query the API for the latest data, Blink sends a webhook notification to the application whenever a particular event occurs. This allows applications to stay updated and receive timely information without the need for continuous manual requests.

Note: Please provide the webhook 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 Parameter

Field Type Description
blink_order_id string Represents the order id of blink's system.
type string Represents the type of order i.e "PICK-UP"/"DINE-IN"/"DELIVERY".
branch_id string The ID of the branch associated with the order.
total_discount_amount integer The total amount of discount applied.
promo_code string The promotional code used, if any.
promo_discount integer The discount amount applied through the promotional code.
kitchen_notes string Additional notes or instructions for the kitchen.
due_at string The due date and time for the order.
customer_name string The name of the customer placing the order.
customer_phone string The phone number of the customer.
customer_address_description string Description of the customer's address.
customer_address_latitude null The latitude of the customer's address.
customer_address_longitude null The longitude of the customer's address.
products array An array of products included in the order.
products[].product_id string The ID of the product.
products[].quantity integer The quantity of the product.
products[].name string The name of the product.
products[].unit_price string The unit price of the product.
products[].total_price integer The total price of the product.
products[].options array An array of options chosen for the product.
products[].options[].modifier_option_id string The ID of the selected modifier option.
products[].options[].unit_price string The unit price of the selected modifier option.
products[].options[].total_price string The total price of the selected modifier option.
products[].options[].name string The name of the selected modifier option.
products[].options[].quantity integer The quantity of the selected modifier option.

Webhook Payload

The following JSON represents the payload sent via the webhook:

    {
        "blink_order_id": "1236589",
        "type": "PICK-UP",
        "branch_id": "12345",
        "total_discount_amount": 0,
        "promo_code": "",
        "promo_discount": 0,
        "kitchen_notes": "",
        "due_at": "2023-06-26 09:26:04",
        "customer_name": "Jhon 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,
            "options": [
                {
                "modifier_option_id": "cfeed7290c4c",
                "unit_price": "0.000",
                "total_price": "0.000",
                "name": "Tortilla (Wrap)",
                "quantity": 1
                },
                {
                "modifier_option_id": "cf9dc0cab4db",
                "unit_price": "0.000",
                "total_price": "0.000",
                "name": "Lays - Chilli",
                "quantity": 1
                },
                {
                "modifier_option_id": "a5350464a755",
                "unit_price": "4.000",
                "total_price": "4.000",
                "name": "Extra Diced Tomatoes",
                "quantity": 1
                },
                {
                "modifier_option_id": "3aa58f39e7dc",
                "unit_price": "4.000",
                "total_price": "4.000",
                "name": "Extra Paneer",
                "quantity": 1
                },
                {
                "modifier_option_id": "2a9ab643341e",
                "unit_price": "0.000",
                "total_price": "0.000",
                "name": "7up (500 ml)",
                "quantity": 1
                }
            ]
            }
        ],
        "payment": true,
        "delivery_charges": "0",
        "subtotal": "59",
        "total_price": "66.67"
    }
        

Branches

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

Endpoint

POST /interface/v1/branches

Sample Request

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

Sample Response

The following JSON represents the reponse sent by blink:

    {
        "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

POST /interface/v1/customers

Sample Request

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

Sample Response

The following JSON represents the reponse sent by blink:

    {
        "msg": "Success",
        "success": true,
        "error": null,
        "data": {
            "current_page": 1,
            "data": [
                {
                    "full_name": "John Doe",
                    "phone": "+923368855221",
                    "email": "john.doe@example.com",
                    "total_orders": 23,
                    "signup_date": "2020-10-07 11:47:31"
                },
                {
                    "full_name": "Micheal Barak",
                    "phone": "+9663363752300",
                    "email": "micheal@example.com",
                    "total_orders": 1,
                    "signup_date": "2023-06-20 09:35:29"
                },
                {
                    "full_name": "Taco Ben",
                    "phone": "+903363752000",
                    "email": "t.ben@blinkco.io",
                    "total_orders": 1,
                    "signup_date": "2023-06-20 09:41:52"
                }
            ],
            "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 steps you can map your branches with blinks 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
  5. Look for the tab labeled Step 2 and click on it to proceed.
  6. Enter the branch code accurately in the Third Party Branches field.
  7. After completing all the required configurations, click on the Save Branch Settings button to save your changes.

By following these steps, you will successfully map your system branches with our system. If you encounter any issues or have further questions, please refer to the provided screenshots or contact our support team for assistance.

Order Status Syncing

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

Create a Product

The Menu Sync API allows you to synchronize your local menu data with our system. By sending the menu data in the specified format, you can update, add, or remove menu items from your account.

Endpoint

POST /interface/v1/syncOrderStatus

Order Status

Status Description
0 Pending When the order is created in Blink it will land in the PENDING status.
1 Accepted When the order is accepted in the blink application the status will be updated to ACCEPTED
2 Dispatched When the order is dispatched in the blink application the status will be updated to DISPACTCHED
3 Delivered when the order is delivered in Blink the status will be updated to DELIVERED
4 Rejected When the order is rejected from the Blink application the status will be updated to REJECTED

Request Parameters

Parameter Type Required Description
blink_order_id string required An order id that is provided by Blink at the time of order.
status int required Current status of order according to order status table above
comment int required if status is 4 Reason of order rejection

Sample Payload

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