Ecommerce Platform Sync API

eコマースプラットフォーム同期APIを使用すると、Printful商品とデザインデータを自分の商品に自動的に割り当てることができます。 Printfulにリンクされているオンラインストア(Shopify、Woocommerceなど)。

同期商品&同期バリエーションの説明

ショップの各商品には顧客が購入できる1つまたは複数のバリエーション(一部のECサイトではこれらのオプションと呼ばれます)を含むことができます(同じTシャツデザインの複数のサイズまたは色を想像してください)。ネットショップをPrintfulに接続するとき、当社は商品とバリエーションリストのコピーを当社側に作成します。これを同期商品&同期バリエーションと呼びます。

ショップと同様、Printfulが販売している商品も複数のバリエーションで構成されています。 それぞれのTシャツモデルにはさまざまなサイズと色があります。

同期バリエーションの目的はPrintfulによって梱包発送代行されるショップからの各バリエーションを、デザインファイルおよびPrintfulの商品カタログの特定のバリエーションとリンクさせることです。 同期された商品が注文されると、どのPrintful商品を印刷する必要があるのかがわかります。注文は梱包発送代行サービスのためにPrintfulにインポートされます。

Printful ダッシュボードでそれぞれの同期バリエーションを手動で設定することができます。しかし、これはショップで何百もの商品を売っている場合、かなり面倒で繰り返しの多い作業です。この API はこのプロセスを自動化するのに役立つように設計されています。

eコマースプラットフォームで商品が作成または更新された直後に商品データがPrintfulにインポートされることはありません。 プラットフォームによっては、商品がPrintfulで利用可能になるまでに数秒から数時間かかることがあります。 商品がインポートされる前に、このAPIを介して商品情報を更新することはできません。

外部ID

外部IDは自分ショップからIDを使用して同期商品&同期バリエーションを参照できるようにする機能です。

同期商品&同期バリエーションを要求する際、Printful IDと外部 IDの両方を使用することができます(接頭辞@が付いている場合)。

 
GET /sync/products/11001  -  Printful同期商品IDによる参照
GET /sync/products/@988123  -  Shopify(または他のプラットフォーム)の商品IDによる参照
GET /sync/variant/123456  -  Printful同期バリエーションIDによる参照
GET /sync/variant/@123123  -  Shopify(または他のプラットフォームの)バリエーションIDによる参照
 

商品の指定

商品の正確なバリエーションを指定するには注文商品のvariant_id属性を使用する必要があります。 利用可能な固有のアイテム(サイズ/色を含む)にはそれぞれ印刷可能なカタログ API を通じて取得できる独自のバリエーション ID があります。

デザインデータを追加する

デザインデータを同期バリエーション(Sync Variant)に指定する方法が2つあります。1つは、デザインデータのファイルがショップのファイルライブラリに既存する場合、そのファイルIDを指定する方法です。

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

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

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

アイテムごとに複数のファイルを指定する

注文の各項目は1つまたは複数のファイルとリンクさせる必要があります。各商品で利用可能なファイルの種類は商品カタログAPIから入手することができます。

type属性を指定して、タイプごとに1つのファイルを追加することができます。defaultタイプの場合、この属性はスキップすることができます。

 
 ...
"files":[
	{
		"type": "default",
		"url": "http://example.com/t-shirts/123/front.pdf"
	},
	{
		"type": "back"
		"url": "http://example.com/t-shirts/123/back.pdf"
	},
	{
		"type": "preview"
		"url": "http://example.com/t-shirts/123/preview.png"
	}
],
...
 

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

Get list of Sync Products

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

Returns list of Sync Product objects from your 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": 1055834,
            "external_id": "387926136",
            "name": "Test product",
            "variants": 4,
            "synced": 0
        },
        {
            "id": 1055835,
            "external_id": "409040684",
            "name": "NYC Poster 18x24",
            "variants": 1,
            "synced": 1
        },
        {
            "id": 1055821,
            "external_id": "147988113",
            "name": "Michael Jackson T-Shirt",
            "variants": 6,
            "synced": 2
        }
    ],
    "paging": {
        "total": 3,
        "offset": 0,
        "limit": 20
    }
}

Get information about Sync Product and its variant list

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

Returns information about a specific sync product and a list of sync variants for this product.
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

Unlink all synced variants of this product from Printful

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

Deletes configuraton information (variant_id, print files and options) and disables automatic order importing for all synced variants of this Sync Product.
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

Get information about Variant

GET https://api.printful.com/sync/variant/{id}

Returns information about a 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

Update linked product and print file information for Sync Variant

PUT https://api.printful.com/sync/variant/{id}

Allows to configure selected Sync Variant with correct product, print files and additional options.
Input parameters:
Request body SyncVariant Sync Variant configuration data
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
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キー
Request body
id Sync Variant ID (integer) or External ID (if prefixed with @)
Execute
前後の画像でTシャツの同期バリエーションをリンクする
Request body:
{
    "variant_id": 1118,
    "files": [
        {
            "url": "http://example.com/files/tshirts/shirt_front.ai"
        },
        {
            "type": "back",
            "url": "http://example.com/files/tshirts/shirt_back.ai"
        }
    ],
    "options": []
}
Response data:
{
    "code": 200,
    "result": {
        "sync_variant": {
            "id": 4699529,
            "external_id": "1117068664",
            "sync_product_id": 1055835,
            "name": "Michael Jackson T-Shirt - Medium",
            "synced": true,
            "variant_id": 1118,
            "product": {
                "variant_id": 1118,
                "product_id": 14,
                "image": "https://files.cdn.printful.com/products/14/1095.jpg",
                "name": "Alternative 1070 Short Sleeve Men T-Shirt (Black / M)"
            },
            "files": [
                {
                    "id": 304995,
                    "type": "default",
                    "hash": null,
                    "url": "http://example.com/files/tshirts/shirt_front.ai",
                    "filename": null,
                    "mime_type": null,
                    "size": 0,
                    "width": null,
                    "height": null,
                    "dpi": null,
                    "status": "waiting",
                    "created": 1426839420,
                    "thumbnail_url": null,
                    "preview_url": null,
                    "visible": true
                },
                {
                    "id": 304996,
                    "type": "back",
                    "hash": null,
                    "url": "http://example.com/files/tshirts/shirt_back.ai",
                    "filename": null,
                    "mime_type": null,
                    "size": 0,
                    "width": null,
                    "height": null,
                    "dpi": null,
                    "status": "waiting",
                    "created": 1426839420,
                    "thumbnail_url": null,
                    "preview_url": null,
                    "visible": true
                }
            ],
            "options": []
        },
        "sync_product": {
            "id": 1055835,
            "external_id": "409040684",
            "name": "Michael Jackson T-Shirt",
            "variants": 1,
            "synced": 1
        }
    }
}

Unlink synced variant from Printful

DELETE https://api.printful.com/sync/variant/{id}

Deletes configuraton information (variant_id, print files and options) and disables automatic order importing for this 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

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