Skip to content

settings

E-commerce settings

Overview

k.commerce.settings provides operations related to global e-commerce settings and is used to obtain configuration information such as currency, payment, logistics, and notifications.

currencyCode

Get currency code.

ts
k.api.get(() => {
    return k.commerce.settings.currencyCode
})

Return: string (like "CNY")

currencySymbol

Get currency symbol.

ts
k.api.get(() => {
    return k.commerce.settings.currencySymbol
})

Return: string (like "CN¥")

weightUnit

Get the weight unit.

ts
k.api.get(() => {
    return k.commerce.settings.weightUnit
})

Return: string (like "kg")

payments

Get a list of payment methods.

ts
k.api.get(() => {
    return k.commerce.settings.payments
})

Return: string[]

earnPoint

Get points to get configuration.

ts
k.api.get(() => {
    return k.commerce.settings.earnPoint
})

Return: EarnPointSettings

redeemPoint

Get points deduction rules.

ts
k.api.get(() => {
    return k.commerce.settings.redeemPoint
})

Return: RedeemPointSettings

orderExtensionFields

Get the order extension field configuration.

ts
k.api.get(() => {
    return k.commerce.settings.orderExtensionFields
})

Return: ExtensionField[]

productCustomFields

Get product custom field configuration.

ts
k.api.get(() => {
    return k.commerce.settings.productCustomFields
})

Return: CustomField[]

hideAttributes

Get whether the attribute is hidden.

ts
k.api.get(() => {
    return k.commerce.settings.hideAttributes
})

Return: boolean

hideVariants

Get whether to hide specifications.

ts
k.api.get(() => {
    return k.commerce.settings.hideVariants
})

Return: boolean

customMailServer

Get custom mail server configuration.

ts
k.api.get(() => {
    return k.commerce.settings.customMailServer
})

Return: MailServer

mailServerType

Get the mail server type.

ts
k.api.get(() => {
    return k.commerce.settings.mailServerType
})

Return: "kooboo" | "custom"

koobooEmailAddress

Get a Kooboo email address.

ts
k.api.get(() => {
    return k.commerce.settings.koobooEmailAddress
})

Return: string

enableEmailNotification

Gets whether email notifications are enabled.

ts
k.api.get(() => {
    return k.commerce.settings.enableEmailNotification
})

Return: boolean

emailNotifications

Get the email notification configuration list.

ts
k.api.get(() => {
    return k.commerce.settings.emailNotifications
})

Return: EmailNotification[]

enableWebhook

Gets whether webhooks are enabled.

ts
k.api.get(() => {
    return k.commerce.settings.enableWebhook
})

Return: boolean

webhooks

Get a list of webhook configurations.

ts
k.api.get(() => {
    return k.commerce.settings.webhooks
})

Return: Webhook[]

webhookSecret

Get the webhook key.

ts
k.api.get(() => {
    return k.commerce.settings.webhookSecret
})

Return: string

structure

Settings property

k.commerce.settings returns the complete e-commerce settings object, including the following attributes:

PropertyDescriptionType
currencyCodecurrency codestring
currencySymbolcurrency symbolstring
weightUnitweight unitstring
earnPointPoints acquisition configurationEarnPointSettings
redeemPointPoints deduction configurationRedeemPointSettings
shippingCostfreightnumber
paymentsPayment method liststring[]
productCustomFieldsProduct custom fieldsCustomField[]
categoryCustomFieldsClassification custom fieldsCustomField[]
orderExtensionFieldsOrder extension fieldsExtensionField[]
enableEmailNotificationWhether to enable email notificationsboolean
customMailServerCustom mail serverMailServer
koobooEmailAddressKooboo email addressstring
mailServerTypeMail server typestring
emailNotificationsEmail notification listEmailNotification[]
enableWebhookWhether to enable webhooksboolean
webhooksWebhook configuration listWebhook[]
webhookSecretWebhook keystring
hideAttributesWhether to hide attributesboolean
hideVariantsWhether to hide specificationsboolean
productDigitalItemRequiredIs digital product required?boolean

EarnPointSettings Property

PropertyDescriptionType
activeDurationUnitPoints valid time unitstring
activeDurationPoints valid time valuenumber
orderEarnRulesOrder earning rulesOrderEarnPointsRule
loginEarnRulesLogin to earn rulesLoginEarnPointsRule

RedeemPointSettings Property

PropertyDescriptionType
exchangeRateExchange rationumber
orderRedeemRulesOrder deduction rulesOrderRedeemPointsRule

OrderEarnPointsRule Property

PropertyDescriptionType
valueEarn points valuenumber
isPercentWhether it is a percentage of the order amountboolean
descriptionDescriptionstring
conditionconditionCondition

LoginEarnPointsRule Property

PropertyDescriptionType
valueEarn points valuenumber
durationUnitPoints valid time unitstring
descriptionDescriptionstring
conditionconditionCondition

OrderRedeemPointsRule Property

PropertyDescriptionType
valueDeduction point valuenumber
isPercentWhether it is a percentage of the order amountboolean
descriptionDescriptionstring
conditionconditionCondition

Condition property

PropertyDescriptionType
isAnyAny condition can be metboolean
itemsList of conditional itemsConditionItem

ConditionItem Property

PropertyDescriptionType
optionCondition optionsstring
Methodconditional methodstring
valuecondition valuestring

ExtensionField Property

PropertyDescriptionType
nameField namestring
displayNamedisplay namestring
Typetypestring
editableIs it editable?boolean
exportableIs it exportable?boolean
filterableIs it filterable?boolean
isSelectionWhether it is a selection typeboolean

Webhook properties

PropertyDescriptionType
eventevent typestring
urlWebhook URLstring

EmailNotification Property

PropertyDescriptionType
IDNotification IDstring
eventevent typestring
subjectTemplateEmail subject templatestring
bodyTemplateEmail content templatestring
sendToCustomerWhether to send to customersboolean
sendToAddressesSend address liststring[]

MailServer Properties

PropertyDescriptionType
serverServer addressstring
portportnumber
sslWhether to enable SSLboolean
fromSender addressstring
userNameusernamestring
passwordpasswordstring