cURL
curl --request GET \ --url https://api.example.com/api/v1/garments
{ "garments": [ { "id": "<string>", "name": "<string>", "brand": "<string>", "category": "<string>", "basePrice": 123, "currency": "<string>", "colors": [ {} ], "sizes": [ {} ], "printZones": [ {} ], "images": {} } ], "pagination": { "hasMore": true, "nextCursor": "<string>" } }
Browse available garment blanks
GET https://garmint.app/api/v1/garments
t-shirts
hoodies
tanks
long-sleeves
Show Garment properties
Show Pagination properties
curl https://garmint.app/api/v1/garments?category=t-shirts&limit=10 \ -H "Authorization: Bearer gm_live_xxx"
{ "garments": [ { "id": "gildan-5000", "name": "Gildan 5000 Heavy Cotton Tee", "brand": "Gildan", "category": "t-shirts", "basePrice": 12.99, "currency": "USD", "colors": [ { "name": "Black", "hex": "#000000", "imageUrl": "https://cdn.shopify.com/.../black.png", "available": true }, { "name": "White", "hex": "#FFFFFF", "imageUrl": "https://cdn.shopify.com/.../white.png", "available": true } ], "sizes": ["S", "M", "L", "XL", "2XL"], "printZones": [ { "id": "front", "name": "Front", "maxWidth": 12, "maxHeight": 14, "position": { "x": 50, "y": 35 } }, { "id": "back", "name": "Back", "maxWidth": 12, "maxHeight": 14, "position": { "x": 50, "y": 35 } } ], "images": { "thumbnail": "https://cdn.shopify.com/.../thumb.png", "full": "https://cdn.shopify.com/.../full.png" } } ], "pagination": { "hasMore": true, "nextCursor": "eyJsYXN0SWQiOiJnaWxkYW4tNTAwMCJ9" } }
async function getAllGarments() { const garments = []; let cursor: string | undefined; do { const url = new URL('https://garmint.app/api/v1/garments'); url.searchParams.set('limit', '100'); if (cursor) url.searchParams.set('cursor', cursor); const response = await fetch(url, { headers: { 'Authorization': `Bearer ${API_KEY}` }, }); const data = await response.json(); garments.push(...data.garments); cursor = data.pagination.hasMore ? data.pagination.nextCursor : undefined; } while (cursor); return garments; }
GET https://garmint.app/api/v1/garments/:id
curl https://garmint.app/api/v1/garments/gildan-5000 \ -H "Authorization: Bearer gm_live_xxx"