글로벌링크 상품 재고/품절 업데이트
curl --request POST \
--url https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"shopProductId": "product-001",
"stockQuantity": 250,
"isSoldOut": false,
"productOption": [
{
"shopOptionId": "opt-001",
"stockQuantity": 50
}
]
}
]
}
'import requests
url = "https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates"
payload = { "products": [
{
"shopProductId": "product-001",
"stockQuantity": 250,
"isSoldOut": False,
"productOption": [
{
"shopOptionId": "opt-001",
"stockQuantity": 50
}
]
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
products: [
{
shopProductId: 'product-001',
stockQuantity: 250,
isSoldOut: false,
productOption: [{shopOptionId: 'opt-001', stockQuantity: 50}]
}
]
})
};
fetch('https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates', 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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates",
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([
'products' => [
[
'shopProductId' => 'product-001',
'stockQuantity' => 250,
'isSoldOut' => false,
'productOption' => [
[
'shopOptionId' => 'opt-001',
'stockQuantity' => 50
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates"
payload := strings.NewReader("{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"successCount": 98,
"failureCount": 2,
"failures": [
{
"shopProductId": "product-001",
"errorCode": "INVALID_PRICE",
"message": "할인가가 원가보다 큽니다"
}
]
}상품 API
상품 재고 수정
상품 재고 수정 API 입니다. 상품의 재고 수량과 품절 여부를 Bulk로 갱신합니다. 1회 요청 시 1~100건까지 처리합니다. 상품에 옵션이 있는 경우 productOption[]으로 옵션별 재고도 함께 갱신할 수 있습니다.
응답은 부분 성공 모델입니다.
- successCount: 갱신 성공한 상품 수
- failureCount: 실패한 상품 수
- failures[]: 실패한 상품별 상세 (shopProductId, errorCode, message) 실패가 있어도 HTTP 200으로 응답하므로, 클라이언트는 failures[]를 반드시 확인해야 합니다.
POST
/
open-api
/
v1
/
global-link
/
products
/
stock-updates
글로벌링크 상품 재고/품절 업데이트
curl --request POST \
--url https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"shopProductId": "product-001",
"stockQuantity": 250,
"isSoldOut": false,
"productOption": [
{
"shopOptionId": "opt-001",
"stockQuantity": 50
}
]
}
]
}
'import requests
url = "https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates"
payload = { "products": [
{
"shopProductId": "product-001",
"stockQuantity": 250,
"isSoldOut": False,
"productOption": [
{
"shopOptionId": "opt-001",
"stockQuantity": 50
}
]
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
products: [
{
shopProductId: 'product-001',
stockQuantity: 250,
isSoldOut: false,
productOption: [{shopOptionId: 'opt-001', stockQuantity: 50}]
}
]
})
};
fetch('https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates', 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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates",
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([
'products' => [
[
'shopProductId' => 'product-001',
'stockQuantity' => 250,
'isSoldOut' => false,
'productOption' => [
[
'shopOptionId' => 'opt-001',
'stockQuantity' => 50
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates"
payload := strings.NewReader("{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gw-staging.delivered.co.kr/global-ship/open-api/v1/global-link/products/stock-updates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"products\": [\n {\n \"shopProductId\": \"product-001\",\n \"stockQuantity\": 250,\n \"isSoldOut\": false,\n \"productOption\": [\n {\n \"shopOptionId\": \"opt-001\",\n \"stockQuantity\": 50\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"successCount": 98,
"failureCount": 2,
"failures": [
{
"shopProductId": "product-001",
"errorCode": "INVALID_PRICE",
"message": "할인가가 원가보다 큽니다"
}
]
}Authorizations
발급받은 시크릿 키
Body
application/json
재고 갱신 대상 상품 목록 (1회 요청당 1~100건)
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
⌘I