Customers
Customer accounts and their tags.
| Operation | Method and path | Scope |
|---|---|---|
| List customers | GET /customers | customers:read |
| Get a customer | GET /customers/{id} | customers:read |
| Tag a customer | POST /customers/{id}/tags | customers:write |
| Remove a customer's tag | DELETE /customers/{id}/tags/{tag} | customers:write |
| Send an event about a subscriber | POST /events | customers:manage |
| Create a customer | POST /customers | customers:manage |
| Change a customer | PATCH /customers/{id} | customers:manage |
| Get a customer's store credit | GET /customers/{id}/store-credit | customers:read |
| Get a customer's bonus credits | GET /customers/{id}/loyalty | customers:read |
List customers
GET https://kaizenaflow.com/api/admin/v1/customers
The store's customer accounts, newest first, with their tags.
Operation:
customers.listScope:
customers:read, orcustomers:write, which reads tooAnswers:
200, a page: the rows underdata, andnextfor the page after.Pages: at most 100 rows, 50 when
limitis left out; give an answer'snextas?after=for the page after.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer, 1 to 100 | no | Rows a page holds, at most 100; 50 when left out. A larger number gives 100. |
after | string, at most 200 characters | no | The next cursor of the page before; the first page when left out. |
updated_after | string (date-time) | no | Only what was made or changed after this time (ISO 8601 with its offset), for incremental sync. |
email | string, at most 254 characters | no | Only the customer with this email, in any case (D440: find by email). |
Answer
| Field | Type | Description |
|---|---|---|
data | list of objects | |
data[].id | string (uuid) | |
data[].email | string | |
data[].name | string | |
data[].phone | string | |
data[].email_verified | boolean | |
data[].tags | list of string | |
data[].created_at | string (date-time) | |
data[].updated_at | string (date-time) | |
next | string or null | The cursor of the next page, given as ?after=; null on the last page. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 422 | invalid | Nothing 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. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers", {
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/customers",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Get a customer
GET https://kaizenaflow.com/api/admin/v1/customers/{id}
One customer account with its tags.
Operation:
customers.getScope:
customers:read, orcustomers:write, which reads tooAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.email | string | |
data.name | string | |
data.phone | string | |
data.email_verified | boolean | |
data.tags | list of string | |
data.created_at | string (date-time) | |
data.updated_at | string (date-time) |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers/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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Tag a customer
POST https://kaizenaflow.com/api/admin/v1/customers/{id}/tags
Adds a tag to the customer, as the customer's page does. Segments and discounts can then use it.
Operation:
customers.tagScope:
customers:writeAnswers:
201, made: the answer underdata.Once only: with an
Idempotency-Keyheader.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
tag | string, 1 to 200 characters | yes | The tag's words: at most 40 characters and no comma. A tag the customer has is kept once. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.added | true |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | conflict | Nothing 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. |
| 422 | invalid | Nothing 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. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers/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/customers/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/customers/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 a customer's tag
DELETE https://kaizenaflow.com/api/admin/v1/customers/{id}/tags/{tag}
Takes a tag off the customer; the tag is named as it is written, in any case.
Operation:
customers.untagScope:
customers:writeAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
tag | string, 1 to 200 characters | yes | The tag's words, URL-encoded. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.removed | true |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/tags/vip' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers/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/customers/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)Send an event about a subscriber
POST https://kaizenaflow.com/api/admin/v1/events
Tells the store that something happened to a person on its subscriber list in your app (a course finished, a trial ended). It is kept in the store's event log as custom.{name}, with the subscriber's id and never the address, and a flow may start on it. Refused as not_found when no subscriber has the address.
Operation:
events.createScope:
customers:manageAnswers:
201, made: the answer underdata.Once only: with an
Idempotency-Keyheader.
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
name | string, matching ^[a-z][a-z0-9_]{0,39}$ | yes | The event's name, such as course_finished: lower-case letters, digits and _, starting with a letter, at most 40. |
email | string, 3 to 254 characters | yes | The address of the person it is about: someone on the store's subscriber list. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.event | string | The name kept: custom.{name}. |
data.subscriber_id | string (uuid) | |
data.subscribed | boolean | Whether they are subscribed now: only they enter flows. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | conflict | Nothing 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. |
| 422 | invalid | Nothing 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. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/events' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"course_finished","email":"ada@example.com"}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/events", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "course_finished",
"email": "ada@example.com"
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/events",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"name": "course_finished",
"email": "ada@example.com",
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Create a customer
POST https://kaizenaflow.com/api/admin/v1/customers
Adds a customer account through the customer page's own writer: refused as conflict when the email is a customer of the store already.
Operation:
customers.createScope:
customers:manageAnswers:
201, made: the answer underdata.Once only: with an
Idempotency-Keyheader.
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
email | string, 3 to 254 characters | yes | Their email: an account with no password, signed into with a code sent there. |
name | string, at most 200 characters | no | |
phone | string, at most 40 characters | no | |
address | object or null | no | The customer's address; null takes it away. |
address.line1 | string, at most 200 characters | yes | |
address.line2 | string, at most 200 characters | no | |
address.postal_code | string, at most 20 characters | yes | |
address.city | string, at most 100 characters | yes | |
address.country | string, matching ^[A-Z]{2}$ | yes | An ISO 3166-1 code, such as NO. |
company_name | string, at most 200 characters or null | no | |
organisation_number | string, at most 40 characters or null | no | A company's number, checked by its country's rule; given with company_name. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.email | string | |
data.name | string | |
data.phone | string | |
data.email_verified | boolean | |
data.tags | list of string | |
data.created_at | string (date-time) | |
data.updated_at | string (date-time) |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 409 | conflict | Nothing 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. |
| 422 | invalid | Nothing 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. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"ada@example.com"}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "ada@example.com"
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/customers",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"email": "ada@example.com",
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Change a customer
PATCH https://kaizenaflow.com/api/admin/v1/customers/{id}
Changes only what is given of the customer's name, email, phone, address and company, through the customer page's own writer. The email is what the customer signs in with: changing it takes the power customers:email too (else gated).
Operation:
customers.updateScope:
customers:manageAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
email | string, 3 to 254 characters | no | A changed email is unproven again; the person's tags and notes move with it. |
name | string, at most 200 characters | no | |
phone | string, at most 40 characters | no | |
address | object or null | no | The customer's address; null takes it away. |
address.line1 | string, at most 200 characters | yes | |
address.line2 | string, at most 200 characters | no | |
address.postal_code | string, at most 20 characters | yes | |
address.city | string, at most 100 characters | yes | |
address.country | string, matching ^[A-Z]{2}$ | yes | An ISO 3166-1 code, such as NO. |
company_name | string, at most 200 characters or null | no | |
organisation_number | string, at most 40 characters or null | no | A company's number, checked by its country's rule; given with company_name. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.id | string (uuid) | |
data.email | string | |
data.name | string | |
data.phone | string | |
data.email_verified | boolean | |
data.tags | list of string | |
data.created_at | string (date-time) | |
data.updated_at | string (date-time) |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 403 | gated | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | conflict | Nothing 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. |
| 422 | invalid | Nothing 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. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl -X PATCH 'https://kaizenaflow.com/api/admin/v1/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"ada@example.com"}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "ada@example.com"
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
method="PATCH",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"email": "ada@example.com",
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Get a customer's store credit
GET https://kaizenaflow.com/api/admin/v1/customers/{id}/store-credit
The store credit a customer was given from refunds (D364), each card with its balance; never a code.
Operation:
customers.store_creditScope:
customers:read, orcustomers:write, which reads tooAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.customer_id | string (uuid) | |
data.cards | list of objects | Store credit issued to the customer from refunds, as gift cards of the store's. |
data.cards[].id | string (uuid) | |
data.cards[].last4 | string or null | The code's last four characters, to tell cards apart. The code itself is never answered after it is issued. |
data.cards[].currency | string, matching ^[A-Z]{3}$ | An ISO 4217 code, such as NOK or EUR. |
data.cards[].initial_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
data.cards[].balance_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
data.cards[].state | one of active, waiting, spent, expired, deactivated | active, waiting (not delivered yet), spent, expired or deactivated. |
data.cards[].source | one of order, staff, refund | Bought with an order, issued by staff (or here), or store credit from a refund (D364). |
data.cards[].test | boolean | A card of the store's test mode, spent only in test mode. |
data.cards[].issued_at | string (date-time) | |
data.cards[].expires_at | string (date-time) or null | |
data.balances | list of objects | What the customer holds per currency on live cards. |
data.balances[].currency | string, matching ^[A-Z]{3}$ | An ISO 4217 code, such as NOK or EUR. |
data.balances[].amount_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/store-credit' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/store-credit", {
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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/store-credit",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Get a customer's bonus credits
GET https://kaizenaflow.com/api/admin/v1/customers/{id}/loyalty
The customer's bonus credits (D130): usable now, waiting, and the latest entries, in the program's currency.
Operation:
customers.loyaltyScope:
customers:read, orcustomers:write, which reads tooAnswers:
200, the answer underdata.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.customer_id | string (uuid) | |
data.currency | string, matching ^[A-Z]{3}$ | An ISO 4217 code, such as NOK or EUR. |
data.available_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
data.pending_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
data.entries | list of objects | |
data.entries[].id | string | |
data.entries[].kind | string | |
data.entries[].amount_minor | integer | |
data.entries[].at | string (date-time) | |
data.entries[].available_at | string (date-time) or null | |
data.entries[].expires_at | string (date-time) or null | |
data.entries[].order_id | string (uuid) or null |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | feature_off | The store has switched off the feature the operation stands behind (Settings, Store features); the message names it. |
| 403 | forbidden | The 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. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something 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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/loyalty' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/loyalty", {
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/customers/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/loyalty",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)