商品API

「Products」APIリソースを使用すれば、 手動注文/APIプラットフォームでショップでの商品を作成、変更、削除することができます。Printfulショップの作成は「アカウント管理」→「ショップ」からできます。

Printfulショップとの連携はShopify、WooCommerceやその他の対応ECサイト連携である場合、商品やバリエーションを設定するにはこちらをご確認ください: Ecommerce Platform Sync API.

倉庫商品の管理のAPIについてはこちらをご確認ください: Warehouse Products API.

基本

Printfulのショップに追加されている各商品に少なくとも一つ以上のバリエーションを指定する必要があります。具体的な例にすると、あるTシャツの「赤、S」、「赤、M」と「青、XL」はそのTシャツの同期バリエーションです。

各商品に指定するべきプロパティは、Printfulの商品カタログからのバリエーション(そのVariant ID)と、デザインデータです。この2つのプロパティおよび価格と外部ID、この4つの組み合わせが同期バリエーション(ショップでの商品バリエーション)を購入可能にします。

こちらのAPIガイドページ、またはアカウント管理の画面などでは、ショップでの商品は「同期商品」と呼ばれ、その商品のバリエーションは「同期バリエーション」と呼ばれます。

空白の商品バリエーションの割り当て

Printfulにはブランクの商品とそのバリエーションの充実したカタログがあり、それぞれのバリエーション(特定の商品のサイズと色の組み合わせなど)には一意のIDがあります。当社はこれを variant_id と呼びます。<?=Html::a('Printful Catalog API', '/docs/catalog')?> でカタログを閲覧し、 特定の variant_id を検索できます。さらに、Printfulショップで同期商品を作成する場合、同期バリエーションのそれぞれを、Printfulカタログの variant_id に関連付ける必要があります。また、特定の variant_id を特定の同期バリエーションに割り当てるにはHTTPリクエストボディに追加します(特定のエンドポイントの例を参照)。

1つのデザインデータを割り当てる

デザインデータを同期バリアントに割り当てるには2つの方法があります。 1つは、ファイルが許可されたストアのファイルライブラリにすでに存在する場合はファイルIDを指定することです。

 
 { 
 ... 
 "ファイル":[ 
 { 
 "ID":12345 
 } 
 ]、 
 ... 
 } 
 

2番目に便利な方法はファイルのURLを指定することです。同じURLのファイルがすでに存在する場合は、それが再利用されます。

 
 { 
 ... 
 "ファイル":[ 
 { 
 "URL": "http://example.com/t-shirts/123/front.pdf" 
 } 
 ]、 
 ... 
 } 
 

さらに、各同期バリアントは、1つまたは複数のデザインデータとリンクさせる必要があります。各商品で利用可能なファイルの種類は、Printful Catalog APIから入手できます。 type 属性を指定して、種類ごとにファイルを1つ追加できます。 デフォルトタイプの場合、この属性はスキップできます。

 
 ... 
 "ファイル":[ 
 { 
 "タイプ": "デフォルト"、 
 "URL": "http://example.com/t-shirts/123/front.pdf" 
 、 
 { 
 "タイプ": "バック" 
 "URL": "http://example.com/t-shirts/123/back.pdf" 
 } 
 ]、 
 ... 
 

追加ファイルを使用すると商品の価格が上がる可能性があることを忘れないでください。

外部ID

同期商品や同期バリエーションを作成する際に外部IDを指定することができます。外部IDは同期商品または同期バリエーションの管理に使用できます。同期商品や同期バリエーションの特定のリクエストURLに指定可能なIDはPrintful ID、または先頭に@記号付けの外部IDです。

Get a list of Sync Products

GET https://api.printful.com/store/products

Returns a list of Sync Product objects from your custom Printful store.
Input parameters:
status string Filter by item status (synced/unsynced/all). If only some of the variants are synced,the product is returned by both unsynced and synced filters
search string Product search needle
offset integer Result set offset
limit integer Number of items per page (max 100)
レスポンス形式:
code integer ステータスコードのレスポンス 200
result SyncProduct [ ]
id integer Sync Product ID
external_id string Product ID from the Ecommerce platform
name string Product name
variants integer Total number of Sync Variants belonging to this product
synced integer Number of synced Sync Variants belonging to this product
thumbnail_url string Thumbnail image for the product
paging Paging Paging information
total integer 利用可能なアイテム総数
offset integer Current result set page offset
limit integer ページに表示する最大アイテム数
APIキー
status Filter by item status (synced/unsynced/all). If only some of the variants are synced,the product is returned by both unsynced and synced filters
search Product search needle
offset Result set offset
limit Number of items per page (max 100)
Execute
Response data:
    {
        "code": 200,
        "result": [
            {
                "id": 79348721,
                "external_id": "e9460f6c67",
                "name": "API product",
                "variants": 2,
                "synced": 2
            }
        ],
        "extra": [],
        "paging": {
            "total": 1,
            "offset": 0,
            "limit": 20
        },
        "debug": []
    }

Create a new Sync Product

POST https://api.printful.com/store/products

Creates a new Sync Product together with its Sync Variants
Input parameters:
Request body RequestProductBody POST request body
sync_product RequestProduct Information about the Sync Product
external_id string Product ID from your Ecommerce platform
name string Product name
thumbnail string Thumbnail image URL. Although we do not limit thumbnail image size, we recommend to keep it reasonably small.
sync_variants RequestVariant [ ] Information about the Sync Variants
external_id string Variant ID from the Ecommerce platform
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
files RequestFile [ ] Array of attached print files
type string Role of the file in the order
id integer File ID

* Required if no URL given
url string Source URL where the file is downloaded from

* Required if no File ID given
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
レスポンス形式:
code integer ステータスコードのレスポンス 200
result RequestProductResponse
id integer Sync Product id
external_id string Sync Product ID from the external system
name string Sync Product name
variants integer Total number of variants in Sync Product
synced integer Total number of Sync variants in Sync Product
APIキー
Request body
Execute
Request body:
    {
        "sync_product": {
            "name": "API product Bella",
            "thumbnail": "https://example.com/image.jpg"
        },
        "sync_variants": [
            {
                "retail_price": "21.00",
                "variant_id": 4011,
                "files": [
                    {
                        "url": "https://example.com/image.jpg"
                    },
                    {
                        "type": "back",
                        "url": "https://example.com/image.jpg"
                    }
                ]
            },
            {
                "retail_price": "21.00",
                "variant_id": 4012,
                "files": [
                    {
                        "url": "https://example.com/image.jpg"
                    },
                    {
                        "type": "back",
                        "url": "https://example.com/image.jpg"
                    }
                ]
            }
        ]
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 79348732,
            "external_id": "5bd9947c709b34",
            "name": "API product Bella",
            "variants": 2,
            "synced": 2
        },
        "extra": [],
        "debug": []
    }

Get information about a single Sync Product and its Sync Variants

GET https://api.printful.com/store/products/{id}

Returns information about an existing Sync Product together with a list of its Sync Variants.
Input parameters:
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
レスポンス形式:
code integer ステータスコードのレスポンス 200
result SyncProductInfo
sync_product SyncProduct Information about the selected product
id integer Sync Product ID
external_id string Product ID from the Ecommerce platform
name string Product name
variants integer Total number of Sync Variants belonging to this product
synced integer Number of synced Sync Variants belonging to this product
thumbnail_url string Thumbnail image for the product
sync_variants SyncVariant [ ] Array of Sync Variants available for the selected product
id integer Sync Variant ID
external_id string Variant ID from the Ecommerce platform
sync_product_id integer Sync Product ID that this variant belongs to
name string Sync Variant name
synced boolean Indicates if this Sync Variant is properly linked with Printful product
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
currency string Currency in which prices are returned
product ProductVariant Short information about the Printful Product and Variant that this Sync Variant is synced to
variant_id integer Variant ID
product_id integer Product ID of this variant
image string URL of a sample image for this variant
name string Display name of this variant
files File [ ] Array of attached printfiles / preview images
id integer File ID
type string Role of the file in the order
hash string MD5 checksum of the file
url string Source URL where the file is downloaded from
filename string File name
mime_type string MIME type of the file
size integer Size in bytes
width integer Width in pixels
height integer Height in pixels
dpi integer Resolution DPI.
Note: for vector files this may be indicated as only 72dpi, but it doesn't affect print quality since the vector files are resolution independent.
status string File processing status:
ok - file was processed successfuly
waiting - file is being processed
failed - file failed to be processed
created timestamp File creation time
thumbnail_url string Small thumbnail URL
preview_url string Medium preview image URL
visible boolean Show file in the Printfile Library (default true)
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
APIキー
id Sync Product ID (integer) or External ID (if prefixed with @)
Execute
Response data:
    {
        "code": 200,
        "result": {
            "sync_product": {
                "id": 79348721,
                "external_id": "e9460f6c67",
                "name": "API product",
                "variants": 2,
                "synced": 2
            },
            "sync_variants": [
                {
                    "id": 866914574,
                    "external_id": "5bd967595a1174",
                    "sync_product_id": 79348721,
                    "name": "API product",
                    "synced": true,
                    "variant_id": 4011,
                    "retail_price": "18.00",
                    "currency": "USD",
                    "product": {
                        "variant_id": 4011,
                        "product_id": 71,
                        "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                        "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
                    },
                    "files": [
                        {
                            "id": 76564075,
                            "type": "default",
                            "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                            "url": "https://picsum.photos/200/300",
                            "filename": "76564075.jpg",
                            "mime_type": "image/jpeg",
                            "size": 8245,
                            "width": 200,
                            "height": 300,
                            "dpi": null,
                            "status": "ok",
                            "created": 1539341673,
                            "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                            "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                            "visible": true
                        },
                        {
                            "id": 76564075,
                            "type": "back",
                            "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                            "url": "https://picsum.photos/200/300",
                            "filename": "76564075.jpg",
                            "mime_type": "image/jpeg",
                            "size": 8245,
                            "width": 200,
                            "height": 300,
                            "dpi": null,
                            "status": "ok",
                            "created": 1539341673,
                            "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                            "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                            "visible": true
                        }
                    ],
                    "options": [
                        {
                            "id": "embroidery_type",
                            "value": "flat"
                        },
                        {
                            "id": "thread_colors",
                            "value": []
                        },
                        {
                            "id": "thread_colors_3d",
                            "value": []
                        },
                        {
                            "id": "thread_colors_chest_left",
                            "value": []
                        }
                    ]
                },
                {
                    "id": 866914580,
                    "external_id": "5bd96ea4a381f8",
                    "sync_product_id": 79348721,
                    "name": "API product",
                    "synced": true,
                    "variant_id": 4011,
                    "retail_price": "21.00",
                    "currency": "USD",
                    "product": {
                        "variant_id": 4011,
                        "product_id": 71,
                        "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                        "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
                    },
                    "files": [
                        {
                            "id": 76564390,
                            "type": "default",
                            "hash": "77440392f60d2346a1bf690c1564d973",
                            "url": "https://i.etsystatic.com/17947654/r/il/3a0750/1565927694/il_570xN.1565927694_gfxu.jpg",
                            "filename": "il_570xN.1565927694_gfxu.jpg",
                            "mime_type": "image/jpeg",
                            "size": 70053,
                            "width": 570,
                            "height": 570,
                            "dpi": null,
                            "status": "ok",
                            "created": 1540982496,
                            "thumbnail_url": "https://s3.dev.printful.com/files/774/77440392f60d2346a1bf690c1564d973_thumb.png",
                            "preview_url": "https://s3.dev.printful.com/files/774/77440392f60d2346a1bf690c1564d973_preview.png",
                            "visible": true
                        },
                        {
                            "id": 76564159,
                            "type": "back",
                            "hash": "ebd559858e5703088de8900ce99c37d3",
                            "url": "https://picsum.photos/200/300?image=2",
                            "filename": "76564159.jpg",
                            "mime_type": "image/jpeg",
                            "size": 11246,
                            "width": 200,
                            "height": 300,
                            "dpi": null,
                            "status": "ok",
                            "created": 1540797879,
                            "thumbnail_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_thumb.png",
                            "preview_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_preview.png",
                            "visible": true
                        },
                        {
                            "id": 76564391,
                            "type": "preview",
                            "hash": "a0b4fa4e51f3feeee7a5f14260a257ea",
                            "url": null,
                            "filename": "mockup-fafde22d.png",
                            "mime_type": "image/png",
                            "size": 222824,
                            "width": 600,
                            "height": 600,
                            "dpi": 72,
                            "status": "ok",
                            "created": 1540982574,
                            "thumbnail_url": "https://s3.dev.printful.com/files/a0b/a0b4fa4e51f3feeee7a5f14260a257ea_thumb.png",
                            "preview_url": "https://s3.dev.printful.com/files/a0b/a0b4fa4e51f3feeee7a5f14260a257ea_preview.png",
                            "visible": false
                        }
                    ],
                    "options": [
                        {
                            "id": "embroidery_type",
                            "value": "flat"
                        },
                        {
                            "id": "thread_colors",
                            "value": []
                        },
                        {
                            "id": "thread_colors_3d",
                            "value": []
                        },
                        {
                            "id": "thread_colors_chest_left",
                            "value": []
                        }
                    ]
                }
            ]
        },
        "extra": [],
        "debug": []
    }

Delete a Sync Product

DELETE https://api.printful.com/store/products/{id}

Deletes a Sync Product with all of its Sync Variants
Input parameters:
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
レスポンス形式:
code integer ステータスコードのレスポンス 200
result ProductInfo
product Product Information about the selected product
id integer Product ID
type string Product type identifier
type_name string Product type name
brand string Brand name
model string Model name
image string URL of a sample image for this product
variant_count integer Number of available variants for this product
currency string Currency in which prices are returned
files FileType [ ] Definitions of Print/Mockup file categories that can be attached to this product
id string Deprecated file type identifier. Please use type field instead!
type string File type identifier - use this to specify a file's purpose when creating an order
title string Display name
additional_price string Additional price when this print file type is used
options OptionType [ ] Definitions of additional options that are available for this product
id string Option identifier - use this to specify the option when creating an order
title string Display name
type string Data type of this option (currently only 'bool' is supported)
values array Option values - [key, value] map
additional_price string Additional price when this option is used
additional_price_breakdown array Additional price breakdown by type - [key, value] map
is_discontinued boolean If product is disabled in push
avg_fulfillment_time float Average number of days for order to be fulfilled
description string Product description
variants Variant [ ] Array of Variants available for the selected product
id integer Variant ID, use this to specify the product when creating orders
product_id integer ID of the product that this variant belongs to
name string Display name
size string Item size
color string Item color
color_code string Hexadecimal RGB color code. May not exactly reflect the real-world color
color_code2 string Secondary hexadecimal RGB color code. May not exactly reflect the real-world color
image string URL of a preview image for this variant
price string Variant's price (can change depending on print files and optional settings)
in_stock boolean Stock availability of this variant
availability_regions array Map of [region code, region name] of regions where the variant is available for fulfillment
availability_status AvailabilityStatus [ ] Detailed stock status per region
region string Region code
status string Stock status. Possible values include: 'in_stock' - available for fulfillment, 'stocked_on_demand' - available for fulfillment, 'discontinued' - permanently unavailable, 'out_of_stock' - temporarily unavailable
APIキー
id Sync Product ID (integer) or External ID (if prefixed with @)
Execute

Modify a Sync Product

PUT https://api.printful.com/store/products/{id}

Modifies an existing Sync Product with its Sync Variants.

Please note that in the request body you only need to specify the fields that need to be changed. Furthermore, if you want to update existing sync variants, then in the sync variants array you must specify the IDs of all existing sync variants. All omitted existing sync variants will be deleted. All new sync variants without an ID will be created. See examples for more insights.
Input parameters:
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
Request body PutRequestProductBody PUT request body
sync_product PutRequestProduct Information about the Sync Product
external_id string Product ID from your Ecommerce platform
name string Product name
thumbnail string Thumbnail image URL. Although we do not limit thumbnail image size, we recommend to keep it reasonably small.
sync_variants PutRequestVariant [ ] Information about the Sync Variants
id integer Sync Variant ID. Please specify the IDs of all Sync Variants you wish to keep.
external_id string Variant ID from the Ecommerce platform
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
files RequestFile [ ] Array of attached print files
type string Role of the file in the order
id integer File ID

* Required if no URL given
url string Source URL where the file is downloaded from

* Required if no File ID given
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
レスポンス形式:
code integer ステータスコードのレスポンス 200
result RequestProductResponse
id integer Sync Product id
external_id string Sync Product ID from the external system
name string Sync Product name
variants integer Total number of variants in Sync Product
synced integer Total number of Sync variants in Sync Product
APIキー
id Sync Product ID (integer) or External ID (if prefixed with @)
Request body
Execute
同期商品の名前とサムネイルを更新します
Request body:
    {
        "sync_product": {
            "name": "API product new name",
            "thumbnail": "https://example.com/image.jpg"
        }
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 79348721,
            "external_id": "e9460f6c67",
            "name": "API product new name",
            "variants": 2,
            "synced": 2
        },
        "extra": [],
        "debug": []
    }
Update a Sync Product and one of its Sync Variants
Request body:
    {
        "sync_product": {
            "name": "API product new name",
            "thumbnail": "https://example.com/image.jpg"
        },
        "sync_variants": [
            	{
                    "id": 866914574
                },
                {
                    "id": 866914580,
                    "retail_price": 21,
                    "files": [
                        {
                            "url": "https://example.com/image.jpg"
                        },
                        {
                            "type": "back",
                            "url": "https://example.com/image.jpg"
                        }
                    ]
                }
        ]
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 79348721,
            "external_id": "e9460f6c67",
            "name": "API product",
            "variants": 2,
            "synced": 2
        },
        "extra": [],
        "debug": []
    }

Create a new Sync Variant

POST https://api.printful.com/store/products/{id}/variants

Creates a new Sync Variant for an existing Sync Product.
Input parameters:
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
Request body RequestVariant POST request body
external_id string Variant ID from the Ecommerce platform
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
files RequestFile [ ] Array of attached print files
type string Role of the file in the order
id integer File ID

* Required if no URL given
url string Source URL where the file is downloaded from

* Required if no File ID given
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
レスポンス形式:
code integer ステータスコードのレスポンス 200
result RequestVariantResponse
id integer Sync Variant id
external_id string Sync Variant ID from the external system
sync_product_id integer Sync Variant ID in Printful
name string Sync Variant name
synced bool Is this variant synced
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
currency string Items currenct
product ProductMiniInfo
variant_id integer Printful Variant ID that this Sync Variant is synced to
product_id integer Printful Product ID that this Variant Id belongs to
image string Variants default image in Printfuls Catalog
name string Variants full name in Printfuls Catalog
files File [ ] Array of attached print files
id integer File ID
type string Role of the file in the order
hash string MD5 checksum of the file
url string Source URL where the file is downloaded from
filename string File name
mime_type string MIME type of the file
size integer Size in bytes
width integer Width in pixels
height integer Height in pixels
dpi integer Resolution DPI.
Note: for vector files this may be indicated as only 72dpi, but it doesn't affect print quality since the vector files are resolution independent.
status string File processing status:
ok - file was processed successfuly
waiting - file is being processed
failed - file failed to be processed
created timestamp File creation time
thumbnail_url string Small thumbnail URL
preview_url string Medium preview image URL
visible boolean Show file in the Printfile Library (default true)
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
APIキー
id Sync Product ID (integer) or External ID (if prefixed with @)
Request body
Execute
Request body:
    {
        "external_id": "my-external-id",
        "retail_price": "19.00",
        "variant_id": 4011,
        "files": [
            {
                "type": "default",
                "url": "https://example.com/image.jpg"
            },
            {
                "type": "back",
                "url": "https://example.com/image.jpg"
            }
        ],
        "options": [
            {
                "id": "embroidery_type",
                "value": "flat"
            },
            {
                "id": "thread_colors",
                "value": []
            },
            {
                "id": "thread_colors_3d",
                "value": []
            },
            {
                "id": "thread_colors_chest_left",
                "value": []
            }
        ]
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 866914592,
            "external_id": "my-external-id",
            "sync_product_id": 79348732,
            "name": "API product Bella",
            "synced": true,
            "variant_id": 4011,
            "retail_price": "19.00",
            "currency": "USD",
            "product": {
                "variant_id": 4011,
                "product_id": 71,
                "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
            },
            "files": [
                {
                    "id": 76564159,
                    "type": "default",
                    "hash": "ebd559858e5703088de8900ce99c37d3",
                    "url": "https://example.com/image.jpg",
                    "filename": "76564159.jpg",
                    "mime_type": "image/jpeg",
                    "size": 11246,
                    "width": 200,
                    "height": 300,
                    "dpi": null,
                    "status": "ok",
                    "created": 1540797879,
                    "thumbnail_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_thumb.png",
                    "preview_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_preview.png",
                    "visible": true
                },
                {
                    "id": 76564159,
                    "type": "back",
                    "hash": "ebd559858e5703088de8900ce99c37d3",
                    "url": "https://example.com/image.jpg",
                    "filename": "76564159.jpg",
                    "mime_type": "image/jpeg",
                    "size": 11246,
                    "width": 200,
                    "height": 300,
                    "dpi": null,
                    "status": "ok",
                    "created": 1540797879,
                    "thumbnail_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_thumb.png",
                    "preview_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_preview.png",
                    "visible": true
                }
            ],
            "options": [
                {
                    "id": "embroidery_type",
                    "value": "flat"
                },
                {
                    "id": "thread_colors",
                    "value": []
                },
                {
                    "id": "thread_colors_3d",
                    "value": []
                },
                {
                    "id": "thread_colors_chest_left",
                    "value": []
                }
            ]
        },
        "extra": [],
        "debug": []
    }

Get information about a single Sync Variant

GET https://api.printful.com/store/variants/{id}

Returns information about an existing Sync Variant.
Input parameters:
id integer Sync Variant ID (integer) or External ID (if prefixed with @)
レスポンス形式:
code integer ステータスコードのレスポンス 200
result SyncVariantInfo
sync_variant SyncVariant Information about the selected Sync Variant
id integer Sync Variant ID
external_id string Variant ID from the Ecommerce platform
sync_product_id integer Sync Product ID that this variant belongs to
name string Sync Variant name
synced boolean Indicates if this Sync Variant is properly linked with Printful product
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
currency string Currency in which prices are returned
product ProductVariant Short information about the Printful Product and Variant that this Sync Variant is synced to
variant_id integer Variant ID
product_id integer Product ID of this variant
image string URL of a sample image for this variant
name string Display name of this variant
files File [ ] Array of attached printfiles / preview images
id integer File ID
type string Role of the file in the order
hash string MD5 checksum of the file
url string Source URL where the file is downloaded from
filename string File name
mime_type string MIME type of the file
size integer Size in bytes
width integer Width in pixels
height integer Height in pixels
dpi integer Resolution DPI.
Note: for vector files this may be indicated as only 72dpi, but it doesn't affect print quality since the vector files are resolution independent.
status string File processing status:
ok - file was processed successfuly
waiting - file is being processed
failed - file failed to be processed
created timestamp File creation time
thumbnail_url string Small thumbnail URL
preview_url string Medium preview image URL
visible boolean Show file in the Printfile Library (default true)
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
sync_product SyncProduct Information about the Sync Product that the Sync Variant belongs to
id integer Sync Product ID
external_id string Product ID from the Ecommerce platform
name string Product name
variants integer Total number of Sync Variants belonging to this product
synced integer Number of synced Sync Variants belonging to this product
thumbnail_url string Thumbnail image for the product
APIキー
id Sync Variant ID (integer) or External ID (if prefixed with @)
Execute
Response data:
    {
        "code": 200,
        "result": {
            "sync_variant": {
                "id": 866914574,
                "external_id": "5bd967595a1174",
                "sync_product_id": 79348721,
                "name": "API product",
                "synced": true,
                "variant_id": 4011,
                "retail_price": "18.00",
                "currency": "USD",
                "product": {
                    "variant_id": 4011,
                    "product_id": 71,
                    "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                    "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
                },
                "files": [
                    {
                        "id": 76564075,
                        "type": "default",
                        "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                        "url": "https://picsum.photos/200/300",
                        "filename": "76564075.jpg",
                        "mime_type": "image/jpeg",
                        "size": 8245,
                        "width": 200,
                        "height": 300,
                        "dpi": null,
                        "status": "ok",
                        "created": 1539341673,
                        "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                        "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                        "visible": true
                    },
                    {
                        "id": 76564075,
                        "type": "back",
                        "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                        "url": "https://picsum.photos/200/300",
                        "filename": "76564075.jpg",
                        "mime_type": "image/jpeg",
                        "size": 8245,
                        "width": 200,
                        "height": 300,
                        "dpi": null,
                        "status": "ok",
                        "created": 1539341673,
                        "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                        "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                        "visible": true
                    }
                ],
                "options": [
                    {
                        "id": "embroidery_type",
                        "value": "flat"
                    },
                    {
                        "id": "thread_colors",
                        "value": []
                    },
                    {
                        "id": "thread_colors_3d",
                        "value": []
                    },
                    {
                        "id": "thread_colors_chest_left",
                        "value": []
                    }
                ]
            },
            "sync_product": {
                "id": 79348721,
                "external_id": "e9460f6c67",
                "name": "API product",
                "variants": 1,
                "synced": 1
            }
        },
        "extra": [],
        "debug": []
    }

Delete a Sync Variant

DELETE https://api.printful.com/store/variants/{id}

Deletes a single Sync Variant.
Input parameters:
id integer / string Sync Variant ID (integer) or External ID (if prefixed with @)
レスポンス形式:
code integer ステータスコードのレスポンス 200
result VariantInfo
variant Variant Information about the selected Variant
id integer Variant ID, use this to specify the product when creating orders
product_id integer ID of the product that this variant belongs to
name string Display name
size string Item size
color string Item color
color_code string Hexadecimal RGB color code. May not exactly reflect the real-world color
color_code2 string Secondary hexadecimal RGB color code. May not exactly reflect the real-world color
image string URL of a preview image for this variant
price string Variant's price (can change depending on print files and optional settings)
in_stock boolean Stock availability of this variant
availability_regions array Map of [region code, region name] of regions where the variant is available for fulfillment
availability_status AvailabilityStatus [ ] Detailed stock status per region
region string Region code
status string Stock status. Possible values include: 'in_stock' - available for fulfillment, 'stocked_on_demand' - available for fulfillment, 'discontinued' - permanently unavailable, 'out_of_stock' - temporarily unavailable
product Product Information about the Product that the Variant belongs to
id integer Product ID
type string Product type identifier
type_name string Product type name
brand string Brand name
model string Model name
image string URL of a sample image for this product
variant_count integer Number of available variants for this product
currency string Currency in which prices are returned
files FileType [ ] Definitions of Print/Mockup file categories that can be attached to this product
id string Deprecated file type identifier. Please use type field instead!
type string File type identifier - use this to specify a file's purpose when creating an order
title string Display name
additional_price string Additional price when this print file type is used
options OptionType [ ] Definitions of additional options that are available for this product
id string Option identifier - use this to specify the option when creating an order
title string Display name
type string Data type of this option (currently only 'bool' is supported)
values array Option values - [key, value] map
additional_price string Additional price when this option is used
additional_price_breakdown array Additional price breakdown by type - [key, value] map
is_discontinued boolean If product is disabled in push
avg_fulfillment_time float Average number of days for order to be fulfilled
description string Product description
APIキー
id Sync Variant ID (integer) or External ID (if prefixed with @)
Execute

Modify a Sync Variant

PUT https://api.printful.com/store/variants/{id}

Modifies an existing Sync Variant.

Please note that in the request body you only need to specify the fields that need to be changed. See examples for more insights.
Input parameters:
id integer / string Sync Variant ID (integer) or External ID (if prefixed with @)
Request body PutRequestVariant PUT request body
id integer Sync Variant ID. Please specify the IDs of all Sync Variants you wish to keep.
external_id string Variant ID from the Ecommerce platform
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
files RequestFile [ ] Array of attached print files
type string Role of the file in the order
id integer File ID

* Required if no URL given
url string Source URL where the file is downloaded from

* Required if no File ID given
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
レスポンス形式:
code integer ステータスコードのレスポンス 200
result RequestVariantResponse
id integer Sync Variant id
external_id string Sync Variant ID from the external system
sync_product_id integer Sync Variant ID in Printful
name string Sync Variant name
synced bool Is this variant synced
variant_id integer Printful Variant ID that this Sync Variant is synced to
retail_price float Retail price that this item is sold for
currency string Items currenct
product ProductMiniInfo
variant_id integer Printful Variant ID that this Sync Variant is synced to
product_id integer Printful Product ID that this Variant Id belongs to
image string Variants default image in Printfuls Catalog
name string Variants full name in Printfuls Catalog
files File [ ] Array of attached print files
id integer File ID
type string Role of the file in the order
hash string MD5 checksum of the file
url string Source URL where the file is downloaded from
filename string File name
mime_type string MIME type of the file
size integer Size in bytes
width integer Width in pixels
height integer Height in pixels
dpi integer Resolution DPI.
Note: for vector files this may be indicated as only 72dpi, but it doesn't affect print quality since the vector files are resolution independent.
status string File processing status:
ok - file was processed successfuly
waiting - file is being processed
failed - file failed to be processed
created timestamp File creation time
thumbnail_url string Small thumbnail URL
preview_url string Medium preview image URL
visible boolean Show file in the Printfile Library (default true)
options ItemOption [ ] Array of additional options for the configured product/variant
id string Option ID
value mixed Option value
APIキー
id Sync Variant ID (integer) or External ID (if prefixed with @)
Request body
Execute
既存の同期バリエーションの価格を更新します
Request body:
    {
        "retail_price": "29.00"
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 866914574,
            "external_id": "5bd967595a1174",
            "sync_product_id": 79348721,
            "name": "API product",
            "synced": true,
            "variant_id": 4011,
            "retail_price": "29.00",
            "currency": "",
            "product": {
                "variant_id": 4011,
                "product_id": 71,
                "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
            },
            "files": [
                {
                    "id": 76564075,
                    "type": "default",
                    "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                    "url": "https://example.com/image.jpg",
                    "filename": "76564075.jpg",
                    "mime_type": "image/jpeg",
                    "size": 8245,
                    "width": 200,
                    "height": 300,
                    "dpi": null,
                    "status": "ok",
                    "created": 1539341673,
                    "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                    "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                    "visible": true
                },
                {
                    "id": 76564075,
                    "type": "back",
                    "hash": "7d6a2367c1e338750e68dc66b20cba1a",
                    "url": "https://example.com/image.jpg",
                    "filename": "76564075.jpg",
                    "mime_type": "image/jpeg",
                    "size": 8245,
                    "width": 200,
                    "height": 300,
                    "dpi": null,
                    "status": "ok",
                    "created": 1539341673,
                    "thumbnail_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_thumb.png",
                    "preview_url": "https://s3.dev.printful.com/files/7d6/7d6a2367c1e338750e68dc66b20cba1a_preview.png",
                    "visible": true
                }
            ],
            "options": [
                {
                    "id": "embroidery_type",
                    "value": "flat"
                },
                {
                    "id": "thread_colors",
                    "value": []
                },
                {
                    "id": "thread_colors_3d",
                    "value": []
                },
                {
                    "id": "thread_colors_chest_left",
                    "value": []
                }
            ]
        },
        "extra": [],
        "debug": []
    }
前面と背面の両方のプリントではなく、前面のみプリントのあるバリエーションTシャツを更新します。
Request body:
    {
        "files": [
            {
                "type": "default",
                "url": "https://example.com/image.jpg"
            }
        ]
    }
Response data:
    {
        "code": 200,
        "result": {
            "id": 866914574,
            "external_id": "5bd967595a1174",
            "sync_product_id": 79348721,
            "name": "API product",
            "synced": true,
            "variant_id": 4011,
            "retail_price": "29.00",
            "currency": "",
            "product": {
                "variant_id": 4011,
                "product_id": 71,
                "image": "https://s3.dev.printful.com/products/71/4012_1517927381.jpg",
                "name": "Bella + Canvas 3001 Unisex Short Sleeve Jersey T-Shirt with Tear Away Label (White / S)"
            },
            "files": [
                {
                    "id": 76564159,
                    "type": "default",
                    "hash": "ebd559858e5703088de8900ce99c37d3",
                    "url": "https://example.com/image.jpg",
                    "filename": "76564159.jpg",
                    "mime_type": "image/jpeg",
                    "size": 11246,
                    "width": 200,
                    "height": 300,
                    "dpi": null,
                    "status": "ok",
                    "created": 1540797879,
                    "thumbnail_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_thumb.png",
                    "preview_url": "https://s3.dev.printful.com/files/ebd/ebd559858e5703088de8900ce99c37d3_preview.png",
                    "visible": true
                }
            ],
            "options": [
                {
                    "id": "embroidery_type",
                    "value": "flat"
                },
                {
                    "id": "thread_colors",
                    "value": []
                },
                {
                    "id": "thread_colors_3d",
                    "value": []
                },
                {
                    "id": "thread_colors_chest_left",
                    "value": []
                }
            ]
        },
        "extra": [],
        "debug": []
    }

Printfulを試す準備はできましたか?