Skip to content

Powered by Grav CMS + Helios Theme

Print on demand bulk links (add-on)

Assign by SKU, the links CSV in and out, and the bulk runs with their undo.

All take kahunacart.pod.manage. A SKU rule and a CSV import are dry runs until told otherwise, and every run that writes can be undone while nothing has changed its variants since. See Moving from another platform.

POST /api/v1/kahunacart/pod/links/assign Permission kahunacart.pod.manage

Link every variant whose SKU a rule catches to a provider: a SKU prefix, or a numeric range compared on the SKU's leading digits. Dry run by default, answering what will be linked (with each blank), what will be replaced (current link and new), and what will be skipped and why. Pass dry_run: false to write it as one run that can be undone.

Parameters

Name Type Description
match required object {"prefix": "PF-"} or {"from": 7000, "to": 7999}. Keys: `prefix`, `from`, `to`
provider required string The provider's code, such as `printful`.
mode optional string Default custom.
One of: custom, synced
blank optional object or null {"one": "<blank id>"} for every variant, {"match_from": "<product id>"} to match by options, or null to keep each variant's blank. Keys: `one`, `match_from`
files optional object An uploaded print file id per print area, put on every variant the rule links.
dry_run optional boolean Only answer what would happen. Default true.
Default: true
GET /api/v1/kahunacart/pod/link-runs Permission kahunacart.pod.manage

The bulk runs that assigned providers — SKU rules and links CSV imports — newest first, with what each did, the lines a CSV refused, and whether it has been undone.

Parameters

Name Type Description
offset optional integer How many runs to skip.
limit optional integer How many to answer, at most 200.
POST /api/v1/kahunacart/pod/link-runs/{id}/undo Permission kahunacart.pod.manage

Undo a bulk run: remove the links it wrote, put back the links it replaced, take away the print files it added, and put back any product it left with no links as it was. Refused, naming the variants, when a later run or a change by hand has touched them since.

Parameters

Name Type Description
id required integer The run's id.
POST /api/v1/kahunacart/pod/links/import Permission kahunacart.pod.manage

Upload a links CSV (sku, provider, mode, blank, file:<print area>). A dry run that names every bad line by its line number unless commit is set; the real run goes on the queue and downloads each file URL once. No tool: it is a multipart upload, and an agent uses bin/plugin kahunacart-print-on-demand links:import instead.

GET /api/v1/kahunacart/pod/links/export Permission kahunacart.pod.manage

Every provider link in the store as a links CSV, or one provider's with provider. No tool: it answers a CSV file rather than JSON.