Skip to main content

Authentication - API key

The simplest way to authenticate is with a shop level API key. This key will give you unrestricted access to all API endpoints for your shop.

Getting credentials

Note that the creation of API credentials is reserved for users with the SUPER ADMIN role.

  1. Navigate to For developers to create an API user.
  2. If API credentials haven't been generated yet, you will find a "Create API User" button under the "Open API" section. Click on it, and shortly after, the Username and Password for the Open API User will be provided. Keep your API credentials confidential and do not share them with unauthorized personnel. These credentials grant access to sensitive data and actions within our system. Always use HTTPS/SSL for encrypted communication when making API requests.

Authorizing with credentials

After Open API User was created, you can authorize your request by using Basic Access Authentication.

This can be achieved by constructing an Authorization header with the format Basic base64-encoded-username-and-password. The base64-encoded credentials should be passed with each request to gain access to the protected resources.

curl example:

curl -u "your_username:your_password" http://api.fourthwall.com/open-api/v1/order/{YOUR_ORDER_ID}

Javascript example:

const username = "your_username";
const password = "your_password";

// Combine username and password with a colon
const combinedCredentials = `${username}:${password}`;

// Encode the combined credentials to Base64
const base64Credentials = btoa(combinedCredentials);

const apiUrl = "http://api.fourthwall.com/open-api/v1/order/{YOUR_ORDER_ID}";
const requestOptions = {
method: "GET",
headers: {
"Authorization": `Basic ${base64Credentials}`,
"Content-Type": "application/json"
}
};

fetch(apiUrl, requestOptions)
.then(response => response.json()) // Parse the JSON response directly
.then(data => {
// Handle the API response data here
console.log(data);
})
.catch(error => {
// Handle errors
console.error("Error:", error);
});