Skip to content

Powered by Grav CMS + Helios Theme

Print on demand orders (add-on)

The provider orders behind a sale, the review queue, and sending, checking and cancelling at the provider.

Reading and Check again take kahunacart.orders.view. Sending, sending again and cancelling take kahunacart.pod.orders, because sending spends the store's money at the provider. See Orders.

Get the review queue

GET /api/v1/kahunacart/pod/review Permission kahunacart.orders.view

Everything print on demand is waiting on a person for, with counts: provider orders that need attention (with the provider's own words), orders waiting to be sent with their cost, products auto-sync brought in as drafts, published products whose cost went up, and products with a variant no longer made or a print file missing. Answers "what's waiting in print on demand?".

Parameters

Name Type Description
limit optional integer How many of each kind to list, at most 200.

List the provider orders

GET /api/v1/kahunacart/pod/orders Permission kahunacart.orders.view

Every provider order — one per provider per KahunaCart order — with its KahunaCart order number, provider, status, the provider's own status word, cost in the provider's billing currency, what the customer paid for those lines, the margin when both are in one currency, and which buttons apply. Needs attention and waiting to be sent come first.

Parameters

Name Type Description
status optional string Only this status, such as `review` or `needs_attention`.
provider optional string Only this provider, such as `printful`.
limit optional integer How many to answer, at most 200.
offset optional integer How many to skip.

Get an order's provider orders

GET /api/v1/kahunacart/orders/{id}/pod Permission kahunacart.orders.view

The provider orders of one KahunaCart order: status, cost once the provider has worked it out, margin, the provider's words when something is wrong, its dashboard link, the lines sent, the parcels with their tracking, and which buttons apply. Empty for an order with nothing made by a provider.

Parameters

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

Send a provider order to production

POST /api/v1/kahunacart/pod/orders/{id}/send Permission kahunacart.pod.orders

Send a provider order waiting in review to production. This spends money: the provider charges the merchant for it. Refused while the provider is still working out the cost. Answers the order as it now stands.

Parameters

Name Type Description
id required integer The provider order's id, as `list_pod_orders` or `get_order_pod` gives it.

Send a provider order again

POST /api/v1/kahunacart/pod/orders/{id}/resend Permission kahunacart.pod.orders

Send again a provider order that needs attention, once its cause is fixed. An order the provider never made goes through submission again, which looks it up first and never makes a second one; one it has is rewritten from the order as it stands and then sent. This can spend money.

Parameters

Name Type Description
id required integer The provider order's id.

Check a provider order again

POST /api/v1/kahunacart/pod/orders/{id}/refresh Permission kahunacart.orders.view

Read a provider order back from the provider now and record what it says: status, cost, the provider's words, new parcels with their tracking, deliveries. The same as the Check again button.

Parameters

Name Type Description
id required integer The provider order's id.

Cancel a provider order at the provider

POST /api/v1/kahunacart/pod/orders/{id}/cancel Permission kahunacart.pod.orders

Cancel a provider order at the provider: a draft is deleted, an order not yet started is cancelled and its cost goes back to the provider wallet. One the provider has already started is not cancelled; the answer, a notice on the order and a notification say its cost stands. Does not cancel or refund the KahunaCart order.

Parameters

Name Type Description
id required integer The provider order's id.

Receive a provider webhook

POST /api/v1/kahunacart/pod/public/webhook/{provider}/{secret} No permission

Where a provider posts its webhooks. Too large is 413, a wrong secret 404, a bad signature 401. A good delivery is logged and queued, and the job reads the order back from the provider before anything is written. No tool: a provider posts to this, nobody else.

On the public side, a provider posts its webhooks to POST /kahunacart/pod/public/webhook/{provider}/{secret}, which checks the size, the secret and the signature, logs the delivery and queues a read of the order. See Tracking.