Logo

Order Food Online API Documentation

Updated: January 06, 2024

Welcome to Our Order Food Online API

This API allows you to integrate seamless Order Food Online functionality into your application, making it easier for your customers to place orders and for you to manage them efficiently.

API Introduction

Our Order Food Online API provides a robust set of tools and endpoints to help you build and manage your Order Food Online system. It supports various functionalities such as order creation, management, and tracking, ensuring a smooth and efficient process for both you and your customers.

API Summary

Here is a summary of the key endpoints and functionalities provided by our Order Food Online API:

Endpoint Method Description
/orders GET Retrieve a list of orders.
/orders POST Create a new order.
/orders/{id} GET Retrieve a specific order by ID.
/orders/{id} PUT Update a specific order by ID.
/orders/{id} DELETE Delete a specific order by ID.
/customers GET Retrieve a list of customers.
/customers POST Create a new customer.
/customers/{id} GET Retrieve a specific customer by ID.
/customers/{id} PUT Update a specific customer by ID.
/customers/{id} DELETE Delete a specific customer by ID.

Order Food Online API SDK

Our Order Food Online API SDK makes it easy to integrate our API into your application. It supports multiple programming languages and provides a simple interface for interacting with our endpoints.

Installation

To install the SDK, you can use the following commands:

npm install orderfoodonline-api-sdk

Usage

Here is a basic example of how to use the SDK in a Node.js application:

const orderfoodonlineAPI = require('orderfoodonline-api-sdk');
    
    const api = new orderfoodonlineAPI({
        apiKey: 'YOUR_API_KEY'
    });
    
    // Create a new order
    api.orders.create({
        customer_id: 123,
        items: [
            { product_id: 456, quantity: 2 },
            { product_id: 789, quantity: 1 }
        ]
    }).then(order => {
        console.log('Order created:', order);
    }).catch(error => {
        console.error('Error creating order:', error);
    });

Special Data Types

The Order Food Online API uses several special data types to ensure consistency and clarity in data exchange. Here are the key data types:

Order

Represents an order in the system.

{
        "id": 123,
        "customer_id": 456,
        "items": [
            {
                "product_id": 789,
                "quantity": 2
            },
            {
                "product_id": 101,
                "quantity": 1
            }
        ],
        "status": "pending",
        "created_at": "2023-10-01T12:34:56Z",
        "updated_at": "2023-10-01T12:34:56Z"
    }

Customer

Represents a customer in the system.

{
        "id": 456,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "phone": "+1-800-555-1234",
        "address": {
            "street": "123 Main St",
            "city": "Anytown",
            "state": "CA",
            "zip": "12345",
            "country": "USA"
        },
        "created_at": "2023-09-15T09:23:45Z",
        "updated_at": "2023-09-15T09:23:45Z"
    }

Item

Represents an item in an order.

{
        "product_id": 789,
        "quantity": 2
    }

Address

Represents an address associated with a customer.

{
        "street": "123 Main St",
        "city": "Anytown",
        "state": "CA",
        "zip": "12345",
        "country": "USA"
    }

Errors

The Order Food Online API uses standard HTTP status codes to indicate the result of a request. Here are some common errors you might encounter:

Status Code Description Details
400 Bad Request The request was invalid or could not be processed. Check the request parameters and ensure they are correctly formatted.
401 Unauthorized The API key is missing or invalid. Ensure you are using a valid API key and it is included in the request headers.
403 Forbidden The API key does not have the necessary permissions. Contact support to ensure your API key has the required permissions.
404 Not Found The requested resource was not found. Verify the endpoint URL and ensure the resource exists.
500 Internal Server Error An unexpected error occurred on the server. Contact support with the request details for assistance.

Including Attributes

When making requests to the Order Food Online API, you can include specific attributes to customize the data returned. This allows you to retrieve only the information you need, improving performance and reducing data transfer.

Using Query Parameters

You can use query parameters to specify which attributes to include in the response. For example, to include only the `id`, `name`, and `email` attributes for customers, you can make a request like this:

GET /customers?fields=id,name,email

Example

Here is an example of how to include specific attributes in a request using the Order Food Online API SDK:

const orderfoodonlineAPI = require('orderfoodonline-api-sdk');
    
    const api = new orderfoodonlineAPI({
        apiKey: 'YOUR_API_KEY'
    });
    
    // Retrieve customers with specific attributes
    api.customers.list({ fields: 'id,name,email' })
        .then(customers => {
            console.log('Customers:', customers);
        })
        .catch(error => {
            console.error('Error retrieving customers:', error);
        });

Available Attributes

The following attributes are available for each resource:

Customers

  • id: Unique identifier for the customer.
  • name: Name of the customer.
  • email: Email address of the customer.
  • phone: Phone number of the customer.
  • address: Address associated with the customer.
  • created_at: Timestamp when the customer was created.
  • updated_at: Timestamp when the customer was last updated.

Orders

  • id: Unique identifier for the order.
  • customer_id: ID of the customer associated with the order.
  • items: List of items in the order.
  • status: Current status of the order.
  • created_at: Timestamp when the order was created.
  • updated_at: Timestamp when the order was last updated.

Order Data

The Order Food Online API provides detailed information about orders. Here is a breakdown of the order data structure:

{
        "id": 123,
        "customer_id": 456,
        "items": [
            {
                "product_id": 789,
                "quantity": 2
            },
            {
                "product_id": 101,
                "quantity": 1
            }
        ],
        "status": "pending",
        "created_at": "2023-10-01T12:34:56Z",
        "updated_at": "2023-10-01T12:34:56Z"
    }

Attributes

  • id: Unique identifier for the order.
  • customer_id: ID of the customer associated with the order.
  • items: List of items in the order, each with a `product_id` and `quantity`.
  • status: Current status of the order (e.g., pending, shipped, delivered).
  • created_at: Timestamp when the order was created.
  • updated_at: Timestamp when the order was last updated.

Pagination

The Order Food Online API supports pagination to handle large sets of data efficiently. You can use query parameters to control the pagination behavior.

Query Parameters

  • page: The page number to retrieve (default is 1).
  • limit: The number of items per page (default is 10).

Example

To retrieve the second page of orders with 20 items per page, you can make a request like this:

GET /orders?page=2&limit=20

Response

The response will include pagination metadata:

{
        "data": [
            {
                "id": 123,
                "customer_id": 456,
                "items": [
                    {
                        "product_id": 789,
                        "quantity": 2
                    },
                    {
                        "product_id": 101,
                        "quantity": 1
                    }
                ],
                "status": "pending",
                "created_at": "2023-10-01T12:34:56Z",
                "updated_at": "2023-10-01T12:34:56Z"
            },
            ...
        ],
        "pagination": {
            "current_page": 2,
            "total_pages": 5,
            "total_items": 98,
            "per_page": 20
        }
    }

Filtering

The Order Food Online API supports filtering to handle large sets of data efficiently. You can use query parameters to control the filtering behavior.

Query Parameters

  • status: Filter orders by status (e.g., pending, shipped, delivered).
  • customer_id: Filter orders by customer ID.
  • created_at: Filter orders by creation date (e.g., created_at=2023-10-01).

Example

To retrieve orders with a status of "shipped" and created on "2023-10-01", you can make a request like this:

GET /orders?status=shipped&created_at=2023-10-01

Response

The response will include the filtered orders:

[
        {
            "id": 123,
            "customer_id": 456,
            "items": [
                {
                    "product_id": 789,
                    "quantity": 2
                },
                {
                    "product_id": 101,
                    "quantity": 1
                }
            ],
            "status": "shipped",
            "created_at": "2023-10-01T12:34:56Z",
            "updated_at": "2023-10-01T12:34:56Z"
        },
        ...
    ]

Getting Started

To get started with our API, follow these steps:

  1. Sign up for an API key on our developer portal.
  2. Read the API documentation to understand the available endpoints and request/response formats.
  3. Integrate the API into your application using the provided SDKs or by making HTTP requests directly.
  4. Test your integration thoroughly to ensure everything works as expected.

Features

  • Order Creation: Easily create new orders with detailed information.
  • Order Management: Update, cancel, or modify existing orders.
  • Order Tracking: Track the status of orders in real-time.
  • Customer Management: Manage customer data and preferences.
  • Payment Integration: Integrate with popular payment gateways for secure transactions.

API Documentation

For detailed information on how to use our API, visit our API documentation.

The documentation includes:

  • Endpoint descriptions
  • Request and response formats
  • Authentication methods
  • Examples and code snippets

Pricing

Our API offers flexible pricing plans to suit your business needs:

  • Free Plan: Up to 1000 requests per month
  • Basic Plan: Up to 10,000 requests per month - $29/month
  • Pro Plan: Up to 50,000 requests per month - $99/month
  • Enterprise Plan: Custom pricing for high-volume usage - Contact us for details

Sign up for a plan on our pricing page.

Testimonials

"Order Food Online Help's API has streamlined our order management process, making it more efficient and user-friendly."

Jane Doe, CEO of Tech Solutions

"The customer support is exceptional. They helped us troubleshoot an issue within hours."

John Smith, Developer at XYZ Corp

Case Studies

Case Study: Tech Solutions

Tech Solutions integrated Order Food Online Help's API to streamline their order management process, resulting in a 30% increase in efficiency.

Read More

Case Study: XYZ Corp

XYZ Corp used Order Food Online co's API to enhance their customer experience, leading to a 20% increase in customer satisfaction.

Read More

Blog

How to Integrate Order Food Online co API into Your Application

Learn step-by-step how to integrate our API into your application and start managing orders efficiently.

Read More

Best Practices for Order Management

Discover best practices for managing orders using our API to ensure a smooth and efficient process.

Read More

Frequently Asked Questions

What is the Order Food Online API?

The Order Food Online API is a set of tools and endpoints that allow you to integrate Order Food Online functionality into your application.

How do I get started with the API?

Sign up for an API key on our developer portal and follow the steps in the API documentation.

Do you offer support?

Yes, we offer support through our contact page.

Contact Us

If you have any questions or need assistance, feel free to contact us:

  • Email: support@orderfoodonline.co
  • Phone: +1-800-555-1234

Versioning

For information on API versioning, please visit our versioning reference.

Testing Instructions

For detailed testing instructions, please visit our testing instructions reference.

Users Authentication

Get Access Token

Users can obtain the access token via a POST method:

https://apiv4.orderfoodonline.co/:version/:language/:project/auth

For increased security, the authentication generates a special token that is related to the project, user ID, and the user level. The Order Food Online API will automatically recognize the user based on the access token.

To learn more about the User levels, please check the Users Model.

What is it for?

The access token allows endpoints to be used with restrictions of user levels and authentication. This is obtained by the authentication (Authorize User Login or Social Login). Below is an example of the part of the response that contains the token:

Example Response


"result": {
    ...
    "session": {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o",
        "token_type": "bearer",
        "expires_in": 31536000
    },
    ...
}
                    

How to Use It?

Once the access token is obtained, what can you do with it? The token is the key that allows you to use the restricted Order Food Online APIs endpoints.

This is done by adding it to the header of the request in the following way:

Authorization Header Structure


"authorization": "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o"
                    

Using Order Food Online SDK


let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o";
orderfoodonline.setToken(token);
                    

Authorize User Login

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth

This is the authentication endpoint. The condition to use this endpoint is that the user must be registered.

Log in to see full request history

Make a request to see history.

Note

In order for the cellphone login to work, the number must be registered and associated with a user.

Using Order Food Online SDK


            const response = await orderfoodonline.users().auth(
                {
                    email: 'superadmin@orderfoodonline.co',
                    password: 'super'
                }
            );
                    

Path Parameters

  • language (string, required): Defaults to en
  • project (string, required): Defaults to demo. You can use the API explorer with our demo project or with your own Order Food Online project.
  • api_version (string, required): Defaults to v400

Body Parameters

  • email (string, required): Defaults to superadmin@orderfoodonline.co. For full access to the API explorer, we recommend logging in as Super Admin. Then you can get the token response to paste it while trying each API endpoint.
  • cellphone (string, required if not email)
  • password (string, required): Defaults to super
  • security_recaptcha_auth (string): Defaults to 1 or 0. Enable or disable recaptcha.

Responses

  • 200: Successful authentication
  • 400: Bad request

Social Login

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/facebook

Used to authorize users with Facebook Login.

Log in to see full request history

Make a request to see history.

Current Allowed Platforms

  • Facebook
  • Google
  • Apple

Platform Body Params

  • Facebook: access_token
  • Google: access_token
  • Apple:
    • name: Optional (Get from Apple on the first login with Apple)
    • lastname: Optional (Get from Apple on the first login with Apple)
    • code: Get from Apple login frontend

Apple Login Example


            
                    

Google Login Example


                    

Access Tokens

Access_token Facebook: This access token is the one that returns from Facebook when you log in with it and sends it to the API to log in a user if it exists or register and log in if it does not exist.

Access_token Google: This access token is the one that returns from Google when you log in with it and sends it to the API to log in a user if it exists or register and log in if it does not exist.

Code Apple: This code is the one that returns from Apple when you log in with it and sends it to the API to log in a user if it exists or register and log in if it does not exist.

Functionality

Logging in with Social for applications is a quick and convenient way to create accounts and log in to your application on various platforms.

Register User

Logging in with Socials allows people to register quickly and easily in your application without having to set a password. The simplicity and convenience of the experience translates into greater conversion.

Login to Different Platforms

Logging in with Social is available on most mobile and computer application platforms. After creating an account with Social on a platform, people can log in quickly and easily in any version of the application on other platforms.

User Levels

Only customers can register with Social. If any other user level has an account already registered and the email is the same used on Social, then Social login can be enabled for that account, it is enabled automatically and is related to the email previously registered.

Login Requirements

Facebook Login Requirements

Facebook login setup is required. To check if Facebook configuration exists, use Get Configurations. The configurations that Facebook uses are facebook_id and facebook_secret.

Google Login Requirements

The configurations that Google uses is google_login_client_id, which is the client ID of the Google account.

Apple Login Requirements

Apple login setup is required. The configurations that Apple uses are:

  • apple_team_id: Apple team ID
  • apple_login_private_key_id: Apple key ID
  • apple_login_private_key: Apple key downloaded at create time
  • apple_login_client_id: Apple service identifier

Path Parameters

  • language (string, required): Defaults to en
  • project (string, required): Defaults to demo
  • api_version (string, required): Defaults to v400

Responses

  • 200: Successful authentication
  • 400: Bad request

User Logout

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/logout

This API endpoint is used to log out a user and remove the user token created while logging in.

Log in to See Full Request History

Make a request to see history.

User Levels

Any user level can log out with this API endpoint. To log out, a user is required to be logged in (access_token needed).

Notifications Token

For mobile applications, if push notifications are used, it is recommended to send the notification_token to stop receiving notifications. View more about notifications token.

Using Order Food Online SDK


            const response = await orderfoodonline.users().logout();
                    

Path Parameters

  • language (string, required): Defaults to en
  • project (string, required): Defaults to demo
  • api_version (string, required): Defaults to v400

Body Parameters

  • token_notification (string): Optional token for notifications.

Headers

  • authorization (string, required): The access token of the user.

Responses

  • 200: Successful logout
  • 401: Unauthorized (user not logged in or invalid token)

Authorize User Login

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth

This is the authentication endpoint. The condition to use this endpoint is that the user must be registered.

Log in to See Full Request History

Make a request to see history.

📘 In order for the cellphone login to work, the number must be registered and associated with a user.

Using Order Food Online SDK


const response = await orderfoodonline.users().auth(
    {
        email: 'superadmin@orderfoodonline.co',
        password: 'super'
    }
);
        

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Body Parameters

Parameter Type Required Default Description
email string Yes superadmin@orderfoodonline.co For full access to the API explorer, we recommend logging in as Super Admin.
cellphone string No (Required if not email) N/A Cellphone number associated with the user.
password string Yes super Password for the user.
security_recaptcha_auth string No 1 Enable or disable reCAPTCHA.

Responses

Status Code Description
200 Successful authentication
400 Bad request

User Verify

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/verify

This API endpoint is used to verify a user by ID.

Log in to See Full Request History

Make a request to see history.

📘 Important: This endpoint is exclusive to verify the user's email or phone number.

For more information about attribute channel and code, see the following documentation: Codes Model.

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id string Yes N/A

Body Parameters

Parameter Type Required
channel string Yes
code string Yes
country_phone_code int32 No
cellphone int32 No

Headers

Header Type
authorization string

Responses

Status Code Description
200 Successful verification
400 Bad request

SMS login

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/sms/facebook

This API endpoint is used to login without a password using the Facebook Account Kit, which can be obtained with a phone number or an email.

Log in to See Full Request History

Make a request to see history.

📘 For this endpoint to work properly, the Facebook Account Kit must be configured.

For more information about account kit configuration, CLICK HERE.

A Simple Example of the Response


{
    "status": "success",
    "data": {
        "user_id": "123456",
        "access_token": "your_access_token_here"
    }
}
        

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo

Body Parameters

Parameter Type Required Description
code string Yes For this endpoint to work properly, the Facebook Account Kit must be configured.

Responses

Status Code Description
200 Successful login
400 Bad request

Response Body

On a successful login, the response body will be an object containing user information and an access token.

SMS Twilio Verify

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/sms/twilio/verify

This API endpoint is used to create an SMS code and send it to a mobile number to verify the user's phone number.

Log in to See Full Request History

Make a request to see history.

📘 For this endpoint to work properly, the Twilio settings must be configured.

Then go to the SMS Verify Section here and create the service to obtain a service ID.

Auth Behavior

  • If there is a user with this phone, then they will log in and the cellphone will be marked as verified.
  • If there is not a user with this phone, a new user will be created with this phone and marked as verified.

Edit User Behavior

  • If the phone is already verified, a new verification code is needed to change it.
  • If the phone is not verified, you can send a valid verification code to change it to verified.

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo

Body Parameters

Parameter Type Required Description
verification_code string Yes (if captcha setting for auth is enabled) The verification code sent to the user's phone.
cellphone string Yes The cellphone number to verify.
country_phone_code int32 Yes The cellphone country phone code.

Responses

Status Code Description
200 Successful verification
400 Bad request

Response Body

On a successful verification, the response body will be an object containing relevant information.

SMS Twilio Auth

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/sms/twilio

This API endpoint is used to authenticate after receiving the code via SMS.

Log in to See Full Request History

Make a request to see history.

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo

Body Parameters

Parameter Type Required Description
code string Yes The code received via SMS.
cellphone string Yes The cellphone number.
country_phone_code int32 Yes The cellphone country phone code.

Responses

Status Code Description
200 Successful authentication
400 Bad request

Users Model

Endpoints

Action Method Resource Description
Get users GET /users Get all users of the project.
Get user GET /users/user_id Get user with id user_id.
Create POST /users Create a new user.
Update POST /users/user_id Update user with id user_id.
Delete DELETE /users/user_id Delete user with id user_id.

Attributes

Attribute Type Required Description Whereable
name string No The user's first and/or middle name. Yes
middle_name string No The user's middle name. Yes
lastname string No The user's last name. Yes
second_lastname string No The user's second lastname. No
email string No, required to create. The user's email. Yes
password string No, required to create. The user's password, minimum 8 characters. No
photo base64 string, url image or file image No The user's photo. No
birthdate date No The user's birthdate, with format MM/DD/YYYY (e.g. "12/31/2018"). Yes
cellphone string No The user's cellphone, minimum 10 characters. Yes
country_phone_code integer No No
address string No The user's address. Yes
address_notes string No The user's address notes (e.g. "Second floor"). No
zipcode string No The user's zip code/postal code. Yes
location json No The user's position (e.g. "{"lat": 10, "lng": 10}"). No
level integer No The user's role. Yes
busy boolean No The user's status (e.g. if the driver is busy with an assigned order). Yes
available boolean No The user's status (e.g. if the driver is available to assign order). Yes
enabled boolean No The user's status. Yes

User Levels

Level Type of User Description
0 Administrator Full user-level access to all API endpoints. Example: The administrator can see all the users, businesses, orders, and settings.
1 City Manager Functionality coming soon.
2 Business Owner Access to some Admin API endpoints and all Store Front API endpoints. Example: The store owner can see all the businesses assigned to their account and all the orders placed to any of their businesses.
3 Customer Access to all Store Front API endpoints. Example: The customer can see all the orders placed by them.
4 Driver Access to some Admin API endpoints and all Store Front API endpoints. Example: The driver can see all the orders assigned to their user.
5 Driver Manager Functionality coming soon.

Users Special Parameters Requests

Every find and findAll endpoint in our Order Food Online API allows parameters requests.

In Users, there are some parameters which are considered special params; these work with params:attribute and are used to obtain specific data needed.

🚧 Extra parameters for each endpoint are not part of the same model attributes, only for find and findAll.

Special Parameters

  • addresses
  • dropdown_option
  • driver_groups
  • driver_groups.name
  • assigned_orders_count
  • history

Addresses

This param is used to obtain users showing only the addresses attribute.

An example to use this param is:

https://apiv4.orderfoodonline.co/v400/en/demo/users?params=addresses

Result example:


            [
              {
                "id": 4,
                "addresses": [
                  {
                    "id": 1,
                    "user_id": 4,
                    "name": "testFpostman",
                    "lastname": "oiuytr",
                    "address": "calle 5 n5 55",
                    "address_notes": null,
                    "phone": null,
                    "cellphone": null,
                    "zipcode": null,
                    "location": null,
                    "default": false
                  },
                  ...
                ]
              }
            ]
                    

Dropdown Options

This parameter is used to obtain users with only the dropdown_option attribute.

An example to use this param is:

https://apiv4.orderfoodonline.co/v400/en/demo/users?params=dropdown_option_id

Result example:


            [
              {
                "id": 3,
                "dropdown_option_id": null
              },
              ...
            ]
                    

Driver Groups

This parameter is used to obtain users with only the driver_groups attribute.

An example to use this param is:

https://apiv4.orderfoodonline.co/v400/en/demo/users?params=driver_groups

Result example:


            [
              {
                  "id": 33,
                  "drivergroups": [
                      {
                          "id": 1,
                          "administrator_id": 5,
                          "name": "Driver Group Demo",
                          "enabled": true,
                          "pivot": {
                              "driver_id": 33,
                              "driver_group_id": 1
                          },
                          "business": [
                              {
                                  "id": 3,
                                  "pivot": {
                                      "driver_group_id": 1,
                                      "business_id": 3
                                  }
                              },
                              ...
                          ]
                      },
                      ...
                  ]
              },
              ...
            ]
                    

History

This parameter is used to obtain users with only the history attribute.

An example to use this param is:

https://apiv4.orderfoodonline.co/v400/en/demo/users?params=history

Result example:


            [
                {
                    "id": 4,
                    "history": [
                        {
                            "id": 71,
                            "user_id": 4,
                            "type": 2,
                            "data": null,
                            "created_at": "2018-07-03 22:37:16",
                            "updated_at": "2018-07-03 22:37:16"
                        },
                        ...
                    ]
                }
            ]
                    

Get Users List

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users

This API endpoint is used to obtain all users.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

For this request, there are specific responses depending on which type of user is making the request:

  • Administrator: The response shows all users that exist, no matter which level they have.
  • Business Owner: The response shows all drivers that deliver to their businesses. The main use for this is to assign a driver to an order.

Using Order Food Online SDK


            const response = await orderfoodonline.users().get();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Query Parameters

Parameter Type Description
params string Extra parameters for the request.
limit int32 Limit the number of results returned.
offset int32 Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of users list.
401 Unauthorized access.

Find User

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}

This API endpoint is used to obtain the details of a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Administrator: Can get any user details no matter which level they have.

Any level user: Can get only their own user details.

Using Order Food Online SDK


const response = await orderfoodonline.users(userId).get();
        

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Query Parameters

Parameter Type Description
params string Extra parameters for the request.

Responses

Status Code Description
200 Successful retrieval of user details.
401 Unauthorized access.
404 User not found.

Create User

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users

This API endpoint is used to create a user on the platform.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

All users are registered by default as level 3 (Type: Client/Customer), and only a user with level 0 (Type: Administrator) can create a user with a different level.

📘 Register By an Admin NEW FEATURE!

A user can be registered by an administrator with an email or a number and without a password. When this email or number is registered again by the user, a password can be assigned.

Using Order Food Online SDK


const response = await orderfoodonline.users().save();
        

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Body Parameters

Parameter Type Required Description
name string No The user's first name.
middle_name string No The user's middle name.
lastname string No The user's last name.
second_lastname string No The user's second last name.
email string Yes The user's email.
password string Yes The user's password, minimum 8 characters.
photo file No The user's photo.
birthdate date No The user's birthdate.
cellphone string No The user's cellphone number.
country_phone_code int32 No Defaults to 1.
dropdown_option_id int32 No Dropdown option ID.
address string No The user's address.
address_notes string No Notes about the address.
zipcode string No The user's zip code.
level int32 No Defaults to 3 (Client/Customer).
busy boolean No Defaults to false.
available boolean No Defaults to true.
enabled boolean No Defaults to true.
security_recaptcha_signup string No Defaults to 1 or 0. Enable or disable reCAPTCHA in signup.

Responses

Status Code Description
200 Successful user creation.
400 Bad request.

Edit User

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}

This API endpoint is used to modify user information. There are different ways to modify a user depending on the type of user modifier and the type of user modified. A user is updated with POST because image modifications happen the same way as other endpoints that contain image modifications.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can edit any user. Any user type can edit their own information.

📘 Verification Code

This field is only required to change the cellphone if it is already verified or to mark the cellphone as verified.

To get the verification code, use the Verify Twilio.

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).save();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Body Parameters

Parameter Type Required Description
name string No The user's first name.
middle_name string No The user's middle name.
lastname string No The user's last name.
second_lastname string No The user's second last name.
email string No The user's email.
password string No The user's password.
photo file No The user's photo.
birthdate date No The user's birthdate.
cellphone string No The user's cellphone number.
country_phone_code int32 No Defaults to 1.
dropdown_option_id int32 No Dropdown option ID.
address string No The user's address.
address_notes string No Notes about the address.
zipcode string No The user's zip code.
location json No The user's location.
level int32 No Defaults to 3 (Client/Customer).
busy boolean No Defaults to false.
available boolean No Defaults to true.
enabled boolean No Defaults to true.
verification_code string No Required to change the cellphone if it is already verified.

Delete User

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}

This API endpoint is used to remove a user. A user can only be removed by themselves or by a user with level 0 (Type: Administrator).

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).delete();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Responses

Status Code Description
200 Successful deletion of the user.
400 Bad request.
401 Unauthorized access.

Users Forgot Password

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/forgot

This API endpoint is used to request a password reset.

Log in to See Full Request History

Make a request to see history.

📘 A password reset link is sent

When a user requests a lost password, an email is sent with the reset password link. This link is related to the website URL for the Order Food Online project that requests the lost password.

Using Order Food Online SDK


                const response = await orderfoodonline.users().forgotPassword({email: email});
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Query Parameters

Parameter Type Description
email string The email address of the user requesting the password reset.

Responses

Status Code Description
200 Password reset link sent successfully.
400 Bad request.

Users Reset Password

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/reset

This API endpoint is used to reset a user password. The code and random values are generated with the endpoint Users Forgot Password, and are injected into the link received in the Forgot Password email.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Body Parameters

Parameter Type Required Description
code string Yes The code received in the password reset email.
random string Yes The random string received in the password reset email.
password string Yes The new password for the user.

Responses

Status Code Description
200 Password reset successfully.
400 Bad request.

Users Check Password

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/check_password

This API endpoint is used to request a check of the user's password.

Log in to See Full Request History

Make a request to see history.

📘 Important

You need to send the access token in the headers of the user whose password you are checking.

For more information, refer to the Authorize User Login documentation.

Returns "ok" if the password is correct.

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Body Parameters

Parameter Type Required Description
password string Yes The password to check.

Responses

Status Code Description
200 Password check successful, returns "ok" if the password is correct.
400 Bad request.

Get User Reviews

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/reviews

This API endpoint is designed to retrieve the user review section.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id string Yes N/A
api_version string Yes v400

Responses

Status Code Description
200 Successful retrieval of user reviews.
400 Bad request.
401 Unauthorized access.

Address Model

Endpoints

Action Method Resource Description
Get all GET /users/:user_id/addresses Get all user addresses with user_id.
Get GET /users/:user_id/addresses/:address_id Get user address with id user_id and address_id.
Create POST /users/:user_id/addresses Create a user address with user_id.
Update PUT /users/:user_id/addresses/:address_id Update user address with id user_id and address_id.
Delete DELETE /users/:user_id/addresses/:address_id Delete user address with id user_id and address_id.

Attributes

Attribute Type Required Description
name string No, required to create. The user's first and/or middle name.
lastname string No, required to create. The user's last name.
phone string No The user's phone, minimum 7 characters.
cellphone string No The user's cellphone, minimum 10 characters.
address string No The user's address.
address_notes string No The user's address notes (e.g., "Second floor").
zipcode string No The user's zip code/postal code.
location string No String in JSON format with the user's position (e.g., {"lat": 10.1234, "lng": 20.5678}).
default boolean No If the address is default or not.
internal_number string No This number is used to identify more specifically the address, such as house/apartment/room number.
tag string No A name identifier for the address.

📘 About Name and Phone

This is used to add addresses that are sent to another person, allowing the business or driver to have direct contact with them.

Add User Address

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses

This API endpoint is used to add a new address for a user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await Order Food Online.users(userId).addresses(addressData).save();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Body Parameters

Parameter Type Required Description
name string Yes The user's first and/or middle name.
lastname string Yes The user's last name.
phone string No The user's phone number, minimum 7 characters.
address string Yes The user's address.
address_notes string No Notes about the address (e.g., "Second floor").
zipcode string No The user's zip code/postal code.
location string No String in JSON format with the user's position (e.g., {"lat": 10.1234, "lng": 20.5678}).
default boolean No If the address is the default address.
tag string No A name identifier for the address.
internal_number string No This number is used to identify the address more specifically, such as house/apartment/room number.

Responses

Status Code Description
200 Address added successfully.
400 Bad request.

Get User Addresses

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses

This API endpoint is used to obtain addresses from a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).addresses().get();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A

Query Parameters

Parameter Type Description
params string Extra parameters for the request.
offset string Offset for pagination.
limit string Limit the number of results returned.

Responses

Status Code Description
200 Successful retrieval of user addresses.
400 Bad request.

Find User Address

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}

This API endpoint is used to obtain a specific address from a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).addresses(addressId).get();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
address_id int32 Yes N/A

Query Parameters

Parameter Type Description
params string Extra parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the user address.
400 Bad request.

Edit User Address

Endpoint

PUT https://apiv4.Order Food Online.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}

This API endpoint is used to update a specific address for a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).addresses(addressId).save();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id string Yes N/A
address_id string Yes N/A
api_version string Yes v400

Body Parameters

Parameter Type Required Description
name string No The user's first and/or middle name.
lastname string No The user's last name.
phone string No The user's phone number.
address string No The user's address.
address_notes string No Notes about the address (e.g., "Second floor").
zipcode string No The user's zip code/postal code.
location json No String in JSON format with the user's position (e.g., {"lat": 10.1234, "lng": 20.5678}).
default boolean No If the address is the default address.
tag string No A name identifier for the address.
internal_number string No This number is used to identify the address more specifically, such as house/apartment/room number.

Responses

Status Code Description
200 Address updated successfully.
400 Bad request.

Delete User Address

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}

This API endpoint is used to remove a specific address from a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK


                const response = await orderfoodonline.users(userId).addresses(addressId).delete();
                    

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400
user_id int32 Yes N/A
address_id int32 Yes N/A

Responses

Status Code Description
200 Address deleted successfully.
400 Bad request.

Get Address Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}/metafields

This API endpoint is used to retrieve the metafields associated with a user address.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript


                $.get('http://yoursite.com/test/' + id, function(data) {
                    console.log(data);
                });
                    

Path Parameters

Parameter Type Required Default
api_version string Yes N/A
language string Yes N/A
project string Yes N/A
user_id int32 Yes N/A
address_id int32 Yes N/A

Query Parameters

Parameter Type Description
params string Extra parameters for the request.
limit int32 Limit the number of results returned.
offset int32 Offset for pagination.
start int32 Start index for pagination.

Responses

Status Code Description
200 Successful retrieval of address metafields.
400 Bad request.

Find Address Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific user address metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript


                $.get('http://yoursite.com/test/' + id, function(data) {
                    console.log(data);
                });
                    

Path Parameters

Parameter Type Required Default
api_version string Yes N/A
language string Yes N/A
project string Yes N/A
user_id int32 Yes N/A
address_id int32 Yes N/A
metafield_id int32 Yes N/A

Query Parameters

Parameter Type Description
params string Extra parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the address metafield.
400 Bad request.

Create Address Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}/metafields

This API endpoint is used to create a specific user address metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript


                $.post('http://yoursite.com/test/' + id, function(data) {
                    console.log(data);
                });
                    

Path Parameters

Parameter Type Required Default
api_version string Yes N/A
language string Yes N/A
project string Yes N/A
user_id int32 Yes N/A
address_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The value of the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 Metafield created successfully.
400 Bad request.

Edit Address Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}/metafields/{metafield_id}

This API endpoint is used to edit a specific user address metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript


                $.ajax({
                    url: 'http://yoursite.com/test/' + id,
                    type: 'PUT',
                    data: {
                        // Your data here
                    },
                    success: function(data) {
                        console.log(data);
                    }
                });
                    

Path Parameters

Parameter Type Required Default
api_version string Yes N/A
language string Yes N/A
project string Yes N/A
user_id int32 Yes N/A
address_id int32 Yes N/A
metafield_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The new value for the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 Metafield updated successfully.
400 Bad request.

Delete Address Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/addresses/{address_id}/metafields/{metafield_id}

This API endpoint is used to delete a specific user address metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript


                $.ajax({
                    url: 'http://yoursite.com/test/' + id,
                    type: 'DELETE',
                    success: function(data) {
                        console.log(data);
                    }
                });
                    

Path Parameters

Parameter Type Required Default
api_version string Yes N/A
language string Yes N/A
project string Yes N/A
user_id int32 Yes N/A
address_id int32 Yes N/A
metafield_id string Yes N/A

Responses

Status Code Description
200 Metafield deleted successfully.
400 Bad request.

Notification Tokens Model

Notification tokens are the way in which the API connects with a device for the functionality of notifications. With this token, the API knows to which device the notification has to be sent; in summary, it is the device identifier.

Endpoints

Action Method Resource Description
Get All GET /users/{user_id}/notification_tokens List all notification tokens of a user.
Create POST /users/{user_id}/notification_tokens Add a new notification token to a user.
Edit PUT /users/{user_id}/notification_tokens/{notification_token} Edit a notification token of a user.
Delete DELETE /users/{user_id}/notification_tokens/{notification_token} Remove a notification token of a user.

Attributes

Attribute Type Required Description
token String No The notification token.
user_id Integer No The user ID.
app String No The name of the app (e.g., orderfoodonlineapp, businessapp, deliveryapp).

Get Notification Tokens

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/notification_tokens

This API endpoint is used to obtain all notification tokens of a user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Query Parameters

Parameter Type Description
params string Extra parameters for the request.
limit int32 Limit the number of results returned.
offset int32 Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of notification tokens.
400 Bad request.
401 Unauthorized access.

Create Notification Token

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/notification_tokens

This API endpoint is used to create notification tokens.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
api_version string Yes v400

Body Parameters

Parameter Type Required Description
app string Yes The name of the app (e.g., orderfoodonlineapp, businessapp, deliveryapp).
token string Yes The notification token to be created.

Responses

Status Code Description
200 Notification token created successfully.
400 Bad request.
401 Unauthorized access.

Delete Notification Token

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/notification_tokens/{notification_token_id}

This API endpoint is used to remove notification tokens.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
notification_token_id string Yes N/A
api_version string Yes v400

Responses

Status Code Description
200 Notification token deleted successfully.
400 Bad request.

Users API Key

API keys are created from the account of a user and serve to obtain a direct connection to the API without the need for authentication. These keys concentrate the same authentication permissions and, unlike tokens, do not expire. Therefore, you have to be careful when sharing them. These keys can only be used by administrators and business owners. You can generate as many keys as you want, but you cannot update them; you can only create and delete.

Usage

This API key is used in the header as x-api-key as shown below:

x-api-key: "VkD7Bjm9t4YJgok6hkF5cO4jsbJAt7NO601uiUravjmJrH3VXDIneFfznsRWSofW7"

Example of API Key Usage

Here is an example of how to use the API key in a request using Postman:

  1. Open Postman and create a new request.
  2. Set the request type (GET, POST, etc.) and enter the API endpoint.
  3. In the "Headers" tab, add a new key-value pair:
    • Key: x-api-key
    • Value: VkD7Bjm9t4YJgok6hkF5cO4jsbJAt7NO601uiUravjmJrH3VXDIneFfznsRWSofW7
  4. Click "Send" to make the request.

Users API Key Model

Endpoints

Action Method Resource Description
Get All GET /users/{user_id}/keys List all API keys of a user.
Create POST /users/{user_id}/keys Create a new API key for a user.
Delete DELETE /users/{user_id}/keys/{key_id} Remove an API key of a user.

Attributes

Attribute Type Required Description
key string No The key identifier.
key_id integer No The key ID.

Get API Keys

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/keys

This API endpoint is used to obtain all API keys of a user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id string Yes N/A
api_version string Yes v400

Query Parameters

Parameter Type Description
params string Extra parameters for the request.
limit string Limit the number of results returned.
offset string Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of API keys.
401 Unauthorized access.

Create API Key

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/keys

This API endpoint is used to generate API keys.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id string Yes N/A
api_version string Yes v400

Responses

Status Code Description
200 API key created successfully.
401 Unauthorized access.

Delete API Key

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/keys/{key_id}

This API endpoint is used to remove an API key from a user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
user_id int32 Yes N/A
key_id int32 Yes N/A
api_version string Yes v400

Responses

Status Code Description
200 API key deleted successfully.
401 Unauthorized access.

Get User Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/metafields

This API endpoint is used to retrieve the metafields associated with a specific user.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id int32 Yes N/A

Query Parameters

Parameter Type Description
limit int32 Limit the number of results returned.
start int32 Start index for pagination.
offset int32 Offset for pagination.
params string Extra parameters for the request.

Responses

Status Code Description
200 Successful retrieval of user metafields.
400 Bad request.

Find User Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific user metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id int32 Yes N/A
metafield_id string Yes N/A

Query Parameters

Parameter Type Description
params string Extra parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the user metafield.
400 Bad request.

Create User Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/metafields

This API endpoint is used to create a specific user metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The value of the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 User metafield created successfully.
400 Bad request.

Update User Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/metafields/{metafield_id}

This API endpoint is used to edit a specific user metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id int32 Yes N/A
metafield_id string Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The new value for the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 User metafield updated successfully.
400 Bad request.

Delete User Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/users/{user_id}/metafields/{metafield_id}

This API endpoint is used to delete a specific user metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes v400
language string Yes en
project string Yes demo
user_id int32 Yes N/A
metafield_id string Yes N/A

Responses

Status Code Description
200 User metafield deleted successfully.
400 Bad request.

Advance Search Model

Endpoints

Action Method Resource Description
Get GET /search Get an advanced businesses search.
Get GET /search/suggestions Get suggestions of the search from business, category, and product.

Attributes

Attribute Type Required Description Whereable
order_type_id integer Yes Order type (1, 2) Delivery, Pickup. Yes
location json Yes Location to find the data (lat, lng). Yes
term string No Value to find related data too. Yes
tags array No Label for products. No
max_distance float No Max search distance from the location provided. Yes
max_eta integer No Max estimated time of arrival. Yes
max_delivery_price float No Max delivery price on business. No
max_product_price float No Max price amount of product. No
featured_products boolean No If enabled, the search will only find featured products. Yes
in_offer_products boolean No If enabled, the search will only find in-offer products. Yes
level_price string No This is the classification per business depending on the prices of each business. Yes

Get Advance Search List

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/search

This API endpoint is used to get all businesses.

Log in to See Full Request History

Make a request to see history.

Path Parameters

Parameter Type Required Default
language string Yes en
project string Yes demo
api_version string Yes v400

Query Parameters

Parameter Type Required Default
order_type_id int32 Yes 1
location json Yes N/A
term string No N/A
tags array of int32s No N/A
max_distance float No N/A
max_eta int32 No N/A
max_delivery_price float No N/A
max_product_price float No N/A
featured_products boolean No N/A
in_offer_products boolean No N/A
level_price string No N/A

Responses

Status Code Description
200 Successful retrieval of the advance search list.
400 Bad request.
401 Unauthorized access.

Business Model

Endpoints

Action Method Resource Description
Get all GET /business Get all businesses.
Get GET /business/id_or_slug Get business with id or slug.
Create POST /business Create a business.
Update PUT /business/business_id Update business with id.
Delete DELETE /business/business_id Delete business with id.

Attributes

Attribute Type Required Description Whereable
name string No, required to create. The business's name. Yes
email string No, required to create. The business's email. Yes
slug string No, required to create. The business's slug. Yes
schedule json No The business's schedule. No
description string No The business's description. Yes
about string No The business's about. Yes
logo base64 image, url image or file image. No The business's logo image. No
header base64 image, url image or file image. No The business's header image. No
phone string No The business's phone. Yes
cellphone string No The business's cellphone. Yes
owner_id integer No The business's owner, is the user id. Yes
city_id integer No The business's city, is the city id. Yes
address string No The business's address. Yes
address_notes string No The business's address notes. No
zipcode string No The business's zip/postal code. Yes
location json No The business's location. (e.g. {"lat": 0, "lng": 0}) No
featured boolean No If business is featured or not. Yes
timezone string No The business's timezone. List valid timezone. No
currency string No The business's currency. Yes
printer_id integer No The business's printer, is the printer id. No
minimum float No The business's minimum purchase. Yes
delivery_price float No The business's delivery price. Yes
always_deliver boolean No If the business always delivers even without a delivery zone or not. Yes
tax_type integer No The business's tax type. 1 for included in the price, 2 for not included in the price. Yes
tax float No The business's tax. Yes
delivery_time string No The business's delivery time. (e.g. hh:mm) No
pickup_time string No The business's pickup time. (e.g. hh:mm) No
service_fee float No The business's service fee. No
fixed_usage_fee float No The business's fixed usage fee. No
percentage_usage_fee float No The business's percentage usage fee. No
enabled boolean No The business's status. Yes
food boolean No The business's type FOOD status. Yes
alchohol boolean No The business's type ALCOHOL status. Yes
groceries boolean No The business's type GROCERIES status. Yes
laundry boolean No The business's type LAUNDRY status. Yes
use-printer boolean No Use printer's status. No

Business Special Requests

Although every existing endpoint in the API has parameter requests to get specific data, as well as limit, offset, and params, for business APIs, there are special requests by using the request param params:attribute used to obtain additional data needed.

🚧 Extra parameters for each endpoint are not part of the same model attributes, only for find and findAll.

Special Request Attributes

  • menus
  • city
  • reviews
  • gallery
  • offers
  • categories
  • products
  • zones
  • webhook
  • paymethods
  • available_drivers_count
  • featured_products

Featured Products

This response will only contain the featured products.

Example of featured products endpoint:

https://apiv4.orderfoodonline.co/v400/en/demo/business?params=featured_products

A business has attributes linked to this, even if the user request is for a specific set of attributes, these linked attributes will be included in the response which are timezone, open, today, distance, delivery_zone, minimum, and delivery_price.

Example Request

Here is an example of making a request:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 22,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 15,
                            "minimum": 1,
                            "delivery_price": 2
                        }
                    ]
                }

Menus

This param is used to obtain the business menus, including categories and products for each business.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,menus

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 22,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "categories": [
                                {
                                    "id": 119,
                                    "business_id": 22,
                                    "name": "Duvets",
                                    "image": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1539099366/fwwwe75rlmyafmhfb1tj.png",
                                    "rank": 5,
                                    "enabled": true,
                                    "products": [
                                        {
                                            "id": 549,
                                            "name": "Feather Duvet (Double)",
                                            "price": 30,
                                            "description": "",
                                            "images": "https://res.cloudinary.com/orderfoodonline/image/upload/v1534196792/m0l3ziafcmysyrig0awl.jpg",
                                            "sku": null,
                                            "category_id": 119,
                                            "inventoried": false,
                                            "quantity": 0,
                                            "featured": false,
                                            "enabled": true,
                                            "extras": [],
                                            "gallery": [],
                                            "ingredients": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }

City

This param is used to obtain the business city.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,city

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 22,
                            "timezone": "America/New_York",
                            "city_id": 1,
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 15,
                            "minimum": 1,
                            "delivery_price": 2,
                            "city": {
                                "id": 1,
                                "name": "New York",
                                "country_id": 1,
                                "administrator_id": 6,
                                "enabled": true,
                                "country": {
                                    "id": 1,
                                    "name": "United States",
                                    "enabled": true
                                }
                            }
                        }
                    ]
                }

Reviews

This param is used to obtain the business reviews.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,reviews

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 7,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "reviews": {
                                "reviews": [],
                                "quality": 0,
                                "delivery": 0,
                                "service": 0,
                                "package": 0,
                                "total": 0
                            },
                            "distance": 0,
                            "delivery_zone": 20,
                            "minimum": 5,
                            "delivery_price": 0
                        }
                    ]
                }

Gallery

This param is used to obtain the business gallery items, which can be images or videos.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,gallery

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 41,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 5,
                            "minimum": 0,
                            "delivery_price": 1,
                            "gallery": [
                                {
                                    "id": 5,
                                    "business_id": 41,
                                    "type": 1,
                                    "file": "https://res.cloudinary.com/orderfoodonline/image/upload/v1490664727/nacy6x0qfid1hut9rjqp.jpg",
                                    "video": null,
                                    "title": "photo1",
                                    "description": null,
                                    "created_at": "2018-10-06 18:18:25",
                                    "updated_at": "2018-10-06 18:18:25"
                                },
                                {
                                    "id": 8,
                                    "business_id": 41,
                                    "type": 2,
                                    "file": null,
                                    "video": "https://www.youtube.com/embed/hnxBRYoz2kQ",
                                    "title": "video",
                                    "description": null,
                                    "created_at": "2018-10-06 18:18:25",
                                    "updated_at": "2018-10-06 18:18:25"
                                }
                            ]
                        }
                    ]
                }

Offers

This param is used to obtain the business offers.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,offers

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 3,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 21,
                            "minimum": 9,
                            "delivery_price": 9,
                            "offers": [
                                {
                                    "id": 12,
                                    "business_id": 3,
                                    "name": "Demo offer for all businesses",
                                    "type": 1,
                                    "minimum": 2000,
                                    "rate_type": 2,
                                    "rate": 5,
                                    "start": "2018-03-01 00:00:00",
                                    "end": "2019-12-29 00:00:00",
                                    "coupon": null
                                }
                            ]
                        }
                    ]
                }

Categories

This param is used to obtain the business categories.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,categories

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 7,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 20,
                            "minimum": 5,
                            "delivery_price": 0,
                            "categories": [
                                {
                                    "id": 97,
                                    "business_id": 7,
                                    "name": "Laundry",
                                    "image": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1539099221/yrlnpdo6b2hllgbhrpit.png",
                                    "rank": 1,
                                    "enabled": true
                                }
                            ]
                        }
                    ]
                }

Products

This param is used to obtain the business products including the categories information.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=36.1315455,-95.9664416¶ms=zones,products

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 7,
                            "name": "Twirly Laundry",
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "distance": 0,
                            "delivery_zone": 20,
                            "minimum": 5,
                            "delivery_price": 0,
                            "categories": [
                                {
                                    "id": 97,
                                    "business_id": 7,
                                    "name": "Laundry",
                                    "image": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1539099221/yrlnpdo6b2hllgbhrpit.png",
                                    "rank": 1,
                                    "enabled": true,
                                    "products": [
                                        {
                                            "id": 488,
                                            "name": "Dress (Everyday)",
                                            "price": 11,
                                            "description": "",
                                            "images": "https://res.cloudinary.com/orderfoodonline/image/upload/v1534166759/cy89045kwlzzur3fmvea.png",
                                            "sku": null,
                                            "category_id": 97,
                                            "inventoried": false,
                                            "quantity": 0,
                                            "featured": false,
                                            "enabled": true
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }

Zones

This param is used to obtain the business zones.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?mode=dashboard¶ms=zones,name

Result example:

{
                    "error": false,
                    "result": [
                        {
                            "id": 3,
                            "timezone": "America/New_York",
                            "open": false,
                            "today": null,
                            "zones": [
                                {
                                    "id": 21,
                                    "business_id": 3,
                                    "name": "Whole World Taste Wine",
                                    "type": 1,
                                    "address": "5th avenue",
                                    "data": {
                                        "center": {
                                            "lat": 40.75556566433035,
                                            "lng": -75.69638585678427
                                        },
                                        "radio": 19918.492520125288
                                    },
                                    "dropdown_option_id": null,
                                    "price": 9,
                                    "minimum": 9,
                                    "schedule": [],
                                    "enabled": true
                                }
                            ]
                        }
                    ]
                }

Webhooks

This param is used to obtain the business webhooks.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business/tastewine?params=zones,name,webhooks

Result example:

{
                    "id": 3,
                    "timezone": "America/New_York",
                    "open": false,
                    "today": null,
                    "valid_service": false,
                    "webhooks": [
                        {
                            "id": 1,
                            "business_id": 3,
                            "hook": "orders_update_driver",
                            "url": "https://dash.readme.io/project/orderfoodonline/v4.0/refs/business-special-requests"
                        }
                    ]
                }

Paymethods

This param is used to obtain the business payment methods.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business/3?params=paymethods

Result example:

{
                    "id": 3,
                    "timezone": "America/New_York",
                    "open": false,
                    "today": null,
                    "valid_service": false,
                    "paymethods": [
                        {
                            "id": 6,
                            "paymethod_id": 1,
                            "business_id": 3,
                            "sandbox": false,
                            "enabled": true,
                            "created_at": "2018-07-02 18:04:00",
                            "updated_at": "2018-07-02 18:04:00",
                            "data": {},
                            "paymethod": {
                                "id": 1,
                                "name": "Cash",
                                "gateway": "cash",
                                "enabled": true
                            }
                        }
                    ]
                }

Available Drivers

This param is used to obtain the available drivers count.

Example:

https://apiv4.orderfoodonline.co/v400/en/demo/business/3?params=available_drivers_count

Result example:

{
                    "id": 3,
                    "timezone": "America/New_York",
                    "open": false,
                    "today": null,
                    "valid_service": false,
                    "idle_drivers_count": 0,
                    "busy_drivers_count": 2
                }

Get Businesses List

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business

This API endpoint is used to get all businesses.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

The response depends on the level of the user that makes the request:

  • User level 0 (Type: Administrator): Response contains all existing businesses in the project.
  • User level 2 (Type: Business Owner): With mode:dashboard for the editor, contains all businesses related to this user. They can also get all businesses existing by using a location or dropdown option.
  • Other user types: Can get all businesses existing by using a location or dropdown option, similar to users level 3 (Type: Client/Customer).

Note: mode:dashboard only works with user levels 0 or 2.

Search by Position

This kind of search does not require authorization. The parameters must include type, location (lat, lng), and params=zones as shown in the following example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&location=40.7539143,-73.9810162¶ms=zones,name,slug

To check the Business model and learn more about attributes that can be used as params, please check this link #business-model.

Search by Dropdown

This kind of search does not require authorization. The parameters must include type, dropdownoption, and params=zones as shown in the following example:

https://apiv4.orderfoodonline.co/v400/en/demo/business?type=1&dropdownoption=1¶ms=zones,name,slug

To check the Business model and learn more about attributes that can be used as params, please check this link #business-model.

Using Order Food Online SDK

To get businesses as a customer:

const response = await orderfoodonline.businesses().parameters(parameters).get();

To get businesses with mode dashboard:

const response = await orderfoodonline.businesses().asDashboard().get();

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
type int32 Defaults to 1
location string Required for location-based searches.
params string Defaults to zones,name
offset int32 Offset for pagination.
limit int32 Limit the number of results returned.
mode string Defaults to dashboard
dropdownoption string Used for dropdown searches.

Responses

Status Code Description
200 Successful retrieval of businesses.
400 Bad request.
401 Unauthorized access.

Find Business

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{id_or_slug}

This API endpoint is used to obtain a single business by ID or slug.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

📘 Note

Business can be obtained by ID or slug. mode:dashboard only works with user levels 0 or 2.

Using Order Food Online SDK

To get a business as a customer:

const response = await orderfoodonline.businesses(businessId).parameters(parameters).get();

To get a business with mode dashboard:

const response = await orderfoodonline.businesses(businessId).asDashboard().get();

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
id_or_slug string Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
mode string Defaults to dashboard

Responses

Status Code Description
200 Successful retrieval of the business.
400 Bad request.
401 Unauthorized access.

Create Business

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business

This API endpoint is used to create a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Businesses can only be created by user levels:

  • User level 0 (Type: Administrator)
  • User level 2 (Type: Business Owner)

Using Order Food Online SDK

To create a business:

const response = await orderfoodonline.businesses().save();

Path Parameters

Parameter Type Required Default
version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
name string Yes The business's name.
email string Yes The business's email.
slug string Yes The business's slug.
schedule json No The business's schedule.
description string No The business's description.
about string No The business's about.
logo file No The business's logo image.
header file No The business's header image.
phone string No The business's phone number.
cellphone string No The business's cellphone number.
owner_id int32 No The business's owner, is the user ID.
city_id int32 No The business's city, is the city ID.
address string No The business's address.
address_notes string No Notes about the business's address.
zipcode string No The business's zip/postal code.
location json No The business's location (e.g., {"lat": 0, "lng": 0}).
featured boolean No If the business is featured or not.
timezone string No The business's timezone.
currency string No The business's currency.
printer_id int32 No The business's printer ID.
minimum float No The business's minimum purchase amount.
delivery_price float No The business's delivery price.
always_deliver boolean No If the business always delivers even without a delivery zone.
tax_type int32 No The business's tax type.
tax float No The business's tax amount.
delivery_time string No The business's delivery time (e.g., hh:mm).
pickup_time string No The business's pickup time (e.g., hh:mm).
service_fee float No The business's service fee.
fixed_usage_fee float No The business's fixed usage fee.
percentage_usage_fee float No The business's percentage usage fee.
enabled boolean No The business's status.
food boolean No If the business is a food business.
laundry boolean No If the business is a laundry business.
groceries boolean No If the business is a grocery business.
alcohol boolean No If the business is an alcohol business.
use_printer boolean No If the business uses a printer.

Responses

Status Code Description
200 Business created successfully.
400 Bad request.
401 Unauthorized access.

Copy Business

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/duplicate

This API endpoint is used to duplicate a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Functionality

Copy business is a functionality that duplicates one existing business with all its categories, products, product options, suboptions, and payment methods. This makes it easier to create several branches of a business or businesses alike, which is particularly useful for franchises.

📘 Note: Although the same categories, products, paymethods, etc. are used, after being copied, they are not related in any way to the business from which they are copied. They are created anew based on the business from which they are copied to be related to the new business.

🚧 User Level Restrictions

Businesses can only be copied by user levels:

  • User level 0 (Type: Administrator)
  • User level 2 (Type: Business Owner)

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id string Yes N/A
api_version string Yes Defaults to v400

Responses

Status Code Description
200 Business duplicated successfully.
400 Bad request.
401 Unauthorized access.

Edit Business

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}

This API endpoint is used to update a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can edit any business. The Business Owner (Level 2) can only edit their own businesses.

Using Order Food Online SDK

To edit a business:

const response = await orderfoodonline.businesses(businessId).save();

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
name string No The business's name.
email string No The business's email.
slug string No The business's slug.
schedule json No The business's schedule.
description string No The business's description.
about string No The business's about.
logo file No The business's logo image.
header file No The business's header image.
phone string No The business's phone number.
cellphone string No This attribute can be deleted by sending null.
owner_id int32 No The business's owner, is the user ID.
city_id int32 No The business's city, is the city ID.
address string No The business's address.
address_notes string No Notes about the business's address.
zipcode string No The business's zip/postal code.
location json No The business's location (e.g., {"lat": 0, "lng": 0}).
featured double No If the business is featured or not.
timezone string No The business's timezone.
currency string No The business's currency.
printer_id string No The business's printer ID.
minimum float No The business's minimum purchase amount.
delivery_price float No The business's delivery price.
always_deliver boolean No If the business always delivers even without a delivery zone.
tax_type int32 No The business's tax type.
tax float No The business's tax amount.
delivery_time string No The business's delivery time (e.g., hh:mm).
pickup_time string No The business's pickup time (e.g., hh:mm).
service_fee float No The business's service fee.
fixed_usage_fee float No The business's fixed usage fee.
percentage_usage_fee float No The business's percentage usage fee.
enabled boolean No The business's status.
food boolean No If the business is a food business.
laundry boolean No If the business is a laundry business.
groceries boolean No If the business is a grocery business.
alcohol boolean No If the business is an alcohol business.
use_printer boolean No If the business uses a printer.

Responses

Status Code Description
200 Business updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}

This API endpoint is used to remove a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can delete any business. The Business Owner (Level 2) can only delete their own businesses.

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Responses

Status Code Description
200 Business deleted successfully.
400 Bad request.
401 Unauthorized access.

Business Order Type Model

Endpoints

Action Method Resource
Update PUT /business/{business_id}/order_types/{order_type_id}

Attributes

Attribute Type Required Description
Maximum float No The maximum amount allowed for this order type.

Update Business Order Type

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/order_types/{order_type_id}

This API endpoint is used to add or update details for a business order type.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

📘 Note

This endpoint is only available for Superadmins and Business Owners. It is not accessible to users, drivers, city managers, etc.

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
order_type_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
maximum float No The maximum amount allowed for this order type.

Responses

Status Code Description
200 Business order type updated successfully.
400 Bad request.

Get Business Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields

This API endpoint is used to obtain business metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A

Query Parameters

Parameter Type Description
limit int32 Limits the number of results returned.
offset int32 Offset for pagination.
start int32 Start index for pagination.
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of business metafields.
400 Bad request.

Find Business Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific business metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
metafield_id int32 Yes N/A

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the business metafield.
400 Bad request.

Create Business Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields

This API endpoint is used to create a business metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The value of the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 Business metafield created successfully.
400 Bad request.

Edit Business Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields/{metafield_id}

This API endpoint is used to edit a specific business metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
metafield_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The new value for the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 Business metafield updated successfully.
400 Bad request.

Edit Business Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields/{metafield_id}

This API endpoint is used to edit a specific business metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
metafield_id int32 Yes N/A

Body Parameters

Parameter Type Required Description
value string Yes The new value for the metafield.
value_type string Yes The type of the value (e.g., string, integer).
key string Yes The key for the metafield.

Responses

Status Code Description
200 Business metafield updated successfully.
400 Bad request.

Delete Business Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/metafields/{metafield_id}

This API endpoint is used to delete a specific business metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using Order Food Online SDK

To delete a business metafield:

const response = await orderfoodonline.businesses(businessId).delete();

Path Parameters

Parameter Type Required Default
api_version string Yes Defaults to v400
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
metafield_id int32 Yes N/A

Responses

Status Code Description
200 Business metafield deleted successfully.
400 Bad request.

Business Delivery Zones Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/deliveryzones Get all delivery zones.
Get GET /business/:business_id/deliveryzones/:deliveryzone_id Get delivery zone with id business_id and deliveryzone_id.
Create POST /business/:business_id/deliveryzones Create a delivery zone with business_id.
Update PUT /business/:business_id/deliveryzones/:deliveryzone_id Update delivery zone with business_id and deliveryzone_id.
Delete DELETE /business/:business_id/deliveryzones/:deliveryzone_id Delete delivery zone with business_id and deliveryzone_id.

Attributes

Attribute Type Required Description Whereable
name string No, required to create. The zone's name. Yes
type integer No, required to create. The zone's type (1 for radio, 2 for polygon, 3 for dropdown, 4 for everywhere). Yes
address string No The zone's address. Yes
data json No The zone's data for zone. No
dropdown_option_id integer No The zone's dropdown option, if zone is type 3. Yes
price float No, required to create. The zone's price. Yes
minimum float No, required to create. The zone's minimum purchase. Yes
schedule json No The zone's schedule. No
enabled boolean No The zone's status. Yes
businesses array No Business IDs for delivery zone share. No

Restrictions for Delivery Zones

Users level 0 (Type: Administrator) can create, update, and remove any delivery zone from any existing business in the project. Users level 2 (Type: Business Owner) can create, update, and remove any delivery zone from any business related to this user.

Share Delivery Zones

To share a delivery zone from one business to others, you need to send the attribute businesses with an array of business IDs. This will create a new zone for the businesses shared to.

Delivery Zone Types

There are 4 different ways to make delivery areas, making it more versatile and comfortable for the users depending on their needs:

Type Name Type Value Description
Radio 1 Radio type, shows the maximum delivery distance from a specific point. This works in kilometers by default but you can convert the input to miles.
Polygon 2 Polygon type, creates an area based on several coordinates (minimum three).
Dropdown 3 Normally used with neighborhoods or zones.
Everywhere 4 Normally used to fast-setup a store.

Get Business Delivery Zones

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/deliveryzones

This API endpoint is used to obtain all delivery zones for a specific business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
limit int32 Limits the number of results returned.
offset int32 Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of delivery zones.
400 Bad request.
401 Unauthorized access.

Find Business Delivery Zone

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/deliveryzones/{deliveryzone_id}

This API endpoint is used to obtain a specific delivery zone.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
deliveryzone_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the delivery zone.
400 Bad request.
401 Unauthorized access.

Create Business Delivery Zone

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/deliveryzones

This API endpoint is used to create a delivery zone.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
name string Yes The zone's name.
type int32 Yes The zone's type (1 for radio, 2 for polygon, 3 for dropdown, 4 for everywhere).
address string No The zone's address.
data json No The zone's data for zone.
dropdown_option_id int32 No The zone's dropdown option, if zone is type 3.
price float Yes The zone's price.
minimum float Yes The zone's minimum purchase.
schedule json No The zone's schedule.
enabled boolean No The zone's status. Defaults to true.
businesses array of int32s No Business IDs for delivery zone sharing.

Responses

Status Code Description
200 Delivery zone created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Delivery Zone

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/deliveryzones/{deliveryzone_id}

This API endpoint is used to update a delivery zone.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
deliveryzone_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
name string No The zone's name.
type int32 No The zone's type (1 for radio, 2 for polygon, 3 for dropdown, 4 for everywhere).
address string No The zone's address.
data json No The zone's data for zone.
dropdown_option_id int32 No The zone's dropdown option, if zone is type 3.
price float No The zone's price.
minimum float No The zone's minimum purchase.
schedule json No The zone's schedule.
enabled double No The zone's status. Defaults to true.
businesses array of int32s No Business IDs for delivery zone sharing.

Responses

Status Code Description
200 Delivery zone updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Delivery Zone

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/deliveryzones/{deliveryzone_id}

This API endpoint is used to remove a specific delivery zone.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
deliveryzone_id int32 Yes N/A
api_version string Yes Defaults to v400

Responses

Status Code Description
200 Delivery zone deleted successfully.
400 Bad request.
401 Unauthorized access.

Business Paymethods Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/paymethods Get all business paymethods.
Get GET /business/:business_id/paymethods/:paymethod_id Get business paymethod with id business_id and paymethod_id.
Create POST /business/:business_id/paymethods Create a business paymethod with business_id.
Update PUT /business/:business_id/paymethods/:paymethod_id Update business paymethod with business_id and paymethod_id.
Delete DELETE /business/:business_id/paymethods/:paymethod_id Delete business paymethod with business_id and paymethod_id.

Attributes

Attribute Type Required Description
paymethod_id string No, required to create. The business paymethod's name.
sandbox boolean No, required to create. The business paymethod's sandbox status.
data json No, required to create. The business paymethod's data.
data_sandbox json No, required to create. The business paymethod's data in sandbox mode.
enabled boolean No The business paymethod's status.
maximum string No The paymethod's maximum amount allowed to place an order.

Business Paymethod Special Params Request

Business pay methods have two special parameters that bring specific information. The attributes that are used for special requests are listed below:

Business

This parameter is used to obtain the business information along with the paymethods associated with that business.

Example usage:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/paymethods?params=business,business_id

🚧 Note: business_id is required to make this special request.

Result Example

[
                    {
                        "id": 3,
                        "business_id": 41,
                        "business": {
                            "id": 41,
                            "name": "McBonalds en",
                            "email": "test@orderfoodonline.co",
                            "slug": "mcbonalds",
                            "schedule": [],
                            "description": "long description en",
                            "about": "short description english",
                            "logo": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523379984/vymo7gxbk73mms4kyz5l.jpg",
                            "header": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523379740/psz6waiyu4u2giom6grt.jpg",
                            "phone": "123123212123",
                            "cellphone": "123123212123",
                            "owner_id": 3,
                            "city_id": 1,
                            "address": "1450 5th Avenue, NY, New York, USA",
                            "address_notes": null,
                            "zipcode": null,
                            "location": {
                                "lat": 40.8019674,
                                "lng": -73.9457505,
                                "zipcode": -1,
                                "zoom": 15
                            },
                            "featured": false,
                            "timezone": "America/New_York",
                            "currency": "USD",
                            "food": true,
                            "alcohol": false,
                            "groceries": false,
                            "laundry": false,
                            "use_printer": false,
                            "printer_id": null,
                            "minimum": 0,
                            "delivery_price": 0,
                            "always_deliver": false,
                            "tax_type": 1,
                            "tax": 10,
                            "delivery_time": "2:0",
                            "pickup_time": "2:0",
                            "service_fee": 9,
                            "fixed_usage_fee": 1,
                            "percentage_usage_fee": 10,
                            "enabled": true
                        },
                        "paymethod": null
                    }
                ]

Paymethod

This parameter is used to obtain business paymethods with only the paymethod attribute.

Example usage:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/paymethods?params=paymethod,paymethod_id

🚧 Note: business_id is required to make this special request.

Result Example

[
                    {
                        "id": 1,
                        "paymethod_id": 5,
                        "business": null,
                        "paymethod": {
                            "id": 5,
                            "name": "Authorize.Net",
                            "gateway": "authorize",
                            "enabled": true,
                            "deleted_at": null,
                            "created_at": "2018-07-19 16:20:54",
                            "updated_at": "2018-07-19 16:20:54"
                        }
                    },
                    ...
                ]

Get Business Payment Options

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/paymethods

This API endpoint is used to obtain all payment options from a specific business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
limit int32 Limits the number of results returned.
offset int32 Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of payment options.
400 Bad request.
401 Unauthorized access.

Find Business Payment Option

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/paymethods/{paymethod_id}

This API endpoint is used to obtain a specific payment option from a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
project string Yes Defaults to demo
business_id int32 Yes N/A
paymethod_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the payment option.
400 Bad request.
401 Unauthorized access.

Create Business Payment Option

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/paymethods

This API endpoint is used to add a payment option to a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 Before You Do It

It is important to list the existing payment methods in the project to select the ID of one of them by the following request, which only serves for Administrators and Business Owners:

http://apiv4.orderfoodonline.co/v400/en/demo/paymethods

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
paymethod_id int32 Yes The ID of the payment method to be added.
sandbox boolean Yes Indicates if the payment method is in sandbox mode.
data json Yes The data associated with the payment method.
data_sandbox json Yes The sandbox data associated with the payment method.
enabled boolean No The status of the payment method (enabled or disabled).

Responses

Status Code Description
200 Payment option created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Payment Option

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/paymethods/{paymethod_id}

This API endpoint is used to update a payment option for a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
paymethod_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
paymethod_id int32 Yes The ID of the payment method to be updated.
sandbox boolean No Indicates if the payment method is in sandbox mode.
data json No The data associated with the payment method.
data_sandbox json No The sandbox data associated with the payment method.
enabled boolean No The status of the payment method (enabled or disabled).

Responses

Status Code Description
200 Payment option updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Payment Option

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/paymethods/{paymethod_id}

This API endpoint is used to remove a payment option from a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
paymethod_id int32 Yes N/A
api_version string Yes Defaults to v400

Responses

Status Code Description
200 Payment option deleted successfully.
400 Bad request.
401 Unauthorized access.

Business Reviews Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/reviews Get all reviews with business_id.
Get GET /business/:business_id/reviews/:review_id Get review with id business_id and review_id.
Create POST /business/:business_id/reviews Create a review.
Update PUT /business/:business_id/reviews/:review_id Update review with business_id and review_id.
Delete DELETE /business/:business_id/reviews/:review_id Delete review with business_id and review_id.

Attributes

Attribute Type Required Description Whereable
order_id integer No, required to create. The review's order (Order ID). Yes
quality integer No, required to create. The review's quality rating. Yes
delivery integer No, required to create. The review's delivery rating. Yes
service integer No, required to create. The review's service rating. Yes
package integer No, required to create. The review's package rating. Yes
user_id integer No, required to create. The review's user (User ID). Yes
comment string No, required to create. The review's comment. Yes
enabled boolean No The review's status. Yes

Restrictions for Reviews

Reviews are the way businesses get feedback, and this can be made by users if this user has an order completed for this business (status: 1 or 11).

Get Review Response

User level 0 (Type: Administrator) response contains all reviews from all businesses that exist in the project. User level 2 (Type: Business Owner) response contains all reviews from all businesses related to this user.

Reviews Special Request

Reviews have two special parameters that bring specific information. The attributes that are used for special requests are listed below:

User

This parameter is used to obtain the review's user information.

Example usage:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/reviews?params=user,user_id

🚧 Note: user_id is required to make this special request.

Result Example

[
                    {
                        "id": 1,
                        "user_id": 1,
                        "user": {
                            "id": 1,
                            "name": "Demo",
                            "lastname": "Admin",
                            "email": "superadmin@orderfoodonline.co",
                            "login_type": 0,
                            "social_id": null,
                            "photo": null,
                            "birthdate": null,
                            "phone": "2332223",
                            "cellphone": "33183467364",
                            "city_id": null,
                            "dropdown_option_id": null,
                            "address": "1780 Utica Square, Tulsa, OK 74114, EE. UU.",
                            "address_notes": "15",
                            "zipcode": "10001",
                            "location": {
                                "lat": 36.1315455,
                                "lng": -95.9664416
                            },
                            "level": 0,
                            "language_id": 1,
                            "push_notifications": true,
                            "busy": false,
                            "available": false,
                            "enabled": true,
                            "created_at": "2018-07-19 16:20:16",
                            "updated_at": "2018-07-19 20:22:25",
                            "deleted_at": null
                        }
                    }
                ]

Order

This parameter is used to obtain the review's order details.

Example usage:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/reviews?params=order,order_id

📘 Note: order_id is required to make this special request.

Result Example

[
                    {
                        "id": 1,
                        "order_id": 58,
                        "user": null,
                        "order": {
                            "id": 58,
                            "paymethod_id": 1,
                            "business_id": 41,
                            "customer_id": 1,
                            "delivery_type": 1,
                            "delivery_datetime": "2018-07-26 09:29:00",
                            "service_fee": 9,
                            "tax_type": 1,
                            "tax": 10,
                            "delivery_zone_price": 1,
                            "offer_type": null,
                            "offer_rate": "0.00",
                            "offer": "0.0000",
                            "discount": 0,
                            "coupon": null,
                            "status": 1,
                            "comment": null,
                            "driver_id": 6,
                            "driver_tip": 0,
                            "pay_data": null,
                            "refund_data": null,
                            "to_print": true,
                            "language_id": 1,
                            "created_at": "2018-07-26 15:29:26",
                            "updated_at": "2018-07-27 19:41:24",
                            "deleted_at": null,
                            "paymethod": {
                                "id": 1,
                                "name": "Cash",
                                "gateway": "cash",
                                "enabled": true,
                                "deleted_at": null,
                                "created_at": "2018-07-19 16:20:54",
                                "updated_at": "2018-07-19 16:20:54"
                            },
                            "business": {},
                            "customer": {},
                            "products": [],
                            "driver": {}
                        }
                    }
                ]

Get Business Reviews

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/reviews

This API endpoint is used to obtain all reviews from a specific business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
offset int32 Offset for pagination.
limit int32 Limits the number of results returned.

Responses

Status Code Description
200 Successful retrieval of reviews.
400 Bad request.
401 Unauthorized access.

Find Business Review

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/reviews/{review_id}

This API endpoint is used to obtain a specific review from a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
review_id int32 Yes N/A
api_version string Yes Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the review.
400 Bad request.
401 Unauthorized access.

Create Business Review

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/reviews

This API endpoint is used to create an order review for a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Note

Any user level can only review an order placed by them.

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
order_id int32 Yes The ID of the order being reviewed.
quality int32 Yes The quality rating of the order.
delivery int32 Yes The delivery rating of the order.
service int32 Yes The service rating of the order.
package int32 Yes The packaging rating of the order.
user_id int32 Yes The ID of the user making the review.
comment string Yes The review comment.
enabled boolean No The status of the review (enabled or disabled).

Responses

Status Code Description
200 Review created successfully.
400 Bad request.
401 Unauthorized access.

Create Business Review

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/reviews

This API endpoint is used to create an order review for a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Note

Any user level can only review an order placed by them.

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
api_version string Yes Defaults to v400

Body Parameters

Parameter Type Required Description
order_id int32 Yes The ID of the order being reviewed.
quality int32 Yes The quality rating of the order.
delivery int32 Yes The delivery rating of the order.
service int32 Yes The service rating of the order.
package int32 Yes The packaging rating of the order.
user_id int32 Yes The ID of the user making the review.
comment string Yes The review comment.
enabled boolean No The status of the review (enabled or disabled).

Responses

Status Code Description
200 Review created successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Review

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/reviews/{review_id}

This API endpoint is used to remove a review.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Administrator is allowed to remove a review.

Path Parameters

Parameter Type Required Default
language string Yes Defaults to en
project string Yes Defaults to demo
business_id int32 Yes N/A
review_id int32 Yes N/A
api_version string Yes Defaults to v400

Responses

Status Code Description
200 Review deleted successfully.
400 Bad request.
401 Unauthorized access.

Business Offers Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/offers Get all offers.
Get GET /business/:business_id/offers/:offer_id Get offer with id business_id and offer_id.
Create POST /business/:business_id/offers Create an offer with business_id.
Update PUT /business/:business_id/offers/:offer_id Update an offer with business_id and offer_id.
Delete DELETE /business/:business_id/offers/:offer_id Delete an offer with business_id and offer_id.

Attributes

Attribute Type Required Description Whereable
name string No, required to create. The offer's name. Yes
type integer No, required to create. The offer's type. Yes
minimum float No The offer's minimum purchase. Yes
rate_type integer No, required to create. 1 for percentage, 2 for fixed amount. Yes
rate float No, required to create. The offer's rate. Yes
start date No The offer's start date (e.g., MM/DD/YYYY). Yes
end date No The offer's end date (e.g., MM/DD/YYYY). Yes
limit integer No The offer's limit. Yes
coupon string No The offer's code/coupon. Yes
enabled boolean No The offer's status. Yes

Restrictions for Use of Offers API Endpoints

Offers can only be created, updated, or removed by Users level 0 or level 2 (Type: Administrator or Business Owner).

Offer Types

Offer Name Offer Value Description
Offer 1 This discount is automatically applied to the orders if it exists in the business and if the order meets the conditions set.
Coupon 2 This discount is applied at the request of the user if he has permission. That is to say that it has a code that allows you to access the discount, this discount is applied if the order meets the requirements.

Rate Type

Rate Type Rate Value Description
Percentage 1 This discount depends on the total amount of the order.
Fixed 2 This discount is fixed and the value is chosen by the business.

Business Offers Special Request

There is a special params request in Business offers which is business, this brings the main business information, not categories, products, or menus.

Example Usage

An example to use this param is:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/offers?params=business_id,business

🚧 Note: The param business_id is required when business is used.

Result Example

[
                    {
                        "id": 1,
                        "business_id": 41,
                        "business": {
                            "id": 41,
                            "name": "McBonalds t",
                            "email": "test@orderfoodonline.co",
                            "slug": "mcbonalds",
                            "schedule": [],
                            "description": "",
                            "about": "",
                            "logo": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523379984/vymo7gxbk73mms4kyz5l.jpg",
                            "header": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523379740/psz6waiyu4u2giom6grt.jpg",
                            "phone": "123123",
                            "cellphone": "123123123123",
                            "owner_id": 3,
                            "city_id": 1,
                            "address": "160 Broadway",
                            "address_notes": null,
                            "zipcode": null,
                            "location": {
                                "lat": 40.7127837,
                                "lng": -74.00594130000002,
                                "zipcode": -1,
                                "zoom": 15
                            },
                            "featured": false,
                            "timezone": "America/Tegucigalpa",
                            "currency": "USD",
                            "food": true,
                            "alcohol": false,
                            "groceries": false,
                            "laundry": false,
                            "use_printer": false,
                            "printer_id": null,
                            "minimum": 0,
                            "delivery_price": 0,
                            "always_deliver": false,
                            "tax_type": 1,
                            "tax": 10,
                            "delivery_time": "0:0",
                            "pickup_time": "0:0",
                            "service_fee": 9,
                            "fixed_usage_fee": 1,
                            "percentage_usage_fee": 10,
                            "enabled": true
                        }
                    }
                ]

Get Business Offers

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers

This API endpoint is used to get all offers from a specific business.

Log in to See Full Request History

Make a request to see history.

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400
params string No N/A
offset int32 No N/A
limit int32 No N/A

Responses

Status Code Description
200 Successful retrieval of business offers.
400 Bad request.
401 Unauthorized access.

Find Business Offer

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}

This API endpoint is used to obtain a specific offer from a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
offer_id int32 required N/A
api_version string required Defaults to v400
params string No N/A

Responses

Status Code Description
200 Successful retrieval of the business offer.
400 Bad request.
401 Unauthorized access.

Create Business Offer

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers

This API endpoint is used to create a discount. It can be an automatic discount applied to the cart after the conditions are met, or it can be a coupon discount that is applied to the cart when the code is entered and the coupon conditions are met.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Body Parameters

Parameter Type Required
name string required
type int32 required
minimum float No
rate_type int32 required
rate float required
start date required
end date required
limit int32 No
coupon string No
enabled boolean No

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Offer created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Offer

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}

This API endpoint is used to update a discount.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Body Parameters

Parameter Type Required
name string No
type int32 No
minimum float No
rate_type int32 No
rate float No
start date No
end date No
limit int32 No
coupon string No
enabled boolean No

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
offer_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Offer updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Offer

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}

This API endpoint is used to remove a discount.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
offer_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Offer deleted successfully.
400 Bad request.
401 Unauthorized access.

Get Business Offer Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}/metafields

This API endpoint is used to obtain offer metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Metadata

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
offer_id int32 required
params string No
limit int32 No
offset int32 No
start int32 No

Responses

Status Code Description
200 Successful retrieval of offer metafields.
400 Bad request.

Find Business Offer Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific offer metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Metadata

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
offer_id int32 required
metafield_id int32 required
params string No

Responses

Status Code Description
200 Successful retrieval of the specific offer metafield.
400 Bad request.

Create Business Offer Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}/metafields

This API endpoint is used to create offer metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Body Parameters

Parameter Type Required
object_id string No
model string required
value string required
value_type string required
key string required

Metadata

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
offer_id int32 required

Responses

Status Code Description
200 Metafield created successfully.
400 Bad request.

Edit Business Offer Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}/metafields/{metafield_id}

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Body Parameters

Parameter Type Required
value string required
value_type string required
key string required

Metadata

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
offer_id int32 required
metafield_id int32 required

Responses

Status Code Description
200 Metafield updated successfully.
400 Bad request.

Delete Business Offer Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/offers/{offer_id}/metafields/{metafield_id}

This API endpoint is used to delete a specific offer metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Metadata

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
offer_id int32 required
metafield_id int32 required

Responses

Status Code Description
200 Metafield deleted successfully.
400 Bad request.

Business Menus Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/menus Get all menus with business_id.
Get GET /business/:business_id/menus/:menu_id Get menu with id business_id and menu_id.
Create POST /business/:business_id/menus Create a menu with business_id.
Update PUT /business/:business_id/menus/:menu_id Update menu with business_id and menu_id.
Delete DELETE /business/:business_id/menus/:menu_id Delete menu with business_id and menu_id.

Attributes

Attribute Type Required Description Whereable
name string No, required to create. The menu's name. Yes
comment string No The menu's comment. Yes
schedule json No, required to create. The menu's schedule. No
pickup boolean No, required to create. The menu's pickup availability. Yes
delivery boolean No, required to create. The menu's delivery availability. Yes
eatin boolean No The menu's eat-in availability. Yes
products json No The menu's products (array of product IDs). No
enabled boolean No The menu's status. Yes
all_products boolean No Enable all products available on the store. Yes
use_business_schedule boolean No Use the business schedule to create the menu schedule. Yes

Restrictions for POST, PUT, and DELETE Menu

Business menus can only be created, updated, or removed by users level 0 (Type: Administrator) and user level 2 (Type: Business Owner).

  • User type Administrator can create, update, or remove any business menu from any business.
  • User type Business Owner can create, update, or remove only business menus related to their business.

GET Responses for Business Menus

In general, there is no restriction to obtain business menus, but there are two paths to obtain it, and the data obtained depends on the type of user:

  • Normal.
  • mode:dashboard.

Therefore, depending on the mode and the type of user, the response will be obtained as shown below:

  • User type Administrator and mode:dashboard can get all business menus.
  • User type Business Owner and mode:dashboard can obtain business menus related to their business.
  • User type Customer can obtain all business menus bounded by the business they can access, and if the business's menu is enabled for their request.

Example Response Without Mode

{
    "error": false,
    "result": [
        {
            "id": 8,
            "business_id": 7,
            "name": "Delivery Menu",
            "comment": "Thanks!",
            "schedule": [...],
            "pickup": true,
            "delivery": true,
            "enabled": true,
            "products": [
                {
                    "id": 475,
                    "name": "Take Up Trousers",
                    "price": 14,
                    "description": "",
                    "images": "https://res.cloudinary.com/orderfoodonline/image/upload/v1490664570/hy90ae5toz13lkdle4a3.jpg",
                    "sku": null,
                    "category_id": 102,
                    "inventoried": false,
                    "quantity": 0,
                    "featured": false,
                    "enabled": true,
                    "pivot": {
                        "menu_id": 8,
                        "product_id": 475
                    }
                },
                ...
            ]
        }
        ... //(All enabled menus)
    ]
}

Business Menus Special Request

There is a special params request in Menus which is products.

Example Usage

An example to use this param is:

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/menus?params=products

Result Example

[
    {
        "id": 45,
        "products": [
            {
                "id": 1292,
                "name": "Bird's Nest",
                "price": 3,
                "description": "",
                "images": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523299637/dfqe6rjkdbqvjaibrwn2.jpg",
                "sku": null,
                "category_id": 248,
                "inventoried": false,
                "quantity": 0,
                "featured": false,
                "enabled": true,
                "pivot": {
                    "menu_id": 45,
                    "product_id": 1292
                }
            },
            ...
        ]
    },
    ... // if findAll
]

Get Business Menus

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus

This API endpoint is used to obtain business catalogs; this request does not have any requirement.

Log in to See Full Request History

Make a request to see history.

Using orderfoodonline SDK

// get as customer
const response = await orderfoodonline.businesses(businessId).menus().get();
// Mode dashboard
const response = await orderfoodonline.businesses(businessId).menus().asDashboard().get();

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400
params string No N/A
offset int32 No N/A
limit int32 No N/A
mode string No Defaults to dashboard

Responses

Status Code Description
200 Successful retrieval of business menus.
400 Bad request.
401 Unauthorized access.

Find Business Menu

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}

This API endpoint is used to obtain a specific catalog using an ID.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using orderfoodonline SDK

// get as customer
const response = await orderfoodonline.businesses(businessId).menus(menuId).get();
// Mode dashboard
const response = await orderfoodonline.businesses(businessId).menus(menuId).asDashboard().get();

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
api_version string required Defaults to v400
params string No N/A

Responses

Status Code Description
200 Successful retrieval of the business menu.
400 Bad request.
401 Unauthorized access.

Create Business Menu

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus

This API endpoint is used to create a business catalog.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).menus().save();

Body Parameters

Parameter Type Required
name string required
comment string No
schedule json required
pickup boolean required true
delivery boolean required true
products json required
enabled boolean No
all_products boolean No Defaults to false
use_business_schedule boolean No Defaults to false

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Menu created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Menu

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}

This API endpoint is used to update a business catalog.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).menus(menuId).save(changes);

Body Parameters

Parameter Type Required
name string No
comment string No
schedule json No
pickup boolean No
delivery boolean No
products json No
enabled boolean No
all_products boolean No Defaults to false
use_business_schedule boolean No Defaults to false

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Menu updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Menu

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}

This API endpoint is used to remove a business catalog.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Menu deleted successfully.
400 Bad request.
401 Unauthorized access.

Get Business Types List

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business_types

This API endpoint is used to get all business types.

Log in to See Full Request History

Make a request to see history.

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
api_version string required Defaults to v400
params string No Defaults to name

Responses

Status Code Description
200 Successful retrieval of business types.
400 Bad request.
401 Unauthorized access.

Find Business Type

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business_types/{business_type_id}

This API endpoint is used to obtain a single business type by ID or slug.

Log in to See Full Request History

Make a request to see history.

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
api_version string required Defaults to v400
business_type_id int32 required N/A
params string No N/A

Responses

Status Code Description
200 Successful retrieval of the business type.
400 Bad request.
401 Unauthorized access.

Create Business Types

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business_types

This API endpoint is used to create a business type.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can register a business type.

Body Parameters

Parameter Type Required
name string required
description string No
image file No
enabled boolean No Defaults to true

Metadata

Parameter Type Required Default
version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
api_version string required Defaults to v400

Responses

Status Code Description
200 Business type created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Types

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business_types/{business_type_id}

This API endpoint is used to update a business type.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can edit a business type.

Body Parameters

Parameter Type Required
name string No
description string No
image file No
enabled boolean No

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_type_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Business type updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Types

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business_types/{business_type_id}

This API endpoint is used to remove a business type.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

🚧 User Level Restrictions

Only the Admin (Level 0) can delete any business types.

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_type_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Business type deleted successfully.
400 Bad request.
401 Unauthorized access.

Get Menu Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}/metafields

This API endpoint is used to obtain menu metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A

Query Parameters

Parameter Type Description
params string No
limit int32 No
offset int32 No
start int32 No

Responses

Status Code Description
200 Successful retrieval of menu metafields.
400 Bad request.

Find Menu Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific menu metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
metafield_id int32 required N/A

Query Parameters

Parameter Type Description
params string No

Responses

Status Code Description
200 Successful retrieval of the specific menu metafield.
400 Bad request.

Create Menu Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}/metafields

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A

Body Parameters

Parameter Type Required
value string required
value_type string required
key string required

Responses

Status Code Description
200 Metafield created successfully.
400 Bad request.

Edit Menu Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}/metafields/{metafield_id}

This API endpoint is used to edit a menu metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
metafield_id int32 required N/A

Body Parameters

Parameter Type Required
value string required
value_type string required
key string required

Responses

Status Code Description
200 Metafield updated successfully.
400 Bad request.

Delete Menu Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus/{menu_id}/metafields/{metafield_id}

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Example JavaScript Code

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).menus(menuId).delete();

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
metafield_id int32 required N/A

Responses

Status Code Description
200 Metafield deleted successfully.
400 Bad request.

Shares Menus Feature

What is it?

This is a feature that offers "orderfoodonline" to replicate products in other stores, in this case through menus. It is independent in terms of "enablement," and products are also independent in certain attributes but can inherit product features from the main store.

How does it work?

After creating a menu in a business, it can be shared by using the endpoint Edit Business Menu, sending in the body the attribute 'shared' as an array of business IDs (for example, [1,2]) with which it wants to be shared. The base status of the menu is the main enable, but it can be changed by using Update Menu Shared. This shared menu can also be deleted by using Delete Menu Shared, and this action can only be performed by users with level 0 or 2.

What about the product details?

Products shared by a menu can have their own details such as Price, Enabled, Inventory, Featured, Upselling, and Quantity, which makes it easier for each store to manage an independent inventory of these shared products. All these changes can be made by using Update Menu Shared Product.

Update Menu Shared

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menu_shared/{menu_id}

This API endpoint is used to add details to a shared menu.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A

Body Parameters

Parameter Type Required
enabled boolean No

Responses

Status Code Description
200 Menu shared details updated successfully.
400 Bad request.

Delete Menu Shared

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menu_shared/{menu_id}

This API endpoint is used to delete a shared menu from a specific business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required
api_version string required
language string required
project string required
business_id int32 required
menu_id int32 required

Responses

Status Code Description
200 Menu shared deleted successfully.
400 Bad request.

Update Menu Shared Product

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menus_shared/{menu_id}/products/{product_id}

This API endpoint is used to update independent details of products from shared menus.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Details

The following fields will take values from the original store:

  • price: Will take the price of the original store
  • upselling: Will take the value of the original store
  • featured: Will take the value of the original store
  • enabled: Will take the value of the original store
  • quantity: Will be set to 0
  • inventoried: Will be set to false

Body Parameters

Parameter Type Required
enabled boolean No
upselling string No
featured string No
price string No
inventoried string No
quantity string No

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
product_id int32 required N/A

Responses

Status Code Description
200 Product updated successfully.
400 Bad request.

Get Menus Shared Extra

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menu_shared/{menu_id}/extras/{extra_id}

This API endpoint is used to obtain a specific extra from a shared menu.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
extra_id int32 required N/A

Responses

Status Code Description
200 Extra retrieved successfully.
400 Bad request.

Get Menus Shared Options

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menu_shared/{menu_id}/options/{option_id}

This API endpoint is used to obtain a specific option from a shared menu.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
option_id int32 required N/A

Responses

Status Code Description
200 Option retrieved successfully.
400 Bad request.

Get Menus Shared Suboptions

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/menu_shared/{menu_id}/suboptions/{suboption_id}

This API endpoint is used to obtain a specific suboption from a shared menu.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
menu_id int32 required N/A
suboption_id int32 required N/A

Responses

Status Code Description
200 Suboption retrieved successfully.
400 Bad request.

Business Categories Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/categories Get all categories with business_id.
Get GET /business/:business_id/categories/:category_id Get category with id business_id and category_id.
Create POST /business/:business_id/categories Create a category with business_id.
Update POST /business/:business_id/categories/:category_id Update category with business_id and category_id.
Delete DELETE /business/:business_id/categories/:category_id Delete category with business_id and category_id.

Attributes

Attribute Type Required Description Whereable
name string No, required to create. The category's name. Yes
image base64 image, url image, or file image. No The category's image. No
rank integer No The category's rank. Yes
enabled boolean No The category's status. Yes
parent_category_id integer No The Parent category ID. Yes

Restrictions for POST, PUT, and DELETE Categories

Business categories can only be created, updated, or removed by user level 0 (Type: Administrator) and user level 2 (Type: Business Owner).

  • User type Administrator can create, update, or remove any business categories.
  • User type Business Owner can create, update, or remove only business categories related to their business.

Get Response for Business Categories

In general, there are no restrictions to obtain business categories, but there are two paths to obtain them, and the data obtained depends on the type of user:

  • Normal.
  • Mode: dashboard.

Depending on the mode and the type of user, the response will be obtained as shown below:

  • User type Administrator and mode: dashboard can obtain all business categories.
  • User type Business Owner and mode: dashboard can obtain business categories related to their business.
  • User type Customer can get all business categories bounded by the business they can access (Location, if delivery or pickup) and if categories are enabled for their request.

Categories with Subcategories Example

{
        "error": false,
        "result": [
            {
                "id": 313,
                "business_id": 58,
                "name": "cat 1",
                "image": null,
                "rank": 1,
                "enabled": true,
                "external_id": null,
                "parent_category_id": null,
                "products": [
                    {
                        "id": 1673,
                        "name": "pro3",
                        "price": 3,
                        "description": null,
                        "images": null,
                        "sku": null,
                        "category_id": 313,
                        "inventoried": false,
                        "quantity": 0,
                        "featured": false,
                        "enabled": true,
                        "upselling": false,
                        "in_offer": false,
                        "offer_price": null,
                        "rank": null,
                        "offer_rate": 0,
                        "offer_rate_type": 1,
                        "offer_include_options": true,
                        "external_id": null
                    }
                ],
                "metafields": [],
                "subcategories": [
                    {
                        "id": 314,
                        "business_id": 58,
                        "name": "cat 2",
                        "image": null,
                        "rank": 2,
                        "enabled": true,
                        "external_id": null,
                        "parent_category_id": 313,
                        "subcategories": [
                            {
                                "id": 315,
                                "business_id": 58,
                                "name": "cat 3",
                                "image": null,
                                "rank": 3,
                                "enabled": true,
                                "external_id": null,
                                "parent_category_id": 314,
                                "subcategories": [
                                    {
                                        "id": 316,
                                        "business_id": 58,
                                        "name": "cat4",
                                        "image": null,
                                        "rank": 4,
                                        "enabled": true,
                                        "external_id": null,
                                        "parent_category_id": 315,
                                        "subcategories": [
                                            {
                                                "id": 317,
                                                "business_id": 58,
                                                "name": "cat4",
                                                "image": null,
                                                "rank": 5,
                                                "enabled": true,
                                                "external_id": null,
                                                "parent_category_id": 316,
                                                "subcategories": [
                                                    {
                                                        "id": 318,
                                                        "business_id": 58,
                                                        "name": "cat4",
                                                        "image": null,
                                                        "rank": 6,
                                                        "enabled": true,
                                                        "external_id": null,
                                                        "parent_category_id": 317
                                                    }
                                                ],
                                                "products": [],
                                                "metafields": []
                                            }
                                        ],
                                        "products": [],
                                        "metafields": []
                                    }
                                ],
                                "products": [
                                    {
                                        "id": 1671,
                                        "name": "pro1",
                                        "price": 1,
                                        "description": null,
                                        "images": null,
                                        "sku": null,
                                        "category_id": 315,
                                        "inventoried": false,
                                        "quantity": 0,
                                        "featured": false,
                                        "enabled": true,
                                        "upselling": false,
                                        "in_offer": false,
                                        "offer_price": null,
                                        "rank": null,
                                        "offer_rate": 0,
                                        "offer_rate_type": 1,
                                        "offer_include_options": true,
                                        "external_id": null
                                    }
                                ],
                                "metafields": []
                            }
                        ],
                        "products": [
                            {
                                "id": 1672,
                                "name": "pro2",
                                "price": 2,
                                "description": null,
                                "images": null,
                                "sku": null,
                                "category_id": 314,
                                "inventoried": false,
                                "quantity": 0,
                                "featured": false,
                                "enabled": true,
                                "upselling": false,
                                "in_offer": false,
                                "offer_price": null,
                                "rank": null,
                                "offer_rate": 0,
                                "offer_rate_type": 1,
                                "offer_include_options": true,
                                "external_id": null
                            }
                        ],
                        "metafields": []
                    }
                ]
            }
        ],
        "pagination": {
            "total": 1,
            "from": 1,
            "to": 1,
            "current_page": 1,
            "page_size": 1,
            "total_pages": 1,
            "fisrt_page": null,
            "back_page": null,
            "next_page": null,
            "last_page": null
        }
    }

Parent Category Level Restriction

If the parent category that you want to assign as parent is at the maximum depth level, it cannot be used as a parent category.

Business Category Special Request

In addition to the standard endpoints for finding categories, there is a special parameter available for categories called products. This parameter adds an extra attribute to the normal category request. Below, you will find a comparison between the normal request and the special request.

Example of Normal Request

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/categories

Normal Request Result

[
    {
        "id": 248,
        "business_id": 41,
        "name": "Main menu",
        "image": "https://res.cloudinary.com/orderfoodonline/image/upload/v1490664405/njrzftn3ttjxuvjfscls.jpg",
        "rank": 7,
        "enabled": true
    },
    {
        "id": 249,
        "business_id": 41,
        "name": "Dessert",
        "image": "https://res.cloudinary.com/orderfoodonline/image/upload/v1490664417/tw4sdwufwbrf6th3ytcq.jpg",
        "rank": 8,
        "enabled": true
    }
    ...
]

Example of Special Request

http://apiv4.orderfoodonline.co/v400/en/demo/business/41/categories?params=products

Special Request Result

[
    {
        "id": 248,
        "business_id": 41,
        "name": "Main menu",
        "image": "https://res.cloudinary.com/orderfoodonline/image/upload/v1490664405/njrzftn3ttjxuvjfscls.jpg",
        "rank": 7,
        "enabled": true,
        "products": [
            {
                "id": 1292,
                "name": "Bird's Nest",
                "price": 3,
                "description": "",
                "images": "https://res.cloudinary.com/orderfoodonline2/image/upload/v1523299637/dfqe6rjkdbqvjaibrwn2.jpg",
                "sku": null,
                "category_id": 248,
                "inventoried": false,
                "quantity": 0,
                "featured": false,
                "enabled": true
            },
            ...
        ]
    }
    ... // if findAll
]

📘 As seen above, categories include the products associated with them when the special parameter is used.

Get Business Categories

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories

This API endpoint is used to get all categories from a business.

Log in to See Full Request History

Make a request to see history.

Using orderfoodonline SDK

// get as customer
const response = await orderfoodonline.businesses(businessId).categories().get();

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400
params string No N/A
offset int32 No N/A
limit int32 No N/A

Responses

Status Code Description
200 Successful retrieval of business categories.
400 Bad request.
401 Unauthorized access.

Find Business Category

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}

This API endpoint is used to obtain a specific category of a business.

Log in to See Full Request History

Make a request to see history.

Using orderfoodonline SDK

// get as customer
const response = await orderfoodonline.businesses(businessId).categories(categoryId).get();

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
api_version string required Defaults to v400
params string No N/A

Responses

Status Code Description
200 Successful retrieval of the business category.
400 Bad request.
401 Unauthorized access.

Create Business Category

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories

This API endpoint is used to create a new category for a business.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories().save();

Body Parameters

Parameter Type Required Description
name string required The category's name.
image file No The category's image.
enabled boolean No The category's status.
parent_category_id int32 No The Parent category ID.

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Category created successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Category

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}

This API endpoint is used to remove a business category.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).delete();

Metadata

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Category deleted successfully.
400 Bad request.
401 Unauthorized access.

Get Categories Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/metafields

This API endpoint is made to get the categories metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
limit int32 No N/A
start int32 No N/A
offset int32 No N/A
params string No N/A

Responses

Status Code Description
200 Successful retrieval of categories metafields.
400 Bad request.

Get Categories Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/metafields

This API endpoint is made to get the categories metafields.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
limit int32 No N/A
start int32 No N/A
offset int32 No N/A
params string No N/A

Responses

Status Code Description
200 Successful retrieval of categories metafields.
400 Bad request.

Create Category Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/metafields

This API endpoint is used to create a specific category metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Using JavaScript

$.get('http://yoursite.com/test/' + id, function(data) {
    console.log(data);
});

Body Parameters

Parameter Type Required Description
value string required The value of the metafield.
value_type string required The type of the value (e.g., string, integer).
key string required The key for the metafield.

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A

Responses

Status Code Description
200 Metafield created successfully.
400 Bad request.

Update Category Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/metafields/{metafield_id}

This API endpoint is used to edit a specific category metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Body Parameters

Parameter Type Required Description
value string required The value of the metafield.
value_type string required The type of the value (e.g., string, integer).
key string required The key for the metafield.

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
metafield_id int32 required N/A

Responses

Status Code Description
200 Metafield updated successfully.
400 Bad request.

Delete Category Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/metafields/{metafield_id}

This API endpoint is used to delete a specific category metafield.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Metadata

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
metafield_id int32 required N/A

Responses

Status Code Description
200 Metafield deleted successfully.
400 Bad request.

Business Products Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/categories/:category_id/products Get all products with business_id and category_id.
Get GET /business/:business_id/categories/:category_id/products/:product_id Get product with id business_id, category_id and product_id.
Create POST /business/:business_id/categories/:category_id/products Create a product with business_id and category_id.
Update POST /business/:business_id/categories/:category_id/products/:product_id Update product with business_id, category_id and product_id.
Delete DELETE /business/:business_id/categories/:category_id/products/:product_id Delete product with business_id, category_id and product_id.

Product Model Attributes

Attribute Type Required Description
name string No, required to create. The product's name.
price float No, required to create. The product's price.
description string No The product's description.
images base64 image, url image or file image. No The product's image.
inventoried boolean No If product is inventoried or not.
quantity integer No The product's quantity when the product is inventoried.
featured boolean No If the product is featured or not.
extras json No The product's extras.
enabled boolean No The product's status.
upselling boolean No Indicates if the product is upselling.
minimum_per_order integer No The minimum quantity of the product to be valid in cart.
maximum_per_order float No The maximum quantity of the product to be valid in cart.
in_offer boolean No Enabled product in offer.
offer_price float No The product's offer price.

Restrictions for POST, PUT, DELETE Products

Business products can only be created, updated, or removed by user level 0 (Type: Administrator) and user level 2 (Type: Business Owner).

  • User type Administrator can create, update, or remove any business products.
  • User type Business Owner can create, update, or remove only business products related to their business.

GET Responses for Business Products

In general, there are no restrictions to obtain business products, but there are two paths to obtain them, and the data obtained depends on the type of user:

  • Normal
  • mode: dashboard

Depending on the mode and the type of user, the response will be obtained as shown below:

  • User type Administrator and mode: dashboard can get all business products.
  • User type Business Owner and mode: dashboard can get business products related to their business.
  • User type Customer can get all business products bounded by the business they can access and if business products are enabled for their request.

Upselling Feature

This feature has been implemented to promote new products. It is best used once the cart is filled, asking if the user wants any of these products with this attribute. If the product has ingredients or extras, the product options are opened, and if it is not added directly to the cart.

Get Business Products

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products

This API endpoint is used to obtain all products of a category for a specific business.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).products().get();

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
api_version string required Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
offset int32 Offset for pagination.
limit int32 Limits the number of results returned.

Responses

Status Code Description
200 Successful retrieval of business products.
400 Bad request.
401 Unauthorized access.

Find Business Product

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}

This API endpoint is used to obtain a specific product from a category.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).products(productId).get();

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
api_version string required Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the business product.
400 Bad request.
401 Unauthorized access.

Create Business Product

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products

This API endpoint is used to create products.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).products().save();

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
api_version string required Defaults to v400

Body Parameters

Parameter Type Required Description
name string required The product's name.
price float required The product's price.
description string No The product's description.
images file No The product's image.
sku string No The product's SKU (Stock Keeping Unit).
inventoried boolean No If the product is inventoried or not.
quantity int32 No The product's quantity when the product is inventoried.
featured boolean No If the product is featured or not.
enabled boolean No The product's status.
upselling boolean No Defaults to false. Indicates if the product is upselling.
minimum_per_order int32 No The minimum quantity of the product to be valid in cart.
maximum_per_order int32 No The maximum quantity of the product to be valid in cart.

Responses

Status Code Description
200 Product created successfully.
400 Bad request.
401 Unauthorized access.

Edit Business Product

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}

This API endpoint is used to update products.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).products(productId).save();

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
api_version string required Defaults to v400

Body Parameters

Parameter Type Required Description
name string No The product's name.
price float No The product's price.
description string No The product's description.
images file No The product's image.
sku string No The product's SKU (Stock Keeping Unit).
inventoried boolean No If the product is inventoried or not.
quantity int32 No The product's quantity when the product is inventoried.
featured boolean No If the product is featured or not.
extras json No The product's extras.
enabled boolean No The product's status.
upselling boolean No Defaults to false. Indicates if the product is upselling.
minimum_per_order int32 No The minimum quantity of the product to be valid in cart.
maximum_per_order int32 No The maximum quantity of the product to be valid in cart.
in_offer boolean No Defaults to false. Indicates if the product is in an offer.
offer_price float No The product's offer price.

Responses

Status Code Description
200 Product updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Business Product

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}

This API endpoint is used to remove a product.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Using orderfoodonline SDK

const response = await orderfoodonline.businesses(businessId).categories(categoryId).products(productId).delete();

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Product deleted successfully.
400 Bad request.
401 Unauthorized access.

Bulk Create Products

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/bulks/products

This API endpoint is used to massively add products to avoid overcalling the API and respect the API limits.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

How to Send Products

In order for the product to be correctly created, they must be sent as follows:

Data Structure

[
  {
    "name": "The name",
    "description": "The description",
    "price": 12,
    "category_id": 272,
    "business_id": 41
  },
  ...
]

Bulk Create Products Restrictions

  • The maximum number of products that can be added is 500.
  • The maximum number of different businesses is 5.
  • User level 0 (Type: Administrator) can add products for any business.
  • User level 2 (Type: Business Owner) can add products to businesses that belong to them.
  • If a product is wrong in the request, the API will not save any.

Bulk Products Metafields

To make it easier to use metafields in bulk endpoints, any attribute with 'metafield_' as a prefix will be considered metadata and will be added as such.

Example:

[
  {
    "name": "The name",
    "description": "The description",
    "price": 12,
    "category_id": 272,
    "business_id": 41,
    "metafield_attribute1": "value1",
    "metafield_attribute2": "value2"
  },
  ...
]

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo

Body Parameters

Parameter Type Required Description
products json required The array of product objects to be created.

Responses

Status Code Description
200 Products created successfully.
400 Bad request.

Bulk Edit Products

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/bulks/products

This API endpoint is used to massively edit products to avoid overcalling the API.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

How to Send Products

In order for the products to be correctly edited, they must be sent as follows:

JSON Structure

[
  {
    "id": 1292,
    "name": "The name",
    "description": "The description",
    "price": 12,
    "category_id": 272,
    "business_id": 41
  },
  ...
]

Bulk Edit Products Restrictions

  • The maximum number of products that can be updated is 500.
  • The maximum number of different businesses is 5.
  • User level 0 (Type: Administrator) can update products for any business.
  • User level 2 (Type: Business Owner) can update products only for businesses that belong to them.
  • If a product is wrong in the request, the API will not save any.

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo

Body Parameters

Parameter Type Required Description
products json required The array of product objects to be edited.

Responses

Status Code Description
200 Products updated successfully.
400 Bad request.

Bulk Delete Products

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/bulks/products

This API endpoint is used to massively delete products to avoid overcalling the API.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

How to Send Products

In order for the products to be correctly deleted, they must be sent as follows:

JSON Structure

{"products":"[9891,9892,9893]"}

Bulk Delete Products Restrictions

  • The maximum number of products that can be deleted is 500.
  • User level 0 (Type: Administrator) can delete products for any business.
  • User level 2 (Type: Business Owner) can delete products only for businesses that belong to them.
  • If a product is wrong in the request, the API will not delete any.

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo

Body Parameters

Parameter Type Required Description
products json required The array of product IDs to be deleted.

Responses

Status Code Description
200 Products deleted successfully.
400 Bad request.

Get All Business Products

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/products

This API endpoint is used to obtain all products of a specific business.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
api_version string required Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
offset int32 Offset for pagination.
limit int32 Limits the number of results returned.
menu_id int32 The menu ID.
timestamp int32 The time to search for available products at this time.
type int32 Order Type, can be delivery (1) or pickup (2).
where int32 Additional filtering criteria.

Responses

Status Code Description
200 Successful retrieval of business products.
400 Bad request.
401 Unauthorized access.

Business Place Groups Model

Endpoints

Action Method Resource Description
Get all GET /business/:business_id/place_groups Get all place groups.
Get GET /business/:business_id/place_groups/:place_group_id Get a specific place group.
Create POST /business/:business_id/place_groups Create a new place group.
Update PUT /business/:business_id/place_groups/:place_group_id Update a specific place group.
Delete DELETE /business/:business_id/place_groups/:place_group_id Delete a specific place group.

Place Group Model Attributes

Attribute Type Required Description
name string Yes Name of the place group.

Get Business Place Groups

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/:business_id/place_groups

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
:business_id int32 required N/A

Responses

Status Code Description
200 Successful retrieval of business place groups.
400 Bad request.

Get a Business Place Group

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/:business_id/place_groups/:place_group_id

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
:business_id int32 required N/A
:place_group_id int32 required N/A

Responses

Status Code Description
200 Successful retrieval of the business place group.
400 Bad request.

Create a Business Place Group

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/:business_id/place_groups

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
:business_id int32 required N/A

Query Parameters

Parameter Type Required
name string required

Responses

Status Code Description
200 Place group created successfully.
400 Bad request.

Update a Business Place Group

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/:business_id/place_groups/:place_group_id

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
:business_id int32 required N/A
:place_group_id int32 required N/A

Query Parameters

Parameter Type Required
name string required

Responses

Status Code Description
200 Place group updated successfully.
400 Bad request.

Delete a Business Place Group

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/:business_id/place_groups/:place_group_id

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
:business_id int32 required N/A
:place_group_id int32 required N/A

Responses

Status Code Description
200 Place group deleted successfully.
400 Bad request.

Get Product Metafields

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/metafields

This API endpoint is used to obtain product metafields.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
limit string Limits the number of results returned.
offset string Offset for pagination.
start string Start point for pagination.

Responses

Status Code Description
200 Successful retrieval of product metafields.
400 Bad request.

Find Product Metafield

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/metafields/{metafield_id}

This API endpoint is used to obtain a specific product metafield.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
metafield_id int32 required N/A

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the product metafield.
400 Bad request.

Create Product Metafield

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/metafields

This API endpoint is used to create a product metafield.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A

Body Parameters

Parameter Type Required Description
value string required The value of the metafield.
value_type string required The type of the value (e.g., string, integer).
key string required The key for the metafield.

Responses

Status Code Description
200 Product metafield created successfully.
400 Bad request.

Edit Product Metafield

Endpoint

PUT https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/metafields/{metafield_id}

This API endpoint is used to edit product metafields.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
metafield_id int32 required N/A

Body Parameters

Parameter Type Required Description
value string required The new value for the metafield.
value_type string required The type of the value (e.g., string, integer).
key string required The key for the metafield.

Responses

Status Code Description
200 Product metafield updated successfully.
400 Bad request.

Delete Product Metafield

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/metafields/{metafield_id}

This API endpoint is used to delete a product metafield.

Log in to See Full Request History

Make a request to see history.

Time: N/A

Status: N/A

User Agent: N/A

Path Parameters

Parameter Type Required Default
api_version string required Defaults to v400
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
metafield_id int32 required N/A

Responses

Status Code Description
200 Product metafield deleted successfully.
400 Bad request.

Product Ingredients Model

Ingredients can be used for food products, or ingredients can be used as specifications or characteristics for a product.

Endpoints

Action Method Resource
Get all GET /business/:business_id/categories/:category_id/products/:product_id/ingredients
Get GET /business/:business_id/categories/:category_id/products/:product_id/ingredients/:ingredient_id
Create POST /business/:business_id/categories/:category_id/products/:product_id/ingredients
Update POST /business/:business_id/categories/:category_id/products/:product_id/ingredients/:ingredient_id
Delete DELETE /business/:business_id/categories/:category_id/products/:product_id/ingredients/:ingredient_id

Attributes

Attribute Type Required Description
name string No, required to create The ingredient name.
image string No The ingredient image.

📘 Restrictions for POST, PUT, DELETE Ingredients

Product ingredients can only be created, updated, or removed by user level 0 (Type: Administrator) and user level 2 (Type: Business Owner).

  • User type Administrator can create, update, or remove any product ingredients for any business.
  • User type Business Owner can create, update, or remove only product ingredients related to their business.

Note: Unlike the extras that are shared between products, the ingredients are directly linked to the products and are not shared between products.

Get Product Ingredients

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/ingredients

This API endpoint is used to get all ingredients for a specific product.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
api_version string required Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.
limit int32 Limits the number of results returned.
offset int32 Offset for pagination.

Responses

Status Code Description
200 Successful retrieval of product ingredients.
400 Bad request.
401 Unauthorized access.

Find Product Ingredient

Endpoint

GET https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/ingredients/{ingredient_id}

This API endpoint is used to find a specific ingredient of a product.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
ingredient_id int32 required N/A
api_version string required Defaults to v400

Query Parameters

Parameter Type Description
params string Additional parameters for the request.

Responses

Status Code Description
200 Successful retrieval of the product ingredient.
400 Bad request.
401 Unauthorized access.

Create Product Ingredient

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/ingredients

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
api_version string required Defaults to v400

Body Parameters

Parameter Type Required Description
name string required The ingredient name.

Responses

Status Code Description
200 Product ingredient created successfully.
400 Bad request.
401 Unauthorized access.

Edit Product Ingredient

Endpoint

POST https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/ingredients/{ingredient_id}

This API endpoint is used to update an item from a business gallery.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
ingredient_id int32 required N/A
api_version string required Defaults to v400

Body Parameters

Parameter Type Required Description
name string required The updated ingredient name.

Responses

Status Code Description
200 Product ingredient updated successfully.
400 Bad request.
401 Unauthorized access.

Delete Product Ingredient

Endpoint

DELETE https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/business/{business_id}/categories/{category_id}/products/{product_id}/ingredients/{ingredient_id}

This API endpoint is used to remove an ingredient from a product.

Log in to See Full Request History

Make a request to see history.

0 Requests This Month

Path Parameters

Parameter Type Required Default
language string required Defaults to en
project string required Defaults to demo
business_id int32 required N/A
category_id int32 required N/A
product_id int32 required N/A
ingredient_id int32 required N/A
api_version string required Defaults to v400

Responses

Status Code Description
200 Product ingredient deleted successfully.
400 Bad request.
401 Unauthorized access.