Skip to content

Powered by Grav CMS + Helios Theme

Print on demand import (add-on)

The products designed at a provider, the import sheet, importing one as a draft, and refreshing it.

All take kahunacart.pod.manage. Nothing is imported without a selling price for every variant, given in prices or confirmed with accept_suggested: true, and an imported product is always a draft. See Products and import.

List the products designed at a provider

GET /api/v1/kahunacart/pod/providers/{code}/products Permission kahunacart.pod.manage

The products the merchant has designed at the provider, a page at a time, each with its thumbnail, how many variants it has, whether it is switched off at the provider, and the KahunaCart product id it was imported as, or null when it is not in the store yet.

Parameters

Name Type Description
code required string The provider's code, such as `printful`.
offset optional integer How many products to skip.
limit optional integer How many to answer, at most 100.

Get a provider product and its import sheet

GET /api/v1/kahunacart/pod/providers/{code}/products/{ref} Permission kahunacart.pod.manage

One of the merchant's products at the provider, with every variant — its colour and size, SKU, cost in the provider's billing currency, retail price, and whether it can be made — and the import sheet beside it: a suggested selling price per variant in the store's currency, from the provider's retail price or from cost plus the markup. Reads two or more provider endpoints, so it is not free of rate limit.

Parameters

Name Type Description
code required string The provider's code, such as `printful`.
ref required string The provider's product id, as `list_provider_products` gives it.
markup optional integer A markup in percent to suggest prices with, instead of the store's.

Import a provider product

POST /api/v1/kahunacart/pod/imports Permission kahunacart.pod.manage

Import a provider's product as a draft KahunaCart product of type Print on demand, with its options, one variant per variant switched on at the provider, its pictures and a link per variant. Every variant needs a selling price in minor units of the store's currency in prices, or pass accept_suggested: true to take the import sheet's suggestions as confirmed. Without prices it answers 422 with the sheet and the variants still missing one. A product already imported is refused with its id.

Parameters

Name Type Description
provider required string The provider's code, such as `printful`.
ref required string The provider's product id.
prices optional object Selling price per provider variant id, in minor units of the store's currency.
accept_suggested optional boolean Take the sheet's suggested price for every variant not named in `prices`.
markup_percent optional integer The markup the suggestions use, instead of the store's.

Refresh an imported product

POST /api/v1/kahunacart/pod/imports/{id}/refresh Permission kahunacart.pod.manage

Read an imported product from the provider again and bring in its facts: cost, availability, SKU and weight on every variant still there, new variants added switched off for the merchant to price and switch on, and variants the provider dropped marked unavailable but kept. Title, description, prices and pictures change only when asked. Answers every cost that changed, with the old and the new.

Parameters

Name Type Description
id required integer The import's id.
title optional boolean Overwrite the product's title with the provider's.
description optional boolean Overwrite the product's description with the provider's.
images optional boolean Fetch any pictures the product does not have yet.
prices optional object New selling prices per provider variant id, in minor units of the store's currency.