Create many SKUs
curl --request POST \
--url https://server.twicecommerce.com/v1/admin/skus/many \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"code": "<string>",
"taxonomyCategoryId": "<string>",
"purchasePrice": 123,
"description": null,
"binLocation": "<string>",
"bufferTimeAmountBefore": 4503599627370495,
"bufferTimeAmountAfter": 4503599627370495,
"attributes": {}
}
'import requests
url = "https://server.twicecommerce.com/v1/admin/skus/many"
payload = {
"name": "<string>",
"code": "<string>",
"taxonomyCategoryId": "<string>",
"purchasePrice": 123,
"description": None,
"binLocation": "<string>",
"bufferTimeAmountBefore": 4503599627370495,
"bufferTimeAmountAfter": 4503599627370495,
"attributes": {}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
taxonomyCategoryId: '<string>',
purchasePrice: 123,
description: null,
binLocation: '<string>',
bufferTimeAmountBefore: 4503599627370495,
bufferTimeAmountAfter: 4503599627370495,
attributes: {}
})
};
fetch('https://server.twicecommerce.com/v1/admin/skus/many', 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://server.twicecommerce.com/v1/admin/skus/many",
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>',
'code' => '<string>',
'taxonomyCategoryId' => '<string>',
'purchasePrice' => 123,
'description' => null,
'binLocation' => '<string>',
'bufferTimeAmountBefore' => 4503599627370495,
'bufferTimeAmountAfter' => 4503599627370495,
'attributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://server.twicecommerce.com/v1/admin/skus/many"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://server.twicecommerce.com/v1/admin/skus/many")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.twicecommerce.com/v1/admin/skus/many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}Bulk-creates SKUs from an array of the same shape as a single create. Use this to import SKU definitions; validate SKU codes for uniqueness first via the validate-codes endpoint.
POST
/
v1
/
admin
/
skus
/
many
Create many SKUs
curl --request POST \
--url https://server.twicecommerce.com/v1/admin/skus/many \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"code": "<string>",
"taxonomyCategoryId": "<string>",
"purchasePrice": 123,
"description": null,
"binLocation": "<string>",
"bufferTimeAmountBefore": 4503599627370495,
"bufferTimeAmountAfter": 4503599627370495,
"attributes": {}
}
'import requests
url = "https://server.twicecommerce.com/v1/admin/skus/many"
payload = {
"name": "<string>",
"code": "<string>",
"taxonomyCategoryId": "<string>",
"purchasePrice": 123,
"description": None,
"binLocation": "<string>",
"bufferTimeAmountBefore": 4503599627370495,
"bufferTimeAmountAfter": 4503599627370495,
"attributes": {}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
taxonomyCategoryId: '<string>',
purchasePrice: 123,
description: null,
binLocation: '<string>',
bufferTimeAmountBefore: 4503599627370495,
bufferTimeAmountAfter: 4503599627370495,
attributes: {}
})
};
fetch('https://server.twicecommerce.com/v1/admin/skus/many', 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://server.twicecommerce.com/v1/admin/skus/many",
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>',
'code' => '<string>',
'taxonomyCategoryId' => '<string>',
'purchasePrice' => 123,
'description' => null,
'binLocation' => '<string>',
'bufferTimeAmountBefore' => 4503599627370495,
'bufferTimeAmountAfter' => 4503599627370495,
'attributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://server.twicecommerce.com/v1/admin/skus/many"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://server.twicecommerce.com/v1/admin/skus/many")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.twicecommerce.com/v1/admin/skus/many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"taxonomyCategoryId\": \"<string>\",\n \"purchasePrice\": 123,\n \"description\": null,\n \"binLocation\": \"<string>\",\n \"bufferTimeAmountBefore\": 4503599627370495,\n \"bufferTimeAmountAfter\": 4503599627370495,\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}Authorizations
API key for the Twice API
Body
application/json
Body
Minimum string length:
1Minimum string length:
1Required range:
0 <= x <= 9007199254740991Available options:
seconds, minutes, hours, days, weeks, months, years Required range:
0 <= x <= 9007199254740991Available options:
seconds, minutes, hours, days, weeks, months, years Was this page helpful?