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
Updated: January 06, 2024
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.
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.
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. |
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.
To install the SDK, you can use the following commands:
npm install orderfoodonline-api-sdk
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);
});
The Order Food Online API uses several special data types to ensure consistency and clarity in data exchange. Here are the key data types:
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"
}
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"
}
Represents an item in an order.
{
"product_id": 789,
"quantity": 2
}
Represents an address associated with a customer.
{
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "USA"
}
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. |
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.
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
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);
});
The following attributes are available for each resource:
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"
}
The Order Food Online API supports pagination to handle large sets of data efficiently. You can use query parameters to control the pagination behavior.
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
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
}
}
The Order Food Online API supports filtering to handle large sets of data efficiently. You can use query parameters to control the filtering behavior.
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
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"
},
...
]
To get started with our API, follow these steps:
For detailed information on how to use our API, visit our API documentation.
The documentation includes:
Our API offers flexible pricing plans to suit your business needs:
Sign up for a plan on our pricing page.
"Order Food Online Help's API has streamlined our order management process, making it more efficient and user-friendly."
"The customer support is exceptional. They helped us troubleshoot an issue within hours."
Tech Solutions integrated Order Food Online Help's API to streamline their order management process, resulting in a 30% increase in efficiency.
Read MoreXYZ Corp used Order Food Online co's API to enhance their customer experience, leading to a 20% increase in customer satisfaction.
Read MoreLearn step-by-step how to integrate our API into your application and start managing orders efficiently.
Read MoreDiscover best practices for managing orders using our API to ensure a smooth and efficient process.
Read MoreThe Order Food Online API is a set of tools and endpoints that allow you to integrate Order Food Online functionality into your application.
Sign up for an API key on our developer portal and follow the steps in the API documentation.
Yes, we offer support through our contact page.
If you have any questions or need assistance, feel free to contact us:
For information on API versioning, please visit our versioning reference.
For detailed testing instructions, please visit our testing instructions reference.
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.
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:
"result": {
...
"session": {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o",
"token_type": "bearer",
"expires_in": 31536000
},
...
}
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": "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o"
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuNzI6ODA4MFwvdjQwMFwvZW5cL2FkbWluaXN0cmF0b3JcL2F1dGgiLCJpYXQiOjE1Mzg0MDQzODMsImV4cCI6MTU2OTk0MDM4MywibmJmIjoxNTM4NDA0MzgzLCJqdGkiOiJBeHV5RG5oWE9veEZ5UTF2Iiwic3ViIjoxLCJwcnYiOiJkYzg3MzkwZWNhN2ZmZGU1MDE0MmEzYmY0MThmOGRhY2ZhNWZjYTYwIiwibGV2ZWwiOjB9.VjOisUjZku5k2jYFi-J1UMXW8W7PjKWhtIDSyOyHS7o";
orderfoodonline.setToken(token);
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.
Make a request to see history.
In order for the cellphone login to work, the number must be registered and associated with a user.
const response = await orderfoodonline.users().auth(
{
email: 'superadmin@orderfoodonline.co',
password: 'super'
}
);
endemo. You can use the API explorer with our demo project or with your own Order Food Online project.v400superadmin@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.super1 or 0. Enable or disable recaptcha.
Social Login
Endpoint
POST
https://apiv4.orderfoodonline.co/{api_version}/{language}/{project}/auth/facebookUsed to authorize users with Facebook Login.
Log in to see full request history
Make a request to see history.
Current Allowed Platforms
Platform Body Params
access_tokenaccess_tokenname: 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 frontendApple Login Example