Skip to content

Powered by Grav CMS + Helios Theme

Print on demand custom products (add-on)

A provider's catalogue of blanks, Made by, the links on a product, and its print files.

All take kahunacart.pod.manage. A print file is uploaded as multipart and served to the provider from an unauthenticated route by a token of its own. See Custom products.

GET /api/v1/kahunacart/pod/products/{id}/links Permission kahunacart.pod.manage

Which provider makes each variant of a product, with the provider's references, the cost, whether the variant can be sold, and the reason when it cannot.

Parameters

Name Type Description
id required integer The KahunaCart product's id.
PUT /api/v1/kahunacart/pod/products/{id}/links Permission kahunacart.pod.manage

Switch variants of a product made by a provider on or off for sale. A variant a refresh added arrives switched off; this is how it is switched on once it has a price. Only variants that already have a link can be named, and nothing is saved if any cannot.

Parameters

Name Type Description
id required integer The KahunaCart product's id.
links required array of object One entry per variant to switch. Keys: `variant_id`, `available`

Search a provider's blanks

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

Search a provider's catalogue of blank products for a custom product: a Printful tee, hoodie or poster with every colour and size it comes in. The query is matched against each product's name, brand and model, so "Bella Canvas 3001" finds the tee; a technique word (dtg, embroidery) or a category (hoodies, posters) filters, and a number on its own is a catalogue product id.

Parameters

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

Get a blank

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

One catalogue product with every variant: its colour and size, the blank id a custom link stores, its cost in the provider's billing currency, whether it can be made now, and the print areas it takes with the print-file size each wants.

Parameters

Name Type Description
code required string The provider's code, such as `printful`.
blank required string The catalogue product id, as `search_pod_catalogue` gives it.

Set who makes a product

PUT /api/v1/kahunacart/pod/products/{id}/made-by Permission kahunacart.pod.manage

Set which provider makes a product, and from which blank each of its variants is made. match_from names a catalogue product whose colours and sizes are matched to the product's own options; blanks gives a blank per variant id and wins over the match. Nothing is saved while any variant has no blank: the answer lists what matched and what did not, with reasons. dry_run previews. provider: null sets it back to nobody, putting the product's own type, shipping profile and stock counting back. Answers the links and the print areas still missing a file.

Parameters

Name Type Description
id required integer The KahunaCart product's id.
provider optional string or null The provider's code, such as `printful`, or null for nobody.
mode optional string custom (the provider's blank with print files kept here) or synced (a variant designed at the provider). Default custom.
One of: custom, synced
match_from optional string A catalogue product id to match the variants' options against.
blanks optional object A blank id per variant id.
dry_run optional boolean Answer the match without saving.

List a product's print files

GET /api/v1/kahunacart/pod/products/{id}/artwork Permission kahunacart.pod.manage

A custom product's print files: which print area and which variant each is for (none means every variant), its type, pixel size and the public address the provider fetches it from, with a warning when it would print under 150 dpi; and the print areas each variant still needs a file for.

Parameters

Name Type Description
id required integer The KahunaCart product's id.

Delete a print file

DELETE /api/v1/kahunacart/pod/artwork/{id} Permission kahunacart.pod.manage

Delete a print file. Refused while an order at the provider still names it, because the provider may fetch it again for a reprint.

Parameters

Name Type Description
id required integer The print file's id.

Upload a print file

POST /api/v1/kahunacart/pod/products/{id}/artwork Permission kahunacart.pod.manage

Upload a print file for one print area, for the whole product or one variant. Multipart, with the file in a field named file. Checked from its bytes (PNG, JPEG or PDF) and against artwork.max_mb before it is read, and refused for a print area the blank does not take. No tool: an MCP tool cannot carry a file.

Fetch a print file

GET /api/v1/kahunacart/pod/public/artwork/{token} No permission

Where a provider fetches a print file. Unauthenticated: the token in the path is the credential, and it changes whenever the file is replaced. No tool: a provider calls this, nobody else.

Check a print file

HEAD /api/v1/kahunacart/pod/public/artwork/{token} No permission

The same file's headers, for a provider that checks a file before it fetches it.