API reference
Library
Search the dropshipping product library and import pieces into the shop.
Search the product library
/api/v1/library
Searches the dropshipping library of supplier products a shop can import and sell. Each result has its cost, suggested retail price, margin, supplier, and ship time, and says whether this shop already imported it.
- Scope
- MCP tool
- library_search
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
qquery · optional | string | Words to match in the title or description |
categoryquery · optional | enum | A library category, e.g. `apparel` or `kitchen` |
supplierquery · optional | enum | Only products from this supplier |
max_costquery · optional | number | Highest supplier cost in USD, before shipping |
ship_days_maxquery · optional | integer | Arrives within this many days |
polished_onlyquery · optional | boolean | Only products whose listing copy has been polished and reviewed. Defaults to true |
sortquery · optional | enum | Best `margin` first, `newest`, lowest `price`, or most `popular` with other shops |
limitquery · optional | integer | Results per page, 1-100 |
cursorquery · optional | string | The `next_cursor` from the previous page |
Request
curl "https://3commerce.com/api/v1/library" \
-H "Authorization: Bearer 3c_live_…"Response
{
"data": [
{
"id": "9a3d6f20-1c4e-4b8a-a7f2-5e0c9d8b1a64",
"title": "Heavyweight organic tee",
"supplier": "printful",
"supplier_name": "Printful",
"category": "apparel",
"cost": 14.25,
"shipping_cost": 4.75,
"suggested_price": 38,
"margin": 19,
"margin_rate": 0.5,
"image": {
"src": "https://files.cdn.printful.com/tee.jpg",
"alt": "Heavyweight organic tee",
"width": 1200,
"height": 1200
},
"ship_days_min": 3,
"ship_days_max": 7,
"polished": true,
"imported": false
}
],
"next_cursor": "MjU"
}Get a library product
/api/v1/library/{id}
One library product in full: description, selling points, every photo and variant with its cost, shipping, and margin. `imported_product_id` is set when this shop already sells it.
- Scope
- MCP tool
- library_get
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
Request
curl "https://3commerce.com/api/v1/library/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
-H "Authorization: Bearer 3c_live_…"Response
{
"id": "9a3d6f20-1c4e-4b8a-a7f2-5e0c9d8b1a64",
"title": "Heavyweight organic tee",
"supplier": "printful",
"supplier_name": "Printful",
"category": "apparel",
"cost": 14.25,
"shipping_cost": 4.75,
"suggested_price": 38,
"margin": 19,
"margin_rate": 0.5,
"image": {
"src": "https://files.cdn.printful.com/tee.jpg",
"alt": "Heavyweight organic tee",
"width": 1200,
"height": 1200
},
"ship_days_min": 3,
"ship_days_max": 7,
"polished": true,
"imported": false,
"description": "A boxy, heavyweight tee in 100% organic cotton.",
"bullets": [
"220 gsm organic cotton",
"Garment dyed",
"Printed on demand"
],
"tags": [
"tee",
"organic"
],
"store_category_slug": "mens-tops",
"compare_at_price": null,
"ship_from": "US",
"images": [
{
"src": "https://files.cdn.printful.com/tee.jpg",
"alt": "Heavyweight organic tee",
"width": 1200,
"height": 1200
}
],
"variants": [
{
"id": "4012",
"name": "Black / M",
"color": "Black",
"color_hex": "#111111",
"size": "M",
"cost": 14.25,
"in_stock": true
}
],
"imports": 12,
"source_url": "https://www.printful.com/custom/mens/t-shirts",
"imported_product_id": null
}Import a library product
/api/v1/library/{id}/import
Copies a library product into the shop as a draft product, with its title, description, selling points, photos, and tags. Review it, then publish it with `products.publish`. Refused when this shop already imported it.
- Scope
- MCP tool
- library_import
- Changes data
- Yes
- Idempotency-Key
- Accepted
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
pricebody · optional | number | Retail price in USD. Defaults to the suggested price |
category_slugbody · optional | enum | A storefront category from `products.categories`. Defaults to the library's suggestion |
Request
curl -X POST "https://3commerce.com/api/v1/library/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c/import" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{}'Response
{
"id": "5f1c2a9e-8d3b-4f61-9a0e-2b7c4d1e6f80",
"slug": "heavyweight-organic-tee",
"title": "Heavyweight organic tee",
"status": "draft",
"price": 38,
"category_slug": "mens-tops",
"stock": 999,
"source": "library",
"library_product_id": "9a3d6f20-1c4e-4b8a-a7f2-5e0c9d8b1a64",
"storefront_url": null
}