All endpoints accept JSON over HTTPS. Put your api_key inside the request body (not a header) and send every request as a POST with Content-Type: application/json. Generate / rotate your key in the seller control panel.
POST.application/json — UTF-8 only.api_key field inside the JSON body.{ "status": "success", ...endpoint-specific... }{ "response": { "failure": { "code": "3", "message": "Invalid Authorization key" } } }Submit one or more orders for fulfillment. Accepts existing `product_id`s or a new-product payload inline. Returns a shiplist ID that groups the orders for batch tracking.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| shipping.fullname required | string | Recipient's full name. |
| shipping.address1 required | string | Street address (must include house number). |
| shipping.address2 optional | string | Apartment / unit number (optional). |
| shipping.city required | string | City. |
| shipping.state required | string | State/province. 2-letter code for US/CA. |
| shipping.zip required | string | Postal/zip code. |
| shipping.country required | string | 2-letter country code (US, CA, GB, …). |
| shipping.phone optional | string | Recipient's phone — required by some carriers. |
| shipping.email optional | string | Recipient's email — used for shipping notifications if your store relay is enabled. |
| order required | array | Single order object OR an array of order objects for batch submission. |
| order[].product_id optional | integer | Existing product ID (from CreateProduct). Omit if supplying `order[].product.*` inline. |
| order[].product.title optional | string | If creating on the fly: product title. |
| order[].product.url optional | string | If creating on the fly: design image URL (HTTPS PNG). |
| order[].size required | string | Size code (S, M, L, XL, 2XL…). |
| order[].color required | string | Colour name. |
| order[].quantity required | integer | Quantity — at least 1. |
| order[].backprint optional | boolean | `true` if back-print artwork was supplied with the product. Default `false`. |
| order[].priority_shipping optional | boolean | Priority lane (costs more, ships in 1–2 business days). |
| order[].comments optional | string | Free-text note passed through to production. |
| order[].market_id1 optional | string | Your internal order ID — stored for reference and returned on GetSellerHistory. |
curl -X POST https://www.tshirtgang.com/api/v2/CreateOrder/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","shipping":{"fullname":"Jane Doe","address1":"123 Main St","city":"Toronto","state":"ON","zip":"M5V 2T6","country":"CA"},"order":[{"product_id":98765,"size":"M","color":"Black","quantity":1}]}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/CreateOrder/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"shipping\":{\"fullname\":\"Jane Doe\",\"address1\":\"123 Main St\",\"city\":\"Toronto\",\"state\":\"ON\",\"zip\":\"M5V 2T6\",\"country\":\"CA\"},\"order\":[{\"product_id\":98765,\"size\":\"M\",\"color\":\"Black\",\"quantity\":1}]}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/CreateOrder/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"shipping": {
"fullname": "Jane Doe",
"address1": "123 Main St",
"city": "Toronto",
"state": "ON",
"zip": "M5V 2T6",
"country": "CA"
},
"order": [
{
"product_id": 98765,
"size": "M",
"color": "Black",
"quantity": 1
}
]
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/CreateOrder/',
json={
"api_key": "YOUR_API_KEY",
"shipping": {
"fullname": "Jane Doe",
"address1": "123 Main St",
"city": "Toronto",
"state": "ON",
"zip": "M5V 2T6",
"country": "CA"
},
"order": [
{
"product_id": 98765,
"size": "M",
"color": "Black",
"quantity": 1
}
]
}
)
print(res.json())
{
"response": {
"success": {
"order_id": "8600000",
"price": "11.00",
"shipping": "4.95",
"tax": "0.00"
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.order_id | string | Our order ID for the created order. |
| response.success.price | string | Item price in USD (excludes shipping and tax). |
| response.success.shipping | string | Shipping cost in USD. |
| response.success.tax | string | Tax charged on the order in USD. |
Retrieve your order history, paginated and filterable by status. Supports single-order lookup by `order_number`. All pagination/filter fields live inside a `filter` wrapper object.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| filter.items_per_page optional | integer | How many items to display per results page. Minimum value `1`. Maximum value `100`. Default value `100`. |
| filter.page optional | integer | Using `items_per_page` tag, configure which page to display. Default value `1`. |
| filter.order_number optional | string | Specify a single order number to retrieve just that order's information. `page` and `items_per_page` are ignored when `order_number` is present. |
| filter.order_status optional | string | Specify the status of the orders you are searching for. Valid statuses: `Unpaid`, `Processing`, `Shipped`. |
curl -X POST https://www.tshirtgang.com/api/v2/GetSellerHistory/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","filter":{"items_per_page":"100","page":"1"}}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/GetSellerHistory/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"filter\":{\"items_per_page\":\"100\",\"page\":\"1\"}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/GetSellerHistory/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"filter": {
"items_per_page": "100",
"page": "1"
}
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/GetSellerHistory/',
json={
"api_key": "YOUR_API_KEY",
"filter": {
"items_per_page": "100",
"page": "1"
}
}
)
print(res.json())
{
"response": {
"success": {
"orders": [
{
"order": {
"order_number": "8615939",
"buyers_name": "Doug Heffernan",
"buyers_address": "519 Longview Ave",
"buyers_address2": "",
"buyers_city": "Cliffside Park",
"buyers_state": "NJ",
"buyers_zip": "07010",
"buyers_country": "United States",
"status": "Shipped",
"product_id": "999912345",
"style": "Classic",
"color": "White",
"size": "Large",
"qty": "1",
"priority_shipping": false,
"price": "10.00",
"price_shipping": "4.95",
"price_tax": "0.00",
"shipping": {
"tracking_number": "100000000123456789",
"courier": "Fedex",
"tracking_link": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=100000000123456789&cntry_code=us&locale=en_US"
}
}
}
]
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.orders | array | Page of order entries. Each entry is wrapped in an `order` object. |
| response.success.orders[].order.order_number | string | Our order ID for the order. |
| response.success.orders[].order.buyers_name | string | Recipient's full name. |
| response.success.orders[].order.buyers_address | string | Recipient street address (line 1). |
| response.success.orders[].order.buyers_address2 | string | Recipient apartment / unit (line 2). Empty string if none. |
| response.success.orders[].order.buyers_city | string | Recipient city. |
| response.success.orders[].order.buyers_state | string | Recipient state/province (2-letter code where applicable). |
| response.success.orders[].order.buyers_zip | string | Recipient postal/zip code. |
| response.success.orders[].order.buyers_country | string | Recipient country (full name). |
| response.success.orders[].order.status | string | Human-readable status (e.g. `Paid`, `Printing`, `Shipped`, `Cancelled`). |
| response.success.orders[].order.product_id | string | Product ID of the ordered SKU. |
| response.success.orders[].order.style | string | Style name (e.g. `Classic`). |
| response.success.orders[].order.color | string | Colour name (e.g. `White`). |
| response.success.orders[].order.size | string | Size name (e.g. `Large`). |
| response.success.orders[].order.qty | string | Quantity ordered. |
| response.success.orders[].order.priority_shipping | boolean | Whether priority shipping was selected. |
| response.success.orders[].order.price | string | Item price in USD. |
| response.success.orders[].order.price_shipping | string | Shipping cost in USD. |
| response.success.orders[].order.price_tax | string | Tax charged on the order in USD. |
| response.success.orders[].order.shipping | object | Tracking object (present once shipped). |
| response.success.orders[].order.shipping.tracking_number | string | Carrier tracking number. |
| response.success.orders[].order.shipping.courier | string | Carrier name (e.g. `Fedex`, `USPS`, `Canada Post`). |
| response.success.orders[].order.shipping.tracking_link | string | Direct link to the carrier tracking page. |
Retrieve the current blank catalogue (style / colour / size combinations) available for printing.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| filter.style optional | string | Style name (e.g. "Gildan 5000") or numeric style ID. |
| filter.color optional | string | Colour name (e.g. "Black"). Partial matches not accepted. |
| filter.size optional | string | Size code (S, M, L, XL, 2XL, 3XL, 4XL, 5XL, 6XL). |
| filter.available optional | boolean | `true` = only in-stock rows, `false` = only unavailable rows. Omit for all. |
curl -X POST https://www.tshirtgang.com/api/v2/GetAvailableProducts/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","filter":{"available":"true"}}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/GetAvailableProducts/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"filter\":{\"available\":\"true\"}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/GetAvailableProducts/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"filter": {
"available": "true"
}
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/GetAvailableProducts/',
json={
"api_key": "YOUR_API_KEY",
"filter": {
"available": "true"
}
}
)
print(res.json())
{
"response": {
"success": {
"products": [
{
"product": {
"style": "Classic",
"color": "Red",
"size": "2 X-Large",
"price": "14.00",
"available": "true"
}
}
]
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.products | array | List of style / colour / size combinations matching the filter. Each entry is wrapped in a `product` object. |
| response.success.products[].product.style | string | Style name (e.g. `Classic`, `Hoodie`). |
| response.success.products[].product.color | string | Colour name (e.g. `Red`). |
| response.success.products[].product.size | string | Size name (e.g. `Large`, `2 X-Large`). |
| response.success.products[].product.price | string | Per-unit price in USD for this SKU. |
| response.success.products[].product.available | string | `"true"` if currently in stock, `"false"` otherwise. |
Create a new product in your catalogue from a design image URL. The product is generated for every size that exists in your Pricing for the chosen style + colour. Sizes are NOT specified in the request — the system uses what you have priced.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| product.title required | string | Product title. Shown on the product page and on invoices/order summaries. |
| product.url required | string | Publicly reachable design image URL (PNG with transparency preferred, minimum 2400×3200 recommended for DTG). Must begin with `https://`. Base64-encoded image data may also be sent in this field. |
| product.style required | string | Style name (e.g. `Classic`, `Apron`, `Hoodie`, `Ladies`, `V-Neck`). Use GetAvailableProducts to list valid style names. |
| product.color required | string | Single colour name (e.g. `Black`, `Navy`, `Heather Grey`). Use GetAvailableProducts to list valid colour names for the chosen style. |
| product.category optional | string | Top-level category that helps organize products on Tshirtgang (e.g. `Various`, `Funny`, `Holiday`). |
| product.custom_category.category optional | string | Custom category name. Max 80 characters. Created on-the-fly if it doesn't already exist for your account. |
curl -X POST https://www.tshirtgang.com/api/v2/CreateProduct/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","product":{"title":"My Product Title T Shirt","url":"https://mywebsite.com/path/to/valid/file.png","style":"Apron","color":"Black","category":"Various","custom_category":{"category":"custom category"}}}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/CreateProduct/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"product\":{\"title\":\"My Product Title T Shirt\",\"url\":\"https://mywebsite.com/path/to/valid/file.png\",\"style\":\"Apron\",\"color\":\"Black\",\"category\":\"Various\",\"custom_category\":{\"category\":\"custom category\"}}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/CreateProduct/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"product": {
"title": "My Product Title T Shirt",
"url": "https://mywebsite.com/path/to/valid/file.png",
"style": "Apron",
"color": "Black",
"category": "Various",
"custom_category": {
"category": "custom category"
}
}
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/CreateProduct/',
json={
"api_key": "YOUR_API_KEY",
"product": {
"title": "My Product Title T Shirt",
"url": "https://mywebsite.com/path/to/valid/file.png",
"style": "Apron",
"color": "Black",
"category": "Various",
"custom_category": {
"category": "custom category"
}
}
}
)
print(res.json())
{
"response": {
"success": {
"product_id": "1234567",
"preview_image": "https://s3.us-east-2.amazonaws.com/path/to/your/image.png"
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.product_id | integer | Product ID — use as `product_id` in CreateOrder. |
| response.success.preview_image | string | CDN URL of the generated mockup preview image. |
Retrieve your product catalogue with pagination and optional filters. All pagination/filter fields live inside a `filter` wrapper object.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| filter.items_per_page required | integer | How many items to display per results page. Minimum value `1`. Maximum value `1000`. Default value `1000`. |
| filter.page required | integer | Using `items_per_page` tag, configure which page to display. Default value `1`. |
| filter.style optional | string | Filter by the style of shirt your product is on. Use GetAvailableProducts to list valid style names. |
| filter.color optional | string | Filter by the shirt colour. Use GetAvailableProducts to list valid colour names. |
| filter.product_id optional | string | Look up a single product from the seller. Only details for this product will be returned. |
| filter.category optional | string | Filter by the top-level category you have organised the product into. |
curl -X POST https://www.tshirtgang.com/api/v2/GetSellerProducts/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","filter":{"items_per_page":"10","page":"1","product_id":"999912345"}}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/GetSellerProducts/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"filter\":{\"items_per_page\":\"10\",\"page\":\"1\",\"product_id\":\"999912345\"}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/GetSellerProducts/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"filter": {
"items_per_page": "10",
"page": "1",
"product_id": "999912345"
}
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/GetSellerProducts/',
json={
"api_key": "YOUR_API_KEY",
"filter": {
"items_per_page": "10",
"page": "1",
"product_id": "999912345"
}
}
)
print(res.json())
{
"response": {
"success": {
"products": [
{
"product": {
"product_id": "999912345",
"title": "My Custom Title",
"style": "Classic",
"color": "Black",
"category": "Various",
"model": "1",
"preview_image": "https://s3.us-east-2.amazonaws.com/path/to/your/image.png"
}
}
]
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.products | array | Page of product entries. Each entry is wrapped in a `product` object. |
| response.success.products[].product.product_id | string | Product ID — use as `product_id` in CreateOrder. |
| response.success.products[].product.title | string | Product title. |
| response.success.products[].product.style | string | Style name (e.g. `Classic`, `Hoodie`). |
| response.success.products[].product.color | string | Shirt colour name (e.g. `Black`). |
| response.success.products[].product.category | string | Top-level category assigned to the product. |
| response.success.products[].product.model | string | Model identifier for the product. |
| response.success.products[].product.preview_image | string | CDN URL of the front mockup preview image. |
Estimated production turnaround (in business days) per style, before shipping. Use this to display "Ships in X days" on your product pages. Returns every style with a recorded latency; pass `filter.style` to scope to one.
| Field | Type | Description |
|---|---|---|
| api_key required | string | Your API key from /cp/api. |
| filter.style optional | string | Style name (e.g. `Classic`, `Hoodie`, `Ladies`). Returns just the matching style. Omit to return every style. |
curl -X POST https://www.tshirtgang.com/api/v2/GetProductLatency/ \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_API_KEY","filter":{"style":"Classic"}}'
<?php
$ch = curl_init('https://www.tshirtgang.com/api/v2/GetProductLatency/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"api_key\":\"YOUR_API_KEY\",\"filter\":{\"style\":\"Classic\"}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$data = json_decode($res, true);
curl_close($ch);
print_r($data);
// Node 18+ (native fetch)
const res = await fetch('https://www.tshirtgang.com/api/v2/GetProductLatency/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"api_key": "YOUR_API_KEY",
"filter": {
"style": "Classic"
}
})
});
const data = await res.json();
console.log(data);
# pip install requests
import requests
res = requests.post(
'https://www.tshirtgang.com/api/v2/GetProductLatency/',
json={
"api_key": "YOUR_API_KEY",
"filter": {
"style": "Classic"
}
}
)
print(res.json())
{
"response": {
"success": {
"products": [
{
"product": {
"style": "Classic",
"style_id": 1,
"latency": 1
}
}
]
}
}
}
| Field | Type | Description |
|---|---|---|
| response.success.products | array | List of latency records. Each entry is wrapped in a `product` object. |
| response.success.products[].product.style | string | Style name. |
| response.success.products[].product.style_id | integer | Internal style ID for the row. |
| response.success.products[].product.latency | integer | Average in-house production time, in business days, excluding shipping. |
/cp/api.