Create script
curl --request POST \
--url https://api.quickbutik.com/v1/scripts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"content": "<string>",
"placement": "head",
"is_active": 1,
"load_priority": 123
}
'import requests
url = "https://api.quickbutik.com/v1/scripts"
payload = {
"name": "<string>",
"content": "<string>",
"placement": "head",
"is_active": 1,
"load_priority": 123
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
content: '<string>',
placement: 'head',
is_active: 1,
load_priority: 123
})
};
fetch('https://api.quickbutik.com/v1/scripts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.quickbutik.com/v1/scripts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'content' => '<string>',
'placement' => 'head',
'is_active' => 1,
'load_priority' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.quickbutik.com/v1/scripts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.quickbutik.com/v1/scripts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quickbutik.com/v1/scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"placement": "head",
"value": "<string>",
"is_active": 0,
"load_priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
}{
"code": 404,
"error": "Resource not found"
}{
"code": 404,
"error": "Resource not found"
}Scripts
Create script
Create a new storefront script
POST
/
v1
/
scripts
Create script
curl --request POST \
--url https://api.quickbutik.com/v1/scripts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"content": "<string>",
"placement": "head",
"is_active": 1,
"load_priority": 123
}
'import requests
url = "https://api.quickbutik.com/v1/scripts"
payload = {
"name": "<string>",
"content": "<string>",
"placement": "head",
"is_active": 1,
"load_priority": 123
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
content: '<string>',
placement: 'head',
is_active: 1,
load_priority: 123
})
};
fetch('https://api.quickbutik.com/v1/scripts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.quickbutik.com/v1/scripts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'content' => '<string>',
'placement' => 'head',
'is_active' => 1,
'load_priority' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.quickbutik.com/v1/scripts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.quickbutik.com/v1/scripts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quickbutik.com/v1/scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"placement\": \"head\",\n \"is_active\": 1,\n \"load_priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"placement": "head",
"value": "<string>",
"is_active": 0,
"load_priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
}{
"code": 404,
"error": "Resource not found"
}{
"code": 404,
"error": "Resource not found"
}Authorizations
Basic Authentication with API Keys
The Quickbutik API uses Basic Authentication where you use your API key as both the username and password.
How it works:
- Format your credentials as
api_key:api_key(using the SAME API key for both username and password) - Base64 encode the formatted string
- Include in the Authorization header as:
Authorization: Basic ENCODED_STRING
Example:
- API Key:
sk_live_abc123 - Formatted:
sk_live_abc123:sk_live_abc123 - Base64 Encoded:
c2tfbGl2ZV9hYmMxMjM6c2tfbGl2ZV9hYmMxMjM= - Header:
Authorization: Basic c2tfbGl2ZV9hYmMxMjM6c2tfbGl2ZV9hYmMxMjM=
cURL Example:
curl https://api.quickbutik.com/v1/orders -u your_api_key:your_api_key
All API requests must be made over HTTPS. Requests made over HTTP will be rejected.
API keys can be generated in the Quickbutik Control Panel under Settings → API.
Body
application/json
Response
Script created successfully
Script ID
Script name
Where the script should be placed
Available options:
head, body_start, body_end The script content (JavaScript code)
Script active status
Available options:
0, 1 Loading priority order
Creation timestamp
Last update timestamp