Skip to content
Kaizena FlowDocs
Search

Search the docs

Orders

Orders in their own currency, parcels with tracking, and invoices and credit notes as EN 16931 UBL.

OperationMethod and pathScope
List ordersGET /ordersorders:read
Get an orderGET /orders/{id}orders:read
Send a parcelPOST /orders/{id}/fulfillmentsorders:write
Get an invoice as UBLGET /invoices/{id}/ublorders:read
Get a credit note as UBLGET /credit-notes/{id}/ublorders:read
List an order's refundsGET /orders/{id}/refundsorders:read
Refund an orderPOST /orders/{id}/refundsorders:refund
Cancel an unpaid orderPOST /orders/{id}/cancelorders:refund
List an order's notesGET /orders/{id}/notesorders:read
Add a note to an orderPOST /orders/{id}/notesorders:manage
Tag an orderPOST /orders/{id}/tagsorders:manage
Remove an order's tagDELETE /orders/{id}/tags/{tag}orders:manage

List orders

GET https://kaizenaflow.com/api/admin/v1/orders

The store's orders, newest first, in each order's own currency. History copied from another store is left out.

  • Operation: orders.list

  • Scope: orders:read, or orders:write, which reads too

  • Answers: 200, a page: the rows under data, and next for the page after.

  • Pages: at most 100 rows, 50 when limit is left out; give an answer's next as ?after= for the page after.

Query parameters

NameTypeRequiredDescription
limitinteger, 1 to 100noRows a page holds, at most 100; 50 when left out. A larger number gives 100.
afterstring, at most 200 charactersnoThe next cursor of the page before; the first page when left out.
updated_afterstring (date-time)noOnly what was made or changed after this time (ISO 8601 with its offset), for incremental sync.
statusone of pending_payment, authorized, paid, fulfilled, closed, cancellednoOnly orders in this state.
unfulfilledone of true, falsenotrue: only paid orders with something still to send.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].numberstringThe order's number, one sequence per store.
data[].statusone of pending_payment, authorized, paid, fulfilled, closed, cancelled
data[].fulfilmentone of none, unsent, partly_sent, sent, withdrawn, closedWhat is sent: none (nothing to send), unsent, partly_sent, sent, withdrawn or closed.
data[].copiedbooleanHistory copied from another store: read-only.
data[].placed_atstring (date-time)
data[].marketstringA market, by its code (the country's ISO 3166-1 code, such as NO).
data[].currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data[].emailstring
data[].subtotal_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].shipping_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].tax_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].paid_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].refunded_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].shipping_addressobject
data[].shipping_address.namestring
data[].shipping_address.line1string
data[].shipping_address.line2string
data[].shipping_address.postal_codestring
data[].shipping_address.citystring
data[].shipping_address.countrystring
data[].shipping_address.phonestring
data[].billing_addressobject
data[].billing_address.namestring
data[].billing_address.line1string
data[].billing_address.line2string
data[].billing_address.postal_codestring
data[].billing_address.citystring
data[].billing_address.countrystring
data[].billing_address.phonestring
data[].lineslist of objects
data[].lines[].idstring (uuid)
data[].lines[].variant_idstring (uuid) or null
data[].lines[].skustring
data[].lines[].titlestring
data[].lines[].quantityinteger
data[].lines[].unit_price_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].lines[].total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].lines[].deliveryone of physical, digital, service
data[].lines[].to_sendintegerUnits still to send.
data[].shipmentslist of objects
data[].shipments[].idstring (uuid)
data[].shipments[].carrierstring
data[].shipments[].tracking_numberstring
data[].shipments[].tracking_urlstring or null
data[].shipments[].created_atstring (date-time)
data[].shipments[].lineslist of objects
data[].shipments[].lines[].line_idstring (uuid)
data[].shipments[].lines[].quantityinteger
data[].tagslist of stringStaff's tags on the order.
data[].updated_atstring (date-time)When it last changed: placed, paid, sent, refunded, edited or noted (its timeline's latest entry).
nextstring or nullThe cursor of the next page, given as ?after=; null on the last page.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/orders' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Get an order

GET https://kaizenaflow.com/api/admin/v1/orders/{id}

One order with its lines, what is left to send, its parcels and tags.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.numberstringThe order's number, one sequence per store.
data.statusone of pending_payment, authorized, paid, fulfilled, closed, cancelled
data.fulfilmentone of none, unsent, partly_sent, sent, withdrawn, closedWhat is sent: none (nothing to send), unsent, partly_sent, sent, withdrawn or closed.
data.copiedbooleanHistory copied from another store: read-only.
data.placed_atstring (date-time)
data.marketstringA market, by its code (the country's ISO 3166-1 code, such as NO).
data.currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data.emailstring
data.subtotal_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.shipping_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.tax_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.paid_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.refunded_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.shipping_addressobject
data.shipping_address.namestring
data.shipping_address.line1string
data.shipping_address.line2string
data.shipping_address.postal_codestring
data.shipping_address.citystring
data.shipping_address.countrystring
data.shipping_address.phonestring
data.billing_addressobject
data.billing_address.namestring
data.billing_address.line1string
data.billing_address.line2string
data.billing_address.postal_codestring
data.billing_address.citystring
data.billing_address.countrystring
data.billing_address.phonestring
data.lineslist of objects
data.lines[].idstring (uuid)
data.lines[].variant_idstring (uuid) or null
data.lines[].skustring
data.lines[].titlestring
data.lines[].quantityinteger
data.lines[].unit_price_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.lines[].total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.lines[].deliveryone of physical, digital, service
data.lines[].to_sendintegerUnits still to send.
data.shipmentslist of objects
data.shipments[].idstring (uuid)
data.shipments[].carrierstring
data.shipments[].tracking_numberstring
data.shipments[].tracking_urlstring or null
data.shipments[].created_atstring (date-time)
data.shipments[].lineslist of objects
data.shipments[].lines[].line_idstring (uuid)
data.shipments[].lines[].quantityinteger
data.tagslist of stringStaff's tags on the order.
data.updated_atstring (date-time)When it last changed: placed, paid, sent, refunded, edited or noted (its timeline's latest entry).

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Send a parcel

POST https://kaizenaflow.com/api/admin/v1/orders/{id}/fulfillments

Records a parcel with its carrier and tracking, as the admin's Send does, and emails the customer unless notify is false. Answers the order as it is now.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
carrierone of posten, bring, porterbuddy, helthjem, instabox, postnord, dhl, dhl_paket, ups, nshift, otheryes
tracking_numberstring, at most 100 charactersno, default ""
tracking_url"" or string (uri)no, default ""The parcel's tracking page; the carrier's own when left out.
lineslist of objects, at most 500 itemsnoWhat is in the parcel; everything still to send when left out.
lines[].line_idstring (uuid)yes
lines[].quantityinteger, 1 to 100,000yes
notifybooleanno, default trueEmail the customer about the parcel, as the admin's Send does.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.numberstringThe order's number, one sequence per store.
data.statusone of pending_payment, authorized, paid, fulfilled, closed, cancelled
data.fulfilmentone of none, unsent, partly_sent, sent, withdrawn, closedWhat is sent: none (nothing to send), unsent, partly_sent, sent, withdrawn or closed.
data.copiedbooleanHistory copied from another store: read-only.
data.placed_atstring (date-time)
data.marketstringA market, by its code (the country's ISO 3166-1 code, such as NO).
data.currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data.emailstring
data.subtotal_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.shipping_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.tax_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.paid_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.refunded_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.shipping_addressobject
data.shipping_address.namestring
data.shipping_address.line1string
data.shipping_address.line2string
data.shipping_address.postal_codestring
data.shipping_address.citystring
data.shipping_address.countrystring
data.shipping_address.phonestring
data.billing_addressobject
data.billing_address.namestring
data.billing_address.line1string
data.billing_address.line2string
data.billing_address.postal_codestring
data.billing_address.citystring
data.billing_address.countrystring
data.billing_address.phonestring
data.lineslist of objects
data.lines[].idstring (uuid)
data.lines[].variant_idstring (uuid) or null
data.lines[].skustring
data.lines[].titlestring
data.lines[].quantityinteger
data.lines[].unit_price_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.lines[].total_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.lines[].deliveryone of physical, digital, service
data.lines[].to_sendintegerUnits still to send.
data.shipmentslist of objects
data.shipments[].idstring (uuid)
data.shipments[].carrierstring
data.shipments[].tracking_numberstring
data.shipments[].tracking_urlstring or null
data.shipments[].created_atstring (date-time)
data.shipments[].lineslist of objects
data.shipments[].lines[].line_idstring (uuid)
data.shipments[].lines[].quantityinteger
data.tagslist of stringStaff's tags on the order.
data.updated_atstring (date-time)When it last changed: placed, paid, sent, refunded, edited or noted (its timeline's latest entry).

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
403gatedThe request needs a power beside the operation's scope (the message names it): changing a product, category or address on the site, an import that would, or a customer's email. A copied order is never changed.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/fulfillments' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"carrier":"posten"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/fulfillments", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "carrier": "posten"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/fulfillments",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "carrier": "posten",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Get an invoice as UBL

GET https://kaizenaflow.com/api/admin/v1/invoices/{id}/ubl

An invoice as an EN 16931 electronic invoice (UBL 2.1), for accounting systems.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.file_namestring
data.content_type"application/xml"
data.xmlstringThe document as EN 16931 UBL 2.1.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/invoices/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/invoices/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/invoices/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Get a credit note as UBL

GET https://kaizenaflow.com/api/admin/v1/credit-notes/{id}/ubl

A credit note as an EN 16931 electronic document (UBL 2.1).

  • Operation: credit_notes.ubl

  • Scope: orders:read, or orders:write, which reads too

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.file_namestring
data.content_type"application/xml"
data.xmlstringThe document as EN 16931 UBL 2.1.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/credit-notes/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/credit-notes/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/credit-notes/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/ubl",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

List an order's refunds

GET https://kaizenaflow.com/api/admin/v1/orders/{id}/refunds

Every refund of the order, newest first, in its own currency.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].order_idstring (uuid)
data[].amount_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data[].currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data[].statusstringpending (on its way), succeeded or failed.
data[].kindstringHow the money went back: to the payment, or as store credit.
data[].restockedbooleanUnits went back in stock with it.
data[].created_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Refund an order

POST https://kaizenaflow.com/api/admin/v1/orders/{id}/refunds

Refunds part or all of what is left through refundOrder(), the admin's own refund: through the payment it was taken by (Stripe, Mollie, or recorded for money taken outside), or as store credit; units put back in stock where they came from. Needs orders:refund.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
amount_minorinteger, at least 0yesWhat goes back, in minor units of the order's currency; 0 to put units back in stock only.
reasonstring, 1 to 500 charactersno, default "Refund"Why, for the order's history and the credit note.
restocklist of objects, at most 500 itemsno, default []Units put back in stock, per order line.
restock[].line_idstring (uuid)yes
restock[].quantityinteger, 1 to 100,000yes
restock[].location_idstring (uuid) or nullnoWhere they go back; where they were taken from when left out.
not_sentbooleanno, default falseThe units put back were never sent: they come off what is still to send.
to_store_creditbooleanno, default falseGive the amount as store credit (D364), emailed to the order's address, instead of to the payment.
notifybooleanno, default trueEmail the customer about the refund, as the admin's Refund does (store credit is emailed either way).

Answer

FieldTypeDescription
dataobject
data.refund_idslist of string (uuid)Every refund made: an amount split over the order's payments makes one each.
data.amount_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.statusstring or null
data.closed_unitsintegerUnits taken off what was still to send (not_sent).
data.store_creditobject or nullStore credit issued; its code goes only to the customer.
data.store_credit.card_idstring (uuid)
data.store_credit.amount_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.store_credit.emailedone of sent, failed

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
403gatedThe request needs a power beside the operation's scope (the message names it): changing a product, category or address on the site, an import that would, or a customer's email. A copied order is never changed.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"amount_minor":1}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount_minor": 1
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/refunds",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "amount_minor": 1,
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Cancel an unpaid order

POST https://kaizenaflow.com/api/admin/v1/orders/{id}/cancel

Cancels an order waiting for payment: its payment page is closed first (one found paid is refused), its stock goes back and its pay link dies. A paid order is refunded instead (orders:refund).

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
reasonstring, at most 500 charactersno, default "Cancelled by the store"Why, for the order's history.
notifybooleanno, default falseEmail the customer that the order is cancelled.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.status"cancelled"

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
403gatedThe request needs a power beside the operation's scope (the message names it): changing a product, category or address on the site, an import that would, or a customer's email. A copied order is never changed.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/cancel' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Cancelled by the store"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/cancel", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "reason": "Cancelled by the store"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/cancel",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "reason": "Cancelled by the store",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

List an order's notes

GET https://kaizenaflow.com/api/admin/v1/orders/{id}/notes

Staff's notes on the order, newest first.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
datalist of objects
data[].notestring
data[].bystringWho wrote it: a person's email, or the token's name.
data[].created_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Add a note to an order

POST https://kaizenaflow.com/api/admin/v1/orders/{id}/notes

Adds a note for staff to the order's history, as the order page does; the customer never sees it.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
notestring, 1 to 2,000 charactersyesA note for staff; the customer never sees it.

Answer

FieldTypeDescription
dataobject
data.notestring
data.bystringWho wrote it: a person's email, or the token's name.
data.created_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
403gatedThe request needs a power beside the operation's scope (the message names it): changing a product, category or address on the site, an import that would, or a customer's email. A copied order is never changed.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"Counted on Monday"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "note": "Counted on Monday"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/notes",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "note": "Counted on Monday",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Tag an order

POST https://kaizenaflow.com/api/admin/v1/orders/{id}/tags

Adds a tag to the order (at most 250 an order); one it has is kept once. Answers its tags.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
tagstring, 1 to 120 charactersyesThe tag's words; one the order has is kept once.

Answer

FieldTypeDescription
dataobject
data.tagslist of string

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tag":"vip"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "tag": "vip"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "tag": "vip",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Remove an order's tag

DELETE https://kaizenaflow.com/api/admin/v1/orders/{id}/tags/{tag}

Takes a tag off the order, named as it is written in any case. Answers its tags.

  • Operation: orders.untag

  • Scope: orders:manage

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.
tagstring, 1 to 200 charactersyesThe tag's words, URL-encoded.

Answer

FieldTypeDescription
dataobject
data.tagslist of string

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X DELETE 'https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags/vip' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags/vip", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/orders/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags/vip",
    method="DELETE",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?