Product
Update product purchase prices (batch)
Update product purchase price for multiple products. Maximum 10000 products can be updated in one call.
Parameters for "Update product purchase prices (batch)"
PUT/API/Product/PurchasePrice
Request Example
curl -X PUT 'https://mgmtapi.geins.io/API/Product/PurchasePrice' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]' \
-H 'X-ApiKey: {MGMT_API_KEY}'\
-d '[
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
]'
import axios from 'axios';
const config = {
method: 'PUT',
url: 'https://mgmtapi.geins.io/API/Product/PurchasePrice',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
data: [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
]
};
axios.request(config)
.then(response => response.data)
.catch(error => console.error(error));
fetch('https://mgmtapi.geins.io/API/Product/PurchasePrice', {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
body: JSON.stringify([
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
])
})
.then(res => res.json())
.then((response) => response)
.catch(console.error);
import requests
url = "https://mgmtapi.geins.io/API/Product/PurchasePrice"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
payload = [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
]
response = requests.PUT(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://mgmtapi.geins.io/API/Product/PurchasePrice"
payload := []byte(`[
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
]`)
req, _ := http.NewRequest("PUT", 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[]
{
new
{
Id = "string",
PurchasePrice = 0,
PurchasePriceCurrency = "string"
}
};
var jsonContent = JsonSerializer.Serialize(body);
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
var response = await client.PUTAsync("https://mgmtapi.geins.io/API/Product/PurchasePrice", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Response
{
"Message": "string",
"Invalid": [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
],
"NotFound": [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
],
"UpdateCount": 0
}
{
"Message": "string",
"Invalid": [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
],
"NotFound": [
{
"Id": "string",
"PurchasePrice": 0,
"PurchasePriceCurrency": "string"
}
],
"UpdateCount": 0
}