Ship Toolkit API
호스팅된 라벨 및 PDF 엔드포인트는 HTTPS를 통해 JSON을 받고 생성된 PDF 파일을 직접 반환합니다. API 키는 소스 코드에 넣지 말고 bearer 토큰으로 보내세요.
빠른 시작
기본 URLhttps://shiptoolkit.com
메서드POST 호스팅 생성 API용
인증Authorization: Bearer <api-key>
본문Content-Type: application/json
멱등성Idempotency-Key: <unique value>
성공application/pdf 라벨 및 PDF API용
호스팅된 라벨 및 PDF API에는 API 키가 필요합니다. 액세스를 요청하려면 다음으로 문의하세요:
shiptoolkit@element-express.com.
성공한 PDF 응답에는 Content-Disposition, X-Page-Count,
X-Content-SHA256 및 다음 중 하나가 포함됩니다: X-Label-Type 또는 X-PDF-Operation. 오류 응답은 다음 필드가 있는 JSON입니다: error .
Python 도우미
import base64
import json
import os
import uuid
import urllib.request
from pathlib import Path
BASE_URL = "https://shiptoolkit.com"
API_KEY = os.environ["SHIPTOOLKIT_API_KEY"]
def post_pdf(path, payload, output_file):
request = urllib.request.Request(
BASE_URL + path,
data=json.dumps(payload).encode("utf-8"),
method="POST",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
"User-Agent": "ShipToolkit-API-Example/1.0",
},
)
with urllib.request.urlopen(request, timeout=60) as response:
pdf = response.read()
if not pdf.startswith(b"%PDF-"):
raise RuntimeError("Ship Toolkit returned a non-PDF response.")
Path(output_file).write_bytes(pdf)
def pdf_base64(filename):
return base64.b64encode(Path(filename).read_bytes()).decode("ascii")
Java 도우미
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import java.util.UUID;
class ShipToolkitApi {
static final String BASE_URL = "https://shiptoolkit.com";
static final String API_KEY = System.getenv("SHIPTOOLKIT_API_KEY");
static final HttpClient CLIENT = HttpClient.newHttpClient();
static void postPdf(String path, String json, Path outputFile)
throws IOException, InterruptedException {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(BASE_URL + path))
.header("Authorization", "Bearer " + API_KEY)
.header("Content-Type", "application/json")
.header("Idempotency-Key", UUID.randomUUID().toString())
.header("User-Agent", "ShipToolkit-API-Example/1.0")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<byte[]> response = CLIENT.send(
request,
HttpResponse.BodyHandlers.ofByteArray()
);
if (response.statusCode() != 200) {
throw new IOException("Ship Toolkit API failed: " + response.statusCode());
}
Files.write(outputFile, response.body());
}
static String pdfBase64(Path file) throws IOException {
return Base64.getEncoder().encodeToString(Files.readAllBytes(file));
}
}
라벨 API
이 엔드포인트는 PDF 라벨 파일을 반환하며 bearer API 키가 필요합니다.
POST /v1/labels/amazon-fnsku
10자 FNSKU로 Amazon 상품 라벨을 만듭니다.
- 필수 필드
sku, model, title, madeIn, labelSize
- 선택 필드
oldSku, productCondition
Python
payload = {
"sku": "X001ABC123",
"model": "ABC-123",
"title": "Sample product",
"madeIn": "China",
"productCondition": "new",
"labelSize": "2.25x1.25",
"oldSku": "OLD-123",
}
post_pdf("/v1/labels/amazon-fnsku", payload, "amazon-fnsku.pdf")
Java
String json = """
{
"sku": "X001ABC123",
"model": "ABC-123",
"title": "Sample product",
"madeIn": "China",
"productCondition": "new",
"labelSize": "2.25x1.25",
"oldSku": "OLD-123"
}
""";
ShipToolkitApi.postPdf(
"/v1/labels/amazon-fnsku",
json,
Path.of("amazon-fnsku.pdf")
);
POST /v1/labels/walmart-sku
14자리 Walmart SKU로 Walmart fulfillment 상품 라벨을 만듭니다.
- 필수 필드
sku, model, title, madeIn, labelSize
- 검증
sku 정확히 14자리여야 합니다.
Python
payload = {
"sku": "12345678901234",
"model": "ShipToolkit-001",
"title": "Walmart fulfillment label",
"madeIn": "China",
"productCondition": "new",
"labelSize": "2.25x1.25",
}
post_pdf("/v1/labels/walmart-sku", payload, "walmart-sku.pdf")
Java
String json = """
{
"sku": "12345678901234",
"model": "ShipToolkit-001",
"title": "Walmart fulfillment label",
"madeIn": "China",
"productCondition": "new",
"labelSize": "2.25x1.25"
}
""";
ShipToolkitApi.postPdf(
"/v1/labels/walmart-sku",
json,
Path.of("walmart-sku.pdf")
);
POST /v1/labels/outbound-box
박스 바코드와 품목 요약이 포함된 간결한 출고 박스 라벨을 만듭니다.
- 필수 필드
boxId, organization, items
- 선택 필드
dimension, weight, labelSize
Python
payload = {
"boxId": "BOX-1001",
"organization": "Example Seller",
"dimension": "20 x 10 x 8 in",
"weight": "15 lbs",
"labelSize": "2.25x1.25",
"items": [
{"sku": "X001ABC123", "quantity": 4},
{"sku": "X001ABC456", "quantity": 2},
],
}
post_pdf("/v1/labels/outbound-box", payload, "outbound-box.pdf")
Java
String json = """
{
"boxId": "BOX-1001",
"organization": "Example Seller",
"dimension": "20 x 10 x 8 in",
"weight": "15 lbs",
"labelSize": "2.25x1.25",
"items": [
{"sku": "X001ABC123", "quantity": 4},
{"sku": "X001ABC456", "quantity": 2}
]
}
""";
ShipToolkitApi.postPdf(
"/v1/labels/outbound-box",
json,
Path.of("outbound-box.pdf")
);
POST /v1/labels/carton-mark
각 카톤마다 한 페이지씩 카톤 마크 라벨을 만듭니다.
- 필수 필드
consignee, shipper, destinationAddress, orderNo, cartonTotal, quantity, productDescription
- 선택 필드
labelSize, barcodeValue, cartonStart
Python
payload = {
"consignee": "Receiving Team",
"shipper": "Example Seller",
"destinationAddress": "123 Warehouse Way, Newark, DE 19713",
"orderNo": "PO-20260717-001",
"cartonTotal": 3,
"quantity": "50 PCS",
"productDescription": "Portable night light",
"labelSize": "6x4",
}
post_pdf("/v1/labels/carton-mark", payload, "carton-mark.pdf")
Java
String json = """
{
"consignee": "Receiving Team",
"shipper": "Example Seller",
"destinationAddress": "123 Warehouse Way, Newark, DE 19713",
"orderNo": "PO-20260717-001",
"cartonTotal": 3,
"quantity": "50 PCS",
"productDescription": "Portable night light",
"labelSize": "6x4"
}
""";
ShipToolkitApi.postPdf(
"/v1/labels/carton-mark",
json,
Path.of("carton-mark.pdf")
);
POST /v1/labels/transparency
FNSKU, 모델, 날짜, 대상 라벨 크기로 Amazon Transparency 라벨 PDF를 맞춤 설정합니다.
- 필수 필드
pdfBase64, fnsku, labelSize
- 선택 필드
model, date
Python
payload = {
"pdfBase64": pdf_base64("transparency-source.pdf"),
"fnsku": "X001ABC123",
"model": "MODEL-1",
"date": "2026-07-17",
"labelSize": "2.25x1.25",
}
post_pdf("/v1/labels/transparency", payload, "transparency.pdf")
Java
String source = ShipToolkitApi.pdfBase64(Path.of("transparency-source.pdf"));
String json = """
{
"pdfBase64": "%s",
"fnsku": "X001ABC123",
"model": "MODEL-1",
"date": "2026-07-17",
"labelSize": "2.25x1.25"
}
""".formatted(source);
ShipToolkitApi.postPdf(
"/v1/labels/transparency",
json,
Path.of("transparency.pdf")
);
PDF API
이 엔드포인트는 변환된 PDF 파일을 반환하며 bearer API 키가 필요합니다.
POST /v1/pdf/resize
원본 내용을 자르지 않고 모든 페이지를 사전 설정 또는 사용자 지정 페이지 크기로 조정합니다.
- 필수 필드
pdfBase64
- 선택 필드
filename, size, orientation, customWidth, customHeight, customUnit
Python
payload = {
"pdfBase64": pdf_base64("source.pdf"),
"filename": "source.pdf",
"size": "custom",
"customWidth": 2.25,
"customHeight": 1.25,
"customUnit": "in",
}
post_pdf("/v1/pdf/resize", payload, "resized.pdf")
Java
String source = ShipToolkitApi.pdfBase64(Path.of("source.pdf"));
String json = """
{
"pdfBase64": "%s",
"filename": "source.pdf",
"size": "custom",
"customWidth": 2.25,
"customHeight": 1.25,
"customUnit": "in"
}
""".formatted(source);
ShipToolkitApi.postPdf("/v1/pdf/resize", json, Path.of("resized.pdf"));
POST /v1/pdf/scale
각 페이지 크기는 유지한 채 페이지 내용을 중심 기준으로 배율 조정합니다.
- 필수 필드
pdfBase64
- 선택 필드
filename, scalePercent 부터 1 까지 400
Python
payload = {
"pdfBase64": pdf_base64("source.pdf"),
"filename": "source.pdf",
"scalePercent": 82,
}
post_pdf("/v1/pdf/scale", payload, "scaled.pdf")
Java
String source = ShipToolkitApi.pdfBase64(Path.of("source.pdf"));
String json = """
{
"pdfBase64": "%s",
"filename": "source.pdf",
"scalePercent": 82
}
""".formatted(source);
ShipToolkitApi.postPdf("/v1/pdf/scale", json, Path.of("scaled.pdf"));