NAV Navbar
shell javascript

Introduction

v1.1
Last Updated: 2020-07-13

Welcome to Cute Order's Cute API! You can use the following information to access Cute Order API endpoints, which allows you to retrieve information on various aspects of your online ordering store. You can even write your own tools to programmatically interact with your online storefront. This allows for a high degree of automation, not available from other online ordering providers.

Integrating with APIs requires programming knowledge, so make sure you're comfortable with basic programming or scripting before you continue. It may be difficult to connect to Cute Order's API endpoints with limited computer experience. Cute Order cannot offer support on any programming issues.

We have examples written for Shell and in JavaScript. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

If you would like to find out more information about our online ordering system, please visit our homepage: Cute Order.

Note: The Cute API is a work-in-progress (WIP), and will most likely evolve over time as we figure out the best way to provide this service to our customers.

Not all planned functionality has been added as of yet.

Authentication

To call the Cute API, use this template for authentication:

# With shell scripts, it's pretty easy to work with the API
curl -G "https://storm.cute.services/api/v1/echo"
    --data-urlencode "namespace=cuteorder"
    --data-urlencode "account=4500001-1000"
    --data-urlencode "username=cuteapiuser"
    --data-urlencode "key=xxxxxxxxxxxxxxxxx"
////////////////////////////////////////////////////////////////
//  We'll be using Node.js for our JavaScript examples.
//  You'll also need to install the popular
//              'request' library to run this code.
//  Include it in your project by running: npm install request
////////////////////////////////////////////////////////////////

const request = require('request')
const qs = {
    namespace: 'cuteorder',
    account: '4500001-1000',
    username: 'cuteapiuser',
    key: 'xxxxxxxxxxxxxxxxx'
}

request.get({url: 'https://storm.cute.services/api/v1/echo', qs,
    json: true}, (e, r, res) => {
        console.log(res)
    })

Make sure to replace all relevant information with the appropriate values.

The Cute API has a rather simple mode of authentication. Our API endpoint server accepts HTTPS GET requests, expecting all parameters, including authentication information, to be passed as a query string.

When calling the Cute API in any capacity, the following information is always required to be part of the request:

namespace: cuteorder

account: 123456 or 123456-1234

username: mystoreadmin

key: XXXXXXXXXXXXXXXXXXXXXXXX

For your security, TLS v1.1 or greater is required to use the Cute API. Our API endpoint server can also handle TLS v1.3 connections. HTTP connectivity is not available.

Rate Limiting

Every call to the Cute API has a "weight" associated with it. When the total weight of all the actions within an hour from a single API Key exceeds 400, the system will stop responding to requests from that API Key. This is to prevent out-of-control 3rd-party services from pulling large amounts of data from our systems continuously. The exact weight values for each type of API call will need to be adjusted over time, as we analyze what type of actions are commonly performed, and the overall impact to our servers. Weight values will be specified for each function, along with any changes we choose to make. The weight will always be an integer value.

Getting Started

Cute API JSON Response Format

Field Type Description
version number Will always be an integer value (e.g. 1, 2, 3, 4...).
success boolean Always true or false. False value indicates a hard failure, where any requested changes have been discarded, and no information has been returned. result should be ignored when success is false.
error null or string This field will only be populated with a string when success is false, otherwise it will be null. The string will describe the nature of the error that has occurred.
error_code number Will always be a three-digit integer value (e.g. 100, 101, 102... 998, 999), or 0. A chart of error codes will be provided at the bottom of this document. Will be 0 when error is null.
warning null or string This field may be populated with a string at any time, and should be checked by your application during every call. This field is used to notify the user of soft errors or warnings, where any requested change has been made, and any requested information has been returned, but yet, there is some additional information of which the implementer should be aware (e.g. deprecation).
total_weight number Will always be an integer value (e.g. 1, 2, 3, 4...) or 0, and will contain the current total weight (rate limiting) values as calculated by the Cute API. The total_weight returned includes the weight of the current API call. In short, it would be the weight used to determine if rate limiting needed to be applied to your application if it were to make an immediate subsequent API call. total_weight will be set to 0 if API Key authentication fails or the Cute API encounters an error before API Key authentication could take place, but it will contain the correct total_weight values if authentication succeeds, but provided API Key has been rate-limited. As every Cute API endpoint has an associated weight value, a total_weight of 0 should be indicative of an error.
result variable This field contains the "payload" or return value of the requested API call. As the data type and structure of result will differ for every API endpoint, it will be clearly delimited in our documentation for each API endpoint.

All fields listed above are guaranteed, and will always appear in any response from the Cute API.

Extra Particulars

/echo

The Cute API will always return JSON in the same general format.
The code above returns the following JSON:

{
    "version": 1,
    "success": true,
    "error": null,
    "error_code": 0,
    "warning": null,
    "total_weight": 1,
    "result": "echo"
}

The Cute API will always return JSON as a response.

This API endpoint replies with the string "echo". Its main purpose is to provide a simple first step for those seeking Cute API integration into their custom applications.

HTTPS Request

GET https://storm.cute.services/api/v1/echo

Query Parameters

None.

Returns

Type: string

The value "echo".

Weight

1

Basic Store Operations

/close-store

Remember to include the authentication information with every API call.

curl -G "https://storm.cute.services/api/v1/close-store"
    --data-urlencode "namespace=cuteorder"
    --data-urlencode "account=4500001-1000"
    --data-urlencode "username=cuteapiuser"
    --data-urlencode "key=xxxxxxxxxxxxxxxxx"
    --data-urlencode "message=a reason why the store should be closed"
    --data-urlencode "store_id=1000"
const request = require('request')
const qs = {
    namespace: 'cuteorder',
    account: '4500001-1000',
    username: 'cuteapiuser',
    key: 'xxxxxxxxxxxxxxxxx',
    message: 'a reason why the store should be closed',
    store_id: '1000'
}

request.get({url: 'https://storm.cute.services/api/v1/close-store', qs,
    json: true}, (e, r, res) => {
        console.log(res)
    })

Example Response:

{
    "version": 1,
    "success": true,
    "error": null,
    "error_code": 0,
    "warning": null,
    "total_weight": 30,
    "result": null
}

This API endpoint allows an integrated application or tool to close a store on the Cute Order Platform, so that customers will not be able to place orders through the online ordering storefront. The API call requires a message to show the customer as to the reason of the closure.

HTTPS Request

GET https://storm.cute.services/api/v1/close-store

Query Parameters

Parameter Requirements Description
message A string comprised of printable Unicode characters. Min Length: 1 character, Max Length: 255 characters. The message that will be displayed to the customer explaining the reason why the store is closed.
store_id The 4-digit Cute Store ID of the store you wish to close. (e.g. "1000") This is the store that will be closed.

Returns

Type: n/a

The value "null". You may ignore the result field in the response for this API call. If the store is already closed, its current closure message will be overwritten with the one supplied in the API call.

Weight

15

/open-store

Example Code:

curl -G "https://storm.cute.services/api/v1/open-store"
    --data-urlencode "namespace=cuteorder"
    --data-urlencode "account=4500001-1000"
    --data-urlencode "username=cuteapiuser"
    --data-urlencode "key=xxxxxxxxxxxxxxxxx"
    --data-urlencode "store_id=1000"
const request = require('request')
const qs = {
    namespace: 'cuteorder',
    account: '4500001-1000',
    username: 'cuteapiuser',
    key: 'xxxxxxxxxxxxxxxxx',
    store_id: '1000'
}

request.get({url: 'https://storm.cute.services/api/v1/open-store', qs,
    json: true}, (e, r, res) => {
        console.log(res)
    })

Example Response:

{
    "version": 1,
    "success": true,
    "error": null,
    "error_code": 0,
    "warning": null,
    "total_weight": 60,
    "result": null
}

This API endpoint allows an integrated application or tool to open a store back up for online orders on the Cute Order Platform, after it had been closed.

HTTPS Request

GET https://storm.cute.services/api/v1/open-store

Query Parameters

Parameter Requirements Description
store_id The 4-digit Cute Store ID of the store you wish to open. (e.g. "1000") This is the store that will be opened.

Returns

Type: n/a

The value "null". You may ignore the result field in the response for this API call. If the store is already open, this API call will have no effect. The appropriate weight value for the call will still be applied.

Weight

15

/adjust-lead-times

Example Code:

curl -G "https://storm.cute.services/api/v1/adjust-lead-times"
    --data-urlencode "namespace=cuteorder"
    --data-urlencode "account=4500001-1000"
    --data-urlencode "username=cuteapiuser"
    --data-urlencode "key=xxxxxxxxxxxxxxxxx"
    --data-urlencode "store_id=1000"
    --data-urlencode "pickup=10"
    --data-urlencode "delivery=15"
    --data-urlencode "dinein=20"
const request = require('request')
const qs = {
    namespace: 'cuteorder',
    account: '4500001-1000',
    username: 'cuteapiuser',
    key: 'xxxxxxxxxxxxxxxxx',
    store_id: '1000',
    pickup: '10',
    delivery: '10',
    dinein: '100'
}

request.get({url: 'https://storm.cute.services/api/v1/adjust-lead-times', qs,
    json: true}, (e, r, res) => {
        console.log(res)
    })

Example Response:

{
    "version": 1,
    "success": true,
    "error": null,
    "error_code": 0,
    "warning": null,
    "total_weight": 10,
    "result": null
}

This API endpoint allows an integrated application or tool to adjust the lead times for a given online ordering storefront. Lead times are used to notify the customer of a general maximum amount of time before they can expect an order to be ready. This also affects how soon a customer can specify an order to be ready when allowing scheduled orders or "future time" orders.

Even if your store does not offer one of the following modes of order fulfillment (pick-up, delivery, or dine-in), you must still include a lead time value for each setting. The value will be ignored if you do not offer one of the fulfillment modes. If you decide to enable a given mode, such as delivery, at a later point in time, the Cute Order system will then use the provided value.

HTTPS Request

GET https://storm.cute.services/api/v1/adjust-lead-times

Query Parameters

Parameter Requirements Description
store_id The 4-digit Cute Store ID of the store for which you wish to modify lead times. (e.g. "1000") This is the store that will be modified.
pickup Lead time in minutes. Only integer values will be accepted. This is the lead time required for the given store to provide pickup order types.
delivery Lead time in minutes. Only integer values will be accepted. This is the lead time required for the given store to provide delivery order types.
dinein Lead time in minutes. Only integer values will be accepted. This is the lead time required for the given store to provide dinein order types.

Returns

Type: n/a

The value "null". You may ignore the result field in the response for this API call.

Weight

10

Error Codes

Code Type Description
100 Bad Authorization Your credentials are likely invalid.
101 Wrong Version You are using an unsupported or outdated protocol version.
102 Rate Limited You have made too many requests and are currently being rate limited.
103 Invalid Endpoint The specified path was not found. Most likely an incorrect URL.
104 Invalid Parameters The parameters passed to the specified API call were invalid in some way.
999 Unknown Error Please check the specified path/URL and any query strings you may have used.