Skip to content
Kaizena FlowDocs
Search

Search the docs

Customers

Customer accounts and their tags.

OperationMethod and pathScope
List customersGET /customerscustomers:read
Get a customerGET /customers/{id}customers:read
Tag a customerPOST /customers/{id}/tagscustomers:write
Remove a customer's tagDELETE /customers/{id}/tags/{tag}customers:write
Send an event about a subscriberPOST /eventscustomers:manage
Create a customerPOST /customerscustomers:manage
Change a customerPATCH /customers/{id}customers:manage
Get a customer's store creditGET /customers/{id}/store-creditcustomers:read
Get a customer's bonus creditsGET /customers/{id}/loyaltycustomers:read

List customers

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

The store's customer accounts, newest first, with their tags.

  • Operation: customers.list

  • Scope: customers:read, or customers: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.
emailstring, at most 254 charactersnoOnly the customer with this email, in any case (D440: find by email).

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].emailstring
data[].namestring
data[].phonestring
data[].email_verifiedboolean
data[].tagslist of string
data[].created_atstring (date-time)
data[].updated_atstring (date-time)
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/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.

Path parameters

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

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.emailstring
data.namestring
data.phonestring
data.email_verifiedboolean
data.tagslist of string
data.created_atstring (date-time)
data.updated_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/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.

Path parameters

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

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
tagstring, 1 to 200 charactersyesThe tag's words: at most 40 characters and no comma. A tag the customer has is kept once.

Answer

FieldTypeDescription
dataobject
data.addedtrue

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/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.untag

  • Scope: customers:write

  • 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.removedtrue

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/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.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
namestring, matching ^[a-z][a-z0-9_]{0,39}$yesThe event's name, such as course_finished: lower-case letters, digits and _, starting with a letter, at most 40.
emailstring, 3 to 254 charactersyesThe address of the person it is about: someone on the store's subscriber list.

Answer

FieldTypeDescription
dataobject
data.eventstringThe name kept: custom.{name}.
data.subscriber_idstring (uuid)
data.subscribedbooleanWhether they are subscribed now: only they enter flows.

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/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.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
emailstring, 3 to 254 charactersyesTheir email: an account with no password, signed into with a code sent there.
namestring, at most 200 charactersno
phonestring, at most 40 charactersno
addressobject or nullnoThe customer's address; null takes it away.
address.line1string, at most 200 charactersyes
address.line2string, at most 200 charactersno
address.postal_codestring, at most 20 charactersyes
address.citystring, at most 100 charactersyes
address.countrystring, matching ^[A-Z]{2}$yesAn ISO 3166-1 code, such as NO.
company_namestring, at most 200 characters or nullno
organisation_numberstring, at most 40 characters or nullnoA company's number, checked by its country's rule; given with company_name.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.emailstring
data.namestring
data.phonestring
data.email_verifiedboolean
data.tagslist of string
data.created_atstring (date-time)
data.updated_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.
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/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.update

  • Scope: customers:manage

  • Answers: 200, the answer under data.

Path parameters

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

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
emailstring, 3 to 254 charactersnoA changed email is unproven again; the person's tags and notes move with it.
namestring, at most 200 charactersno
phonestring, at most 40 charactersno
addressobject or nullnoThe customer's address; null takes it away.
address.line1string, at most 200 charactersyes
address.line2string, at most 200 charactersno
address.postal_codestring, at most 20 charactersyes
address.citystring, at most 100 charactersyes
address.countrystring, matching ^[A-Z]{2}$yesAn ISO 3166-1 code, such as NO.
company_namestring, at most 200 characters or nullno
organisation_numberstring, at most 40 characters or nullnoA company's number, checked by its country's rule; given with company_name.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.emailstring
data.namestring
data.phonestring
data.email_verifiedboolean
data.tagslist of string
data.created_atstring (date-time)
data.updated_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 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.

Path parameters

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

Answer

FieldTypeDescription
dataobject
data.customer_idstring (uuid)
data.cardslist of objectsStore credit issued to the customer from refunds, as gift cards of the store's.
data.cards[].idstring (uuid)
data.cards[].last4string or nullThe code's last four characters, to tell cards apart. The code itself is never answered after it is issued.
data.cards[].currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data.cards[].initial_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.cards[].balance_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.cards[].stateone of active, waiting, spent, expired, deactivatedactive, waiting (not delivered yet), spent, expired or deactivated.
data.cards[].sourceone of order, staff, refundBought with an order, issued by staff (or here), or store credit from a refund (D364).
data.cards[].testbooleanA card of the store's test mode, spent only in test mode.
data.cards[].issued_atstring (date-time)
data.cards[].expires_atstring (date-time) or null
data.balanceslist of objectsWhat the customer holds per currency on live cards.
data.balances[].currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data.balances[].amount_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.

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/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.

Path parameters

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

Answer

FieldTypeDescription
dataobject
data.customer_idstring (uuid)
data.currencystring, matching ^[A-Z]{3}$An ISO 4217 code, such as NOK or EUR.
data.available_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.pending_minorintegerAn amount in minor units of the currency (øre, cents), VAT included where the store's prices are.
data.entrieslist of objects
data.entries[].idstring
data.entries[].kindstring
data.entries[].amount_minorinteger
data.entries[].atstring (date-time)
data.entries[].available_atstring (date-time) or null
data.entries[].expires_atstring (date-time) or null
data.entries[].order_idstring (uuid) or null

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403feature_offThe store has switched off the feature the operation stands behind (Settings, Store features); the message names it.
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/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)

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

Was this page helpful?