Products
Create a new product variant
This endpoint creates a new variant for a specified product. It requires the x-store-id header for authorization, and attributes such as name and price must be provided in the request body. The endpoint supports adding options like subscription intervals.
POST
/
v1
/
products
/
{id}
/
variants
Create a new product variant
curl --request POST \
--url https://api.blink.store/v1/v1/products/{id}/variants \
--header 'Content-Type: application/json' \
--header 'x-store-id: <api-key>' \
--data '
{
"name": "<string>",
"price": 123,
"description": "<string>",
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": true,
"requires_license_key": true,
"license_key_activation_limit": 123
}
'import requests
url = "https://api.blink.store/v1/v1/products/{id}/variants"
payload = {
"name": "<string>",
"price": 123,
"description": "<string>",
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": True,
"requires_license_key": True,
"license_key_activation_limit": 123
}
headers = {
"x-store-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-store-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 123,
description: '<string>',
subscription_interval: '<string>',
trial_days: 123,
is_active: true,
requires_license_key: true,
license_key_activation_limit: 123
})
};
fetch('https://api.blink.store/v1/v1/products/{id}/variants', 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.blink.store/v1/v1/products/{id}/variants",
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>',
'price' => 123,
'description' => '<string>',
'subscription_interval' => '<string>',
'trial_days' => 123,
'is_active' => true,
'requires_license_key' => true,
'license_key_activation_limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-store-id: <api-key>"
],
]);
$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.blink.store/v1/v1/products/{id}/variants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-id", "<api-key>")
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.blink.store/v1/v1/products/{id}/variants")
.header("x-store-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blink.store/v1/v1/products/{id}/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"product_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": true,
"requires_license_key": true,
"license_key_activation_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"deliverables": [
{
"id": "<string>",
"type": "<string>",
"title": "<string>",
"description": "<string>",
"url": "<string>",
"button_label": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Authorizations
Path Parameters
ID of the product to create a variant for.
Body
application/json
Response
Product variant created successfully.
Previous
Retrieve product variant detailsThis endpoint fetches detailed information about a specific variant of a product. It is essential to provide the `x-store-id` header for authentication and to ensure the variant is associated with an existing product. The response includes complete variant details for further actions or display.
Next
⌘I
Create a new product variant
curl --request POST \
--url https://api.blink.store/v1/v1/products/{id}/variants \
--header 'Content-Type: application/json' \
--header 'x-store-id: <api-key>' \
--data '
{
"name": "<string>",
"price": 123,
"description": "<string>",
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": true,
"requires_license_key": true,
"license_key_activation_limit": 123
}
'import requests
url = "https://api.blink.store/v1/v1/products/{id}/variants"
payload = {
"name": "<string>",
"price": 123,
"description": "<string>",
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": True,
"requires_license_key": True,
"license_key_activation_limit": 123
}
headers = {
"x-store-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-store-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 123,
description: '<string>',
subscription_interval: '<string>',
trial_days: 123,
is_active: true,
requires_license_key: true,
license_key_activation_limit: 123
})
};
fetch('https://api.blink.store/v1/v1/products/{id}/variants', 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.blink.store/v1/v1/products/{id}/variants",
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>',
'price' => 123,
'description' => '<string>',
'subscription_interval' => '<string>',
'trial_days' => 123,
'is_active' => true,
'requires_license_key' => true,
'license_key_activation_limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-store-id: <api-key>"
],
]);
$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.blink.store/v1/v1/products/{id}/variants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-id", "<api-key>")
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.blink.store/v1/v1/products/{id}/variants")
.header("x-store-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blink.store/v1/v1/products/{id}/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"price\": 123,\n \"description\": \"<string>\",\n \"subscription_interval\": \"<string>\",\n \"trial_days\": 123,\n \"is_active\": true,\n \"requires_license_key\": true,\n \"license_key_activation_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"product_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"subscription_interval": "<string>",
"trial_days": 123,
"is_active": true,
"requires_license_key": true,
"license_key_activation_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"deliverables": [
{
"id": "<string>",
"type": "<string>",
"title": "<string>",
"description": "<string>",
"url": "<string>",
"button_label": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}