Variant
Add variant label
Adds a new variant label, and the translations in LocalizedLabels when they are set.
POST/API/Variant/Label
Request Example
curl -X POST 'https://mgmtapi.geins.io/API/Variant/Label' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]' \
-H 'X-ApiKey: {MGMT_API_KEY}'\
-d '{
"Label": "string",
"LocalizedLabels": [
{
"LanguageCode": "string",
"Content": "string"
}
]
}'
import axios from 'axios';
const config = {
method: 'POST',
url: 'https://mgmtapi.geins.io/API/Variant/Label',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
data: {
"Label": "string",
"LocalizedLabels": [
{
"LanguageCode": "string",
"Content": "string"
}
]
}
};
axios.request(config)
.then(response => response.data)
.catch(error => console.error(error));
fetch('https://mgmtapi.geins.io/API/Variant/Label', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
body: JSON.stringify({
"Label": "string",
"LocalizedLabels": [
{
"LanguageCode": "string",
"Content": "string"
}
]
})
})
.then(res => res.json())
.then((response) => response)
.catch(console.error);
import requests
url = "https://mgmtapi.geins.io/API/Variant/Label"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
payload = {
"Label": "string",
"LocalizedLabels": [
{
"LanguageCode": "string",
"Content": "string"
}
]
}
response = requests.POST(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://mgmtapi.geins.io/API/Variant/Label"
payload := []byte(`{
"Label": "string",
"LocalizedLabels": [
{
"LanguageCode": "string",
"Content": "string"
}
]
}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]")
req.Header.Add("X-ApiKey", "{MGMT_API_KEY}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
using System.Text;
using System.Text.Json;
using System.Net.Http;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]");
client.DefaultRequestHeaders.Add("X-ApiKey", "{MGMT_API_KEY}");
var body = new
{
Label = "string",
LocalizedLabels = new[]
{
new
{
LanguageCode = "string",
Content = "string"
}
}
};
var jsonContent = JsonSerializer.Serialize(body);
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
var response = await client.POSTAsync("https://mgmtapi.geins.io/API/Variant/Label", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Response
{
"Resource": [
"string"
],
"Message": "string",
"Details": [
"string"
]
}
{
"Message": "string",
"Details": [
"string"
]
}
Delete variant group (product id)
Deletes an entire variant group based on product id.
Update variant label
Updates an existing variant label, and the translations in LocalizedLabels when they are set. A label that is used by products cannot be renamed, but its translations can be updated by sending the same label. When a stored translation changes, every product that uses the label gets a product update.