Sincronización de plataforma ecommerce API

La plataforma de comercio electrónico sincronizada con API permite que asignes productos y archivos de impresión de Printful a los productos de tu tienda online (Shopify, Woocommerce, etc.) enlazada con Printful.

Explicando Productos sincronizados y Variantes sincronizadas

Cada producto de tu tienda puede contener una o múltiples variantes (algunas plataformas de comercio electrónico lo llamarían opciones) que el cliente puede comprar (imagina varias tallas o colores del mismo diseño de camiseta). Cuando unes tu tienda de comercio electrónico con Printful, creamos una copia de tu producto y tu lista de variantes en nuestra plataforma, lo llamamos Productos sincronizados y Variantes sincronizadas.

Igual que en tu tienda, los productos vendidos por Printful también consisten en múltiples variantes. Cada modelo de camiseta está disponible en varias tallas y colores.

El objetivo de las Variantes sincronizadas es permitir la unión de cada variante de tu tienda que sea procesada con Printful con archivos de diseño y variantes específicas del catálogo de productos de Printful. Cuando se realice el pedido de los productos sincronizados, sabremos qué producto de Printful tendrá que imprimirse, y el pedido será importado a Printful para su procesamiento.

Puedes configurar cada Variante sincronizada en el panel de Printful manualmente. Sin embargo, puede ser una tarea tediosa y repetitiva si tu tienda vende cientos de productos. Esta API está diseñada para ayudarte a automatizar este proceso.

Recuerda: Los datos de productos no se importan a Printful inmediatamente después de que el producto se haya creado/actualizado en tu plataforma de comercio electrónico. Dependiendo de la plataforma, puede que los productos tarden unos segundos o unas horas en estar disponibles en Printful. Antes de importar los productos, no podrás actualizar la información de producto a través de esta API.

ID externo

El ID externo es una función que te permite referenciar los Productos sincronizados y las Variantes sincronizadas utilizando el ID de tu tienda.

Al solicitar Productos sincronizados y Variantes sincronizadas, puedes usar el ID de Printful y el ID externo (si colocas antes el símbolo @.

GET /sync/products/11001  - referencia de ID de Producto sincronizado de Printful
GET /sync/products/@988123  - referencia de ID de producto de Shopify (u otra plataforma)
GET /sync/variant/123456  - referencia de ID de Variante sincronizada de Printful
GET /sync/variant/@123123  - referencia de ID de variante de Shopify (u otra plataforma)

Especificando productos

Para especificar la variante exacta del producto, tienes que utilizar el atributo ID_de_variante del artículo del pedido. Cada artículo único disponible (incluyendo talla/color) tiene su propio ID de variante que puede adquirirse a través de la API del catálogo de Printful.

Añadir archivos de impresión

Hay dos maneras de asignar un archivo de impresión a un artículo. Una es especificando el ID de archivo si el archivo ya existe en la biblioteca de archivos de la tienda autorizada;

..."files":[{"id": 12345},],...

El segundo método, y el más conveniente, es especificando la URL de archivo. Si ya existe un archivo con la misma URL, se reutilizará.

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

Especificando múltiples archivos por artículo

Cada artículo del pedido tiene que estar unido a uno o varios archivos. Los tipos de archivos disponibles para cada producto están disponibles en la API del catálogo de productos.

Puedes añadir un archivo para cada tipo especificando el atributo tipo. Para el tipo por defecto, se puede saltar este atributo.

..."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"}],...

Recuerda que utilizar archivos adicionales puede aumentar el precio del artículo.

Get list of Sync Products

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

Returns list of Sync Product objects from your store
Parámetros de entrada
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)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncProduct [ ]
id integer Sync Product ID
external_id string Product ID from the E-commerce 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 Información sobre la paginación
total integer Número total de artículos disponible
offset integer Fijar resultado actual de compensación de página
limit integer Número máximo de artículos por página
Clave 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)
Ejecutar
Obtén una lista de productos de sincronización
Datos de respuesta:
{
    "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.
Parámetros de entrada
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncProductInfo
sync_product SyncProduct Information about the selected product
id integer Sync Product ID
external_id string Product ID from the E-commerce 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 E-commerce 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
Clave API
id Sync Product ID (integer) or External ID (if prefixed with @)
Ejecutar

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.
Parámetros de entrada
id integer / string Sync Product ID (integer) or External ID (if prefixed with @)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncProductInfo
sync_product SyncProduct Information about the selected product
id integer Sync Product ID
external_id string Product ID from the E-commerce 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 E-commerce 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
Clave API
id Sync Product ID (integer) or External ID (if prefixed with @)
Ejecutar

Get information about Variant

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

Returns information about a Sync Variant
Parámetros de entrada
id integer Sync Variant ID (integer) or External ID (if prefixed with @)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncVariantInfo
sync_variant SyncVariant Information about the selected Sync Variant
id integer Sync Variant ID
external_id string Variant ID from the E-commerce 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 E-commerce 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
Clave API
id Sync Variant ID (integer) or External ID (if prefixed with @)
Ejecutar

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.
Parámetros de entrada
Request body SyncVariant Sync Variant configuration data
id integer Sync Variant ID
external_id string Variant ID from the E-commerce 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 @)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncVariantInfo
sync_variant SyncVariant Information about the selected Sync Variant
id integer Sync Variant ID
external_id string Variant ID from the E-commerce 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 E-commerce 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
Clave API
Request body
id Sync Variant ID (integer) or External ID (if prefixed with @)
Ejecutar
Enlaza la variante de sincronización con la camiseta que tiene imágenes en las partes frontal y posterior
Solicitar cuerpo:
{
    "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": []
}
Datos de respuesta:
{
    "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://d1yg28hrivmbqm.cloudfront.net/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.
Parámetros de entrada
id integer Sync Variant ID (integer) or External ID (if prefixed with @)
Formato de respuesta:
code integer Código del estado de respuesta 200
result SyncVariantInfo
sync_variant SyncVariant Information about the selected Sync Variant
id integer Sync Variant ID
external_id string Variant ID from the E-commerce 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 E-commerce 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
Clave API
id Sync Variant ID (integer) or External ID (if prefixed with @)
Ejecutar

¿Listo para probar Printful?