Variant
Add product to variant group (product)
Adds a product to an existing variant group from another product.
Parameters for "Add product to variant group (product)"
PUT/API/Variant/{productId1}/{productId2}
Request Example
curl -X PUT 'https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]' \
-H 'X-ApiKey: {MGMT_API_KEY}'
import axios from 'axios';
const config = {
method: 'PUT',
url: 'https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
};
axios.request(config)
.then(response => response.data)
.catch(error => console.error(error));
fetch('https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}', {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
})
.then(res => res.json())
.then((response) => response)
.catch(console.error);
import requests
url = "https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
response = requests.PUT(url, headers=headers)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}"
payload := []byte{}
req, _ := http.NewRequest("PUT", url, nil)
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 response = await client.PUTAsync("https://mgmtapi.geins.io/API/Variant/{productId1}/{productId2}", null);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Response
{
"Resource": {
"GroupId": 0,
"Name": "string",
"CollapseInLists": true,
"MainProductId": 0,
"ProductIds": [
0
],
"Products": [
{
"ProductId": 0,
"ArticleNumber": "string",
"Names": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"DateCreated": "string",
"DateUpdated": "string",
"DateFirstAvailable": "string",
"MaxDiscountPercentage": 0,
"Active": true,
"PurchasePrice": 0,
"PurchasePriceCurrency": "string",
"ShortTexts": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"LongTexts": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"TechTexts": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Items": [
{
"ItemId": 0,
"ArticleNumber": "string",
"ProductId": 0,
"Name": "string",
"Shelf": "string",
"Weight": 0,
"Length": 0,
"Width": 0,
"Height": 0,
"Gtin": "string",
"DateCreated": "string",
"DateUpdated": "string",
"DateIncoming": "string",
"Active": true,
"ExternalId": "string",
"Stock": {
"ItemId": 0,
"Stock": 0,
"StockOversellable": 0,
"StockStatic": 0,
"StockSellable": 0
},
"ShippingFees": [
{
"Market": 0,
"Country": "string",
"Service": "string",
"ServiceId": 0,
"Fee": 0
}
]
}
],
"Prices": [
{
"ProductId": 0,
"PriceListId": 0,
"PriceListName": "string",
"PriceIncVat": 0,
"PriceExVat": 0,
"VatRate": 0,
"Country": "string",
"Currency": "string",
"StaggeredCount": 0,
"ValidFrom": "string",
"ValidTo": "string"
}
],
"Categories": [
{
"CategoryId": 0,
"ParentCategoryId": 0,
"Names": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Descriptions": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"SecondaryDescriptions": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Meta": {
"Descriptions": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Keywords": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Titles": [
{
"LanguageCode": "string",
"Content": "string"
}
]
},
"GoogleCategoryPath": "string",
"Hidden": true,
"Active": true
}
],
"Images": [
{
"ProductId": 0,
"Url": "string",
"Order": 0,
"Tags": [
"string"
]
}
],
"BrandId": 0,
"BrandName": "string",
"SupplierId": 0,
"SupplierName": "string",
"ParameterValues": [
{
"ParameterValueId": 0,
"ProductId": 0,
"ParameterId": 0,
"ParameterName": "string",
"GroupId": 0,
"GroupName": "string",
"ParameterType": 0,
"Value": "string",
"Description": "string",
"LocalizedDescriptions": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"InternalIdentifier": "string",
"Order": "string"
}
],
"Variants": [
{
"ProductId": 0,
"GroupId": 0,
"Label": "string",
"Value": "string"
}
],
"Markets": [
{
"Id": 0,
"ChannelId": "string",
"Name": "string",
"DisplayName": "string",
"Url": "string",
"Currency": "string",
"VatRate": 0,
"MarketPrefix": "string",
"CountryId": 0,
"CurrencyId": 0,
"CurrencyRate": 0,
"LanguageId": 0,
"Language": "string",
"Languages": [
{
"LanguageId": 0,
"Name": "string",
"Code": "string"
}
],
"Countries": [
{
"CountryId": 0,
"Name": "string",
"Code": "string",
"VatRate": 0,
"CurrencyId": 0
}
],
"Currencies": [
{
"Name": "string",
"Code": "string",
"CurrencyId": 0,
"CurrencyRate": 0
}
]
}
],
"Vat": 0,
"PrimaryImage": "string",
"FreightClassId": 0,
"IntrastatCode": "string",
"CountryOfOrigin": "string",
"VariantGroupId": 0,
"VatId": 0,
"ExternalId": "string",
"ActivationDate": "string",
"Feeds": [
{
"FeedId": 0,
"AllowSale": true
}
],
"Urls": [
{
"Url": "string",
"Market": 0,
"Countries": [
"string"
],
"Language": "string"
}
],
"MainCategoryId": 0,
"RelatedProducts": [
{
"ProductId": 0,
"RelatedProductId": 0,
"RelationTypeId": 0
}
],
"DiscountCampaigns": [
{
"CampaignId": "00000000-0000-0000-0000-000000000000",
"CampaignName": "string",
"Title": "string",
"HideTitle": true,
"RuleType": "string",
"Category": "string",
"Enabled": true,
"ValidFrom": "string",
"ValidTo": "string",
"Markets": "string",
"Action": "string",
"ActionValue": "string",
"Quantity": 0,
"Titles": [
{
"LanguageCode": "string",
"Content": "string"
}
],
"Urls": [
{
"LanguageCode": "string",
"Content": "string"
}
]
}
],
"LowestPrice": [
{
"LowestPrice": 0,
"ComparisonPrice": 0,
"MarketId": 0,
"Currency": "string"
}
],
"SortOrder": {
"Default": 0,
"Custom1": 0,
"Custom2": 0,
"Custom3": 0,
"Custom4": 0,
"Custom5": 0
},
"Weight": 0,
"Length": 0,
"Width": 0,
"Height": 0
}
]
},
"Message": "string",
"Details": [
"string"
]
}