Overview
The Settings Module is a configuration management system that allows you to customize and manage various settings related to your organization's operations, account management, item management, order processing, transaction handling, and portal configurations. It provides a centralized interface to manage different aspects of the application, from general organizational information to detailed preferences for items, accounts, orders, and transactions.
Common Import Requirements
The following imports are required when working with any settings-related functions in both Python and PHP
from exsited.exsited.account.dto.account_dto import AccountDataDTO, AccountContactUpdateDTO
from exsited.exsited.exsited_sdk import ExsitedSDK
from exsited.common.ab_exception import ABException
from exsited.common.sdk_conf import SDKConfig
from config import CommonData
use Api\Component\ApiConfig;
use Api\AppService\Setting\SettingData;
use Api\ApiHelper\Config\ConfigManager;
Function: getAllSettings
Purpose
The getAllSettings()
function retrieves system or account settings from Exsited's platform. It provides essential configuration details such as account settings, API limits, and environment-specific configurations.
Parameters
Parameter | Type | Description |
---|---|---|
None | N/A | The function does not require any input parameters. |
Use Case
This function is useful for accessing critical system or account settings, such as verifying API rate limits, retrieving general account configurations, or debugging environment-specific configurations.
def get_all_settings():
# Enable detailed request and response logging
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
# Initialize SDK with authentication details
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
# Fetch settings from Exsited
response = exsited_sdk.setting.get_settings()
print(response)
except ABException as ab:
# Handle API errors
print(ab)
print(ab.get_errors())
print(ab.raw_response)
# Run the test
test_get_settings()
private $settingService;
public function getAllSettings()
{
try {
// Fetch settings from Exsited
$response = $this->settingService->readAll();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
// Handle errors
echo 'Error: ' . $e->getMessage();
}
}
// Call the function
$settingManager->testReadAll();
Response
The getAllSettings()
function retrieves system or account settings, and the expected response typically includes configuration data in a structured format. Below is an example of what the response may look like in both Python and PHP.
"settings": {
"organisation": {
"name": "EEEE4",
"description": "",
"image_uri": "https://app-stage.exsited.com/images/default/default-all.png",
"email_address": "",
"post_code": "3000",
"state": "Victoria",
"country": "Australia"
},
"general_settings": {
"date_and_time": {
"time_zone": "(GMT+09:30) Australia/Adelaide",
"date_format": "17/11/24",
"time_format": "03:51 PM",
"first_day_of_week": "Monday"
},
"account": {
"account_grouping": {
"enabled": True,
"default_group": ""
},
"referral_tracking_at_account_level": {
"enabled": True,
"default_referral_tracking": ""
},
"sales_rep_tracking_at_account_level": {
"enabled": True,
"default_sales_rep_tracking": "1salesrep"
}
},
"item": {
"enable_variation_based_item": True,
"enable_gift_certificate_based_item": True,
"item_grouping": {
"enabled": True,
"default_group": ""
}
},
"order": {
"order_management": {
"enabled": True,
"default_manager": ""
},
"enable_order_backdating": True
},
"transaction": {
"enable_discount_profile": True
},
"security_settings": {
"enable_tfa": False
},
"portal": {
"enable_portal_login": True,
"customer_portal_url": "https://00000000.autobill-portal.com"
}
}
}
{
"settings": {
"organisation": {
"name": "EEEE4",
"description": "",
"image_uri": "https://app-stage.exsited.com/images/default/default-all.png",
"email_address": "",
"post_code": "3000",
"state": "Victoria",
"country": "Australia"
},
"general_settings": {
"date_and_time": {
"time_zone": "(GMT+09:30) Australia/Adelaide",
"date_format": "17/11/24",
"time_format": "03:51 PM",
"first_day_of_week": "Monday"
},
"account": {
"account_grouping": {"enabled": "true"},
"referral_tracking_at_account_level": {"enabled": "true"},
"sales_rep_tracking_at_account_level": {"enabled": "true"}
},
"item": {
"enable_variation_based_item": "true",
"item_grouping": {"enabled": "true"}
},
"order": {
"order_management": {"enabled": "true"},
"enable_order_backdating": "true"
},
"transaction": {
"enable_discount_profile": "true"
},
"security_settings": {
"enable_tfa": "false"
},
"portal": {
"enable_portal_login": "true",
"customer_portal_url": "https://00000000.autobill-portal.com"
}
}
}
}
Function: readSettingsPaymentProcessors
Purpose
The readSettingsPaymentProcessors()
function retrieves a list of available payment processors configured in the system settings. This is typically used to review or validate the payment gateways supported by the system.
Parameters
This function does not require any parameters.
Use Case
This function is used to fetch a list of payment processors enabled for the system, validate integration settings during setup, and confirm active processors for troubleshooting or reporting purposes.
def read_settings_payment_processors():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_payment_processor()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readSettingsPaymentProcessors()
{
try {
$response = $this->settingService->readPaymentProcessors();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of configured payment processors, including their details like name, status, and configurations.
SettingPaymentProcessorListDTO(
paymentProcessors=[
PaymentProcessorDTO(
uuid='processor_uuid_1',
status='processor_status_1',
default='is_default_1',
name='processor_name_1',
displayName='display_name_1',
description='description_1',
provider='provider_1',
currency='currency_1'
),
PaymentProcessorDTO(
uuid='processor_uuid_2',
status='processor_status_2',
default='is_default_2',
name='processor_name_2',
displayName='display_name_2',
description='description_2',
provider='provider_2',
currency='currency_2'
),
PaymentProcessorDTO(
uuid='processor_uuid_3',
status='processor_status_3',
default='is_default_3',
name='processor_name_3',
displayName='display_name_3',
description='description_3',
provider='provider_3',
currency='currency_3'
),
PaymentProcessorDTO(
uuid='processor_uuid_4',
status='processor_status_4',
default='is_default_4',
name='processor_name_4',
displayName='display_name_4',
description='description_4',
provider='provider_4',
currency='currency_4'
)
]
)
{
"payment_processors": [
{
"uuid": "processor_uuid_1",
"status": "processor_status_1",
"default": "is_default_1",
"name": "processor_name_1",
"display_name": "display_name_1",
"description": "description_1",
"provider": "provider_1",
"currency": "currency_1"
},
{
"uuid": "processor_uuid_2",
"status": "processor_status_2",
"default": "is_default_2",
"name": "processor_name_2",
"display_name": "display_name_2",
"description": "description_2",
"provider": "provider_2",
"currency": "currency_2"
},
{
"uuid": "processor_uuid_3",
"status": "processor_status_3",
"default": "is_default_3",
"name": "processor_name_3",
"display_name": "display_name_3",
"description": "description_3",
"provider": "provider_3",
"currency": "currency_3"
},
{
"uuid": "processor_uuid_4",
"status": "processor_status_4",
"default": "is_default_4",
"name": "processor_name_4",
"display_name": "display_name_4",
"description": "description_4",
"provider": "provider_4",
"currency": "currency_4"
}
]
}
Function: readSettingsPricingLevels
Purpose
The readSettingsPricingLevels()
function retrieves the pricing levels configured in the application settings. Pricing levels help define tiers or categories for item pricing, such as wholesale, retail, and promotional pricing.
Parameters
This function does not require input parameters.
Use Case
- Fetching all pricing levels for display in a UI component.
- Verifying existing pricing levels for business analysis or validation.
- Integrating pricing levels into other workflows like invoicing or discount application.
def read_settings_pricing_levels():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_pricing_levels()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readSettingsPricingLevels()
{
try {
$response = $this->settingService->readPricingLevels();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains a list of all pricing levels, including their IDs, names, and any associated details like descriptions or statuses.
ItemGroupListDTO(
itemGroup=[
ItemGroupDTO(
uuid="UUID",
status="STATUS",
name="NAME",
displayName="DISPLAY_NAME",
description="DESCRIPTION",
imageUri="IMAGE_URI",
manager="MANAGER",
billingPreferences=BillingPreferencesDTO(
communicationProfile="COMMUNICATION_PROFILE",
invoiceMode="INVOICE_MODE",
invoiceTerm="INVOICE_TERM",
billingPeriod="BILLING_PERIOD
billingStartDate="BILLING_START_DATE",
billingStartDayOfMonth="BILLING_START_DAY",
paymentProcessor="PAYMENT_PROCESSOR",
paymentMode="PAYMENT_MODE",
paymentTerm="PAYMENT_TERM",
paymentTermAlignment="PAYMENT_TERM_ALIGNMENT"
)
)
]
)
{
"pricing_levels": [
{
"uuid": "PRICING_LEVEL_UUID_1",
"status": "STATUS_1",
"name": "PRICING_LEVEL_NAME_1",
"display_name": "PRICING_LEVEL_DISPLAY_NAME_1",
"description": "PRICING_LEVEL_DESCRIPTION_1"
},
{
"uuid": "PRICING_LEVEL_UUID_2",
"status": "STATUS_2",
"name": "PRICING_LEVEL_NAME_2",
"display_name": "PRICING_LEVEL_DISPLAY_NAME_2",
"description": "PRICING_LEVEL_DESCRIPTION_2"
},
{
"uuid": "PRICING_LEVEL_UUID_3",
"status": "STATUS_3",
"name": "PRICING_LEVEL_NAME_3",
"display_name": "PRICING_LEVEL_DISPLAY_NAME_3",
"description": "PRICING_LEVEL_DESCRIPTION_3"
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "RECORDS_LIMIT",
"offset": "RECORDS_OFFSET",
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
Function: readCurrenciesInformation
Purpose
The readCurrenciesInformation
function retrieves the list of available currencies configured in the system. This is essential for applications that support multi-currency transactions or display prices in different currencies.
Parameters
This function does not require input parameters.
Use Case
- Displaying available currencies in a dropdown for transaction purposes.
- Managing multi-currency pricing or financial reporting.
- Validating system currency configurations during setup or maintenance.
def read_currencies_information():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_currencies()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readCurrenciesInformation()
{
try {
$response = $this->settingService->readCurrencies();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The response contains a list of currencies with details such as currency codes, names, and symbols.
{
"currencies": [
{
"uuid": "CURRENCY_UUID_1",
"status": "CURRENCY_STATUS_1",
"name": "CURRENCY_NAME_1",
"displayName": "CURRENCY_DISPLAY_NAME_1",
"country": "CURRENCY_COUNTRY_1",
"symbol": "CURRENCY_SYMBOL_1",
"currencyCode": "CURRENCY_CODE_1",
"precision": "CURRENCY_PRECISION_1",
"rounding": "CURRENCY_ROUNDING_1",
"cashRoundingInterval": "CURRENCY_CASH_ROUNDING_INTERVAL_1"
},
{
"uuid": "CURRENCY_UUID_2",
"status": "CURRENCY_STATUS_2",
"name": "CURRENCY_NAME_2",
"displayName": "CURRENCY_DISPLAY_NAME_2",
"country": "CURRENCY_COUNTRY_2",
"symbol": "CURRENCY_SYMBOL_2",
"currencyCode": "CURRENCY_CODE_2",
"precision": "CURRENCY_PRECISION_2",
"rounding": "CURRENCY_ROUNDING_2",
"cashRoundingInterval": "CURRENCY_CASH_ROUNDING_INTERVAL_2"
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "RECORDS_LIMIT",
"offset": "RECORDS_OFFSET",
"previousPage": "PREVIOUS_PAGE_URL",
"nextPage": "NEXT_PAGE_URL"
}
}
{
"currencies": [
{
"uuid": "CURRENCY_UUID_1",
"status": "CURRENCY_STATUS_1",
"name": "CURRENCY_NAME_1",
"display_name": "CURRENCY_DISPLAY_NAME_1",
"country": "CURRENCY_COUNTRY_1",
"symbol": "CURRENCY_SYMBOL_1",
"currency_code": "CURRENCY_CODE_1",
"precision": "CURRENCY_PRECISION_1",
"rounding": "CURRENCY_ROUNDING_1",
"cash_rounding_interval": "CURRENCY_CASH_ROUNDING_INTERVAL_1"
},
{
"uuid": "CURRENCY_UUID_2",
"status": "CURRENCY_STATUS_2",
"name": "CURRENCY_NAME_2",
"display_name": "CURRENCY_DISPLAY_NAME_2",
"country": "CURRENCY_COUNTRY_2",
"symbol": "CURRENCY_SYMBOL_2",
"currency_code": "CURRENCY_CODE_2",
"precision": "CURRENCY_PRECISION_2",
"rounding": "CURRENCY_ROUNDING_2",
"cash_rounding_interval": "CURRENCY_CASH_ROUNDING_INTERVAL_2"
}
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "RECORDS_LIMIT",
"offset": "RECORDS_OFFSET",
"previous_page": "PREVIOUS_PAGE_URL",
"next_page": "NEXT_PAGE_URL"
}
}
Function: readItemGroupsFromSettings
Purpose
The readItemGroupsFromSettings()
function retrieves a list of item groups configured in the system settings. This can be used to fetch different categories or groups of items that are available within the system.
Parameters
This function does not require any parameters.
Use Case
This function is typically used to retrieve item groups, which may represent different categories or groupings of items within a system (e.g., product categories, service types). It can be useful when setting up or reviewing system configurations, or during troubleshooting and validation processes.
def read_item_group_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_item_group()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readItemGroupsFromSettings()
{
try {
$response = $this->settingService->readItemGroups();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of item groups, including their details such as name, description, and configuration information.
ItemGroupListDTO(
itemGroup=[
ItemGroupDTO(
uuid='ITEM_GROUP_UUID_1',
status='ITEM_GROUP_STATUS_1',
name='ITEM_GROUP_NAME_1',
displayName='ITEM_GROUP_DISPLAY_NAME_1',
description='ITEM_GROUP_DESCRIPTION_1',
imageUri='ITEM_GROUP_IMAGE_URI_1',
manager='ITEM_GROUP_MANAGER_1',
billingPreferences=BillingPreferencesDTO(
communicationProfile='BILLING_COMMUNICATION_PROFILE_1',
invoiceMode='BILLING_INVOICE_MODE_1',
invoiceTerm='BILLING_INVOICE_TERM_1',
billingPeriod='BILLING_PERIOD_1',
billingStartDate='BILLING_START_DATE_1',
billingStartDayOfMonth='BILLING_START_DAY_OF_MONTH_1',
paymentProcessor='BILLING_PAYMENT_PROCESSOR_1',
paymentMode='BILLING_PAYMENT_MODE_1',
paymentTerm='BILLING_PAYMENT_TERM_1',
paymentTermAlignment='BILLING_PAYMENT_TERM_ALIGNMENT_1'
)
),
ItemGroupDTO(
uuid='ITEM_GROUP_UUID_2',
status='ITEM_GROUP_STATUS_2',
name='ITEM_GROUP_NAME_2',
displayName='ITEM_GROUP_DISPLAY_NAME_2',
description='ITEM_GROUP_DESCRIPTION_2',
imageUri='ITEM_GROUP_IMAGE_URI_2',
manager='ITEM_GROUP_MANAGER_2',
billingPreferences=BillingPreferencesDTO(
communicationProfile='BILLING_COMMUNICATION_PROFILE_2',
invoiceMode='BILLING_INVOICE_MODE_2',
invoiceTerm='BILLING_INVOICE_TERM_2',
billingPeriod='BILLING_PERIOD_2',
billingStartDate='BILLING_START_DATE_2',
billingStartDayOfMonth='BILLING_START_DAY_OF_MONTH_2',
paymentProcessor='BILLING_PAYMENT_PROCESSOR_2',
paymentMode='BILLING_PAYMENT_MODE_2',
paymentTerm='BILLING_PAYMENT_TERM_2',
paymentTermAlignment='BILLING_PAYMENT_TERM_ALIGNMENT_2'
)
)
]
)
{
"item_group": [
{
"uuid": "ITEM_GROUP_UUID_1",
"status": "ITEM_GROUP_STATUS_1",
"name": "ITEM_GROUP_NAME_1",
"display_name": "ITEM_GROUP_DISPLAY_NAME_1",
"description": "ITEM_GROUP_DESCRIPTION_1",
"image_uri": "ITEM_GROUP_IMAGE_URI_1",
"manager": "ITEM_GROUP_MANAGER_1",
"billing_preferences": {
"communication_profile": "BILLING_COMMUNICATION_PROFILE_1",
"invoice_mode": "BILLING_INVOICE_MODE_1",
"invoice_term": "BILLING_INVOICE_TERM_1",
"billing_period": "BILLING_PERIOD_1",
"billing_start_date": "BILLING_START_DATE_1",
"billing_start_day_of_month": "BILLING_START_DAY_OF_MONTH_1",
"payment_processor": "BILLING_PAYMENT_PROCESSOR_1",
"payment_mode": "BILLING_PAYMENT_MODE_1",
"payment_term": "BILLING_PAYMENT_TERM_1",
"payment_term_alignment": "BILLING_PAYMENT_TERM_ALIGNMENT_1"
}
},
{
"uuid": "ITEM_GROUP_UUID_2",
"status": "ITEM_GROUP_STATUS_2",
"name": "ITEM_GROUP_NAME_2",
"display_name": "ITEM_GROUP_DISPLAY_NAME_2",
"description": "ITEM_GROUP_DESCRIPTION_2",
"image_uri": "ITEM_GROUP_IMAGE_URI_2",
"manager": "ITEM_GROUP_MANAGER_2",
"billing_preferences": {
"communication_profile": "BILLING_COMMUNICATION_PROFILE_2",
"invoice_mode": "BILLING_INVOICE_MODE_2",
"invoice_term": "BILLING_INVOICE_TERM_2",
"billing_period": "BILLING_PERIOD_2",
"billing_start_date": "BILLING_START_DATE_2",
"billing_start_day_of_month": "BILLING_START_DAY_OF_MONTH_2",
"payment_processor": "BILLING_PAYMENT_PROCESSOR_2",
"payment_mode": "BILLING_PAYMENT_MODE_2",
"payment_term": "BILLING_PAYMENT_TERM_2",
"payment_term_alignment": "BILLING_PAYMENT_TERM_ALIGNMENT_2"
}
}
]
}
Function: readTaxesFromSettings
Purpose
The readTaxesFromSettings()
function retrieves a list of tax configurations from the system settings. It is useful for accessing details of applicable taxes, including their rates and associated rules.
Parameters
This function does not require any parameters.
Use Case
This function is used to fetch the tax settings configured in the system. Typical use cases include validating tax configurations during system setup, reviewing tax settings for reporting purposes, and troubleshooting tax-related issues.
def read_taxes_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_taxes()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readTaxesFromSettings()
{
try {
$response = $this->settingService->readTaxes();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of tax settings, which may include the tax name, rate, applicable regions, and any additional rules or configurations related to the tax.
TaxesResponseDTO(
taxes=[
TaxDTO(
uuid='TAX_UUID_1',
status='TAX_STATUS_1',
name='TAX_NAME_1',
country='TAX_COUNTRY_1',
configuration='TAX_CONFIGURATION_1',
code='TAX_CODE_1',
rate='TAX_RATE_1'
),
TaxDTO(
uuid='TAX_UUID_2',
status='TAX_STATUS_2',
name='TAX_NAME_2',
country='TAX_COUNTRY_2',
configuration='TAX_CONFIGURATION_2',
code='TAX_CODE_2',
rate='TAX_RATE_2'
),
TaxDTO(
uuid='TAX_UUID_3',
status='TAX_STATUS_3',
name='TAX_NAME_3',
country='TAX_COUNTRY_3',
configuration='TAX_CONFIGURATION_3',
code='TAX_CODE_3',
rate='TAX_RATE_3'
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"taxes": [
{
"uuid": "TAX_UUID_1",
"status": "TAX_STATUS_1",
"name": "TAX_NAME_1",
"country": "TAX_COUNTRY_1",
"configuration": "TAX_CONFIGURATION_1",
"code": "TAX_CODE_1",
"rate": "TAX_RATE_1"
},
{
"uuid": "TAX_UUID_2",
"status": "TAX_STATUS_2",
"name": "TAX_NAME_2",
"country": "TAX_COUNTRY_2",
"configuration": "TAX_CONFIGURATION_2",
"code": "TAX_CODE_2",
"rate": "TAX_RATE_2"
},
{
"uuid": "TAX_UUID_3",
"status": "TAX_STATUS_3",
"name": "TAX_NAME_3",
"country": "TAX_COUNTRY_3",
"configuration": "TAX_CONFIGURATION_3",
"code": "TAX_CODE_3",
"rate": "TAX_RATE_3"
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PAGINATION_PREVIOUS_PAGE",
"next_page": "PAGINATION_NEXT_PAGE"
}
}
Function: readDiscountProfilesFromSettings
Purpose
The readDiscountProfilesFromSettings()
function retrieves a list of discount profiles configured in the system settings. This allows users to review or validate the active discount strategies applied to products or services.
Parameters
This function does not require any parameters.
Use Case
The function is used to fetch discount profile settings configured in the system. Typical use cases include verifying discount configurations during setup, validating discount rules for reporting, and troubleshooting discount-related discrepancies.
def read_discount_profiles_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_discount_profiles()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readDiscountProfilesFromSettings()
{
try {
$response = $this->settingService->readDiscountProfiles();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of configured discount profiles. Each profile includes details such as the discount name, type (percentage or flat rate), applicable conditions, and validity period.
DiscountProfilesResponseDTO(
discountProfiles=[
DiscountProfileDTO(
uuid='DISCOUNT_UUID_1',
status='DISCOUNT_STATUS_1',
name='DISCOUNT_NAME_1',
displayName='DISCOUNT_DISPLAY_NAME_1',
description='DISCOUNT_DESCRIPTION_1',
invoiceNote='DISCOUNT_INVOICE_NOTE_1',
accountingCode='DISCOUNT_ACCOUNTING_CODE_1',
discountStartTime='DISCOUNT_START_TIME_1',
discountEndTime='DISCOUNT_END_TIME_1',
discountType='DISCOUNT_TYPE_1',
fixed='DISCOUNT_FIXED_AMOUNT_1',
maximumUse='DISCOUNT_MAXIMUM_USE_1',
totalUsageCount='DISCOUNT_TOTAL_USAGE_COUNT_1',
maximumUsePerAccount='DISCOUNT_MAX_USE_PER_ACCOUNT_1',
maximumUsePerOrder='DISCOUNT_MAX_USE_PER_ORDER_1',
requiresRedemptionCode='DISCOUNT_REQUIRES_REDEMPTION_CODE_1',
redemptionCode=[]
),
DiscountProfileDTO(
uuid='DISCOUNT_UUID_2',
status='DISCOUNT_STATUS_2',
name='DISCOUNT_NAME_2',
displayName='DISCOUNT_DISPLAY_NAME_2',
description='DISCOUNT_DESCRIPTION_2',
invoiceNote='DISCOUNT_INVOICE_NOTE_2',
accountingCode='DISCOUNT_ACCOUNTING_CODE_2',
discountStartTime='DISCOUNT_START_TIME_2',
discountEndTime='DISCOUNT_END_TIME_2',
discountType='DISCOUNT_TYPE_2',
fixed=None,
maximumUse='DISCOUNT_MAXIMUM_USE_2',
totalUsageCount='DISCOUNT_TOTAL_USAGE_COUNT_2',
maximumUsePerAccount='DISCOUNT_MAX_USE_PER_ACCOUNT_2',
maximumUsePerOrder='DISCOUNT_MAX_USE_PER_ORDER_2',
requiresRedemptionCode='DISCOUNT_REQUIRES_REDEMPTION_CODE_2',
redemptionCode=[
RedemptionCodeDTO(
codeId='REDEMPTION_CODE_ID_1',
note='REDEMPTION_CODE_NOTE_1',
maxLimit='REDEMPTION_CODE_MAX_LIMIT_1',
usageCount='REDEMPTION_CODE_USAGE_COUNT_1'
)
]
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"discount_profiles": [
{
"uuid": "UUID",
"status": "STATUS",
"name": "NAME",
"display_name": "DISPLAY_NAME",
"description": "DESCRIPTION",
"invoice_note": "INVOICE_NOTE",
"accounting_code": "ACCOUNTING_CODE",
"discount_start_time": "DISCOUNT_START_TIME",
"discount_end_time": "DISCOUNT_END_TIME",
"discount_type": "DISCOUNT_TYPE",
"fixed": "FIXED",
"maximum_use": "MAXIMUM_USE",
"total_usage_count": "TOTAL_USAGE_COUNT",
"maximum_use_per_account": "MAXIMUM_USE_PER_ACCOUNT",
"maximum_use_per_order": "MAXIMUM_USE_PER_ORDER",
"requires_redemption_code": "REQUIRES_REDEMPTION_CODE",
"redemption_code": "REDEMPTION_CODE"
},
{
"uuid": "UUID",
"status": "STATUS",
"name": "NAME",
"display_name": "DISPLAY_NAME",
"description": "DESCRIPTION",
"invoice_note": "INVOICE_NOTE",
"accounting_code": "ACCOUNTING_CODE",
"discount_start_time": "DISCOUNT_START_TIME",
"discount_end_time": "DISCOUNT_END_TIME",
"discount_type": "DISCOUNT_TYPE",
"percentage": "PERCENTAGE",
"maximum_use": "MAXIMUM_USE",
"total_usage_count": "TOTAL_USAGE_COUNT",
"maximum_use_per_account": "MAXIMUM_USE_PER_ACCOUNT",
"maximum_use_per_order": "MAXIMUM_USE_PER_ORDER",
"requires_redemption_code": "REQUIRES_REDEMPTION_CODE",
"redemption_code": "REDEMPTION_CODE"
}
],
"pagination": {
"records": "RECORDS",
"limit": "LIMIT",
"offset": "OFFSET",
"previous_page": "PREVIOUS_PAGE",
"next_page": "NEXT_PAGE"
}
}
Function: readWarehouseDetailsFromSettings
Purpose
The readWarehouseDetailsFromSettings()
function retrieves a list of warehouses configured in the system settings. This is useful for inventory management, logistics planning, and verifying operational warehouse configurations.
Parameters
This function does not require any parameters
Use Case
The function is used to fetch warehouse details during system setup or maintenance. Common use cases include reviewing active warehouses for inventory allocation, verifying warehouse configurations for reporting, and troubleshooting warehouse-related data.
def read_warehouse_details_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_warehouses()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readWarehouseDetailsFromSettings()
{
try {
$response = $this->settingService->readAllWarehouse();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of configured warehouses. Each warehouse entry includes details such as warehouse name, location, capacity, and status (active or inactive).
WarehousesResponseDTO(
warehouses=[
WarehouseDTO(
uuid='WAREHOUSE_UUID_1',
status='WAREHOUSE_STATUS_1',
default='WAREHOUSE_DEFAULT_1',
name='WAREHOUSE_NAME_1',
displayName='WAREHOUSE_DISPLAY_NAME_1',
description='WAREHOUSE_DESCRIPTION_1',
country='WAREHOUSE_COUNTRY_1',
state='WAREHOUSE_STATE_1',
city='WAREHOUSE_CITY_1',
postCode='WAREHOUSE_POST_CODE_1'
),
WarehouseDTO(
uuid='WAREHOUSE_UUID_2',
status='WAREHOUSE_STATUS_2',
default='WAREHOUSE_DEFAULT_2',
name='WAREHOUSE_NAME_2',
displayName='WAREHOUSE_DISPLAY_NAME_2',
description='WAREHOUSE_DESCRIPTION_2',
country='WAREHOUSE_COUNTRY_2',
state='WAREHOUSE_STATE_2',
city='WAREHOUSE_CITY_2',
postCode='WAREHOUSE_POST_CODE_2'
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"warehouses": [
{
"uuid": "WAREHOUSE_UUID_1",
"status": "WAREHOUSE_STATUS_1",
"default": "WAREHOUSE_DEFAULT_1",
"name": "WAREHOUSE_NAME_1",
"display_name": "WAREHOUSE_DISPLAY_NAME_1",
"description": "WAREHOUSE_DESCRIPTION_1",
"country": "WAREHOUSE_COUNTRY_1",
"state": "WAREHOUSE_STATE_1",
"city": "WAREHOUSE_CITY_1",
"post_code": "WAREHOUSE_POST_CODE_1"
},
{
"uuid": "WAREHOUSE_UUID_2",
"status": "WAREHOUSE_STATUS_2",
"default": "WAREHOUSE_DEFAULT_2",
"name": "WAREHOUSE_NAME_2",
"display_name": "WAREHOUSE_DISPLAY_NAME_2",
"description": "WAREHOUSE_DESCRIPTION_2",
"country": "WAREHOUSE_COUNTRY_2",
"state": "WAREHOUSE_STATE_2",
"city": "WAREHOUSE_CITY_2",
"post_code": "WAREHOUSE_POST_CODE_2"
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PAGINATION_PREVIOUS_PAGE",
"next_page": "PAGINATION_NEXT_PAGE"
}
}
Function: readShippingProfilesFromSettings
Purpose
The readShippingProfilesFromSettings()
function retrieves a list of shipping profiles configured in the system settings. Shipping profiles define the rules and options for shipping methods available to the system.
Parameters
This function does not require any parameters.
Use Case
The function is used to fetch shipping profiles for system setup, validation of shipping methods during checkout, or for troubleshooting shipping configurations.
def read_shipping_profiles_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_shipping_profiles()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readShippingProfilesFromSettings()
{
try {
$response = $this->settingService->readShippingProfile();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of configured shipping profiles. Each profile includes details such as shipping method name, cost, regions covered, and additional rules like free shipping thresholds or delivery time estimates.
ShippingProfilesResponseDTO(
shippingProfiles=[
ShippingProfileDTO(
uuid='SHIPPING_PROFILE_UUID_1',
status='SHIPPING_PROFILE_STATUS_1',
name='SHIPPING_PROFILE_NAME_1',
displayName='SHIPPING_PROFILE_DISPLAY_NAME_1',
description='SHIPPING_PROFILE_DESCRIPTION_1',
invoiceNote='SHIPPING_PROFILE_INVOICE_NOTE_1',
type='SHIPPING_PROFILE_TYPE_1',
fixedAmount='SHIPPING_PROFILE_FIXED_AMOUNT_1',
isTaxExempt='SHIPPING_PROFILE_TAX_EXEMPT_1',
isTaxInclusive='SHIPPING_PROFILE_TAX_INCLUSIVE_1',
taxConfiguration=TaxConfigurationDTO(
uuid='TAX_CONFIGURATION_UUID_1',
code='TAX_CONFIGURATION_CODE_1',
rate='TAX_CONFIGURATION_RATE_1',
link='TAX_CONFIGURATION_LINK_1'
),
accountingCode='SHIPPING_PROFILE_ACCOUNTING_CODE_1'
),
ShippingProfileDTO(
uuid='SHIPPING_PROFILE_UUID_2',
status='SHIPPING_PROFILE_STATUS_2',
name='SHIPPING_PROFILE_NAME_2',
displayName='SHIPPING_PROFILE_DISPLAY_NAME_2',
description='SHIPPING_PROFILE_DESCRIPTION_2',
invoiceNote='SHIPPING_PROFILE_INVOICE_NOTE_2',
type='SHIPPING_PROFILE_TYPE_2',
fixedAmount='SHIPPING_PROFILE_FIXED_AMOUNT_2',
isTaxExempt='SHIPPING_PROFILE_TAX_EXEMPT_2',
isTaxInclusive='SHIPPING_PROFILE_TAX_INCLUSIVE_2',
taxConfiguration=TaxConfigurationDTO(
uuid='TAX_CONFIGURATION_UUID_2',
code='TAX_CONFIGURATION_CODE_2',
rate='TAX_CONFIGURATION_RATE_2',
link='TAX_CONFIGURATION_LINK_2'
),
accountingCode='SHIPPING_PROFILE_ACCOUNTING_CODE_2'
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"shipping_profiles": [
{
"uuid": "SHIPPING_PROFILE_UUID_1",
"status": "SHIPPING_PROFILE_STATUS_1",
"name": "SHIPPING_PROFILE_NAME_1",
"display_name": "SHIPPING_PROFILE_DISPLAY_NAME_1",
"description": "SHIPPING_PROFILE_DESCRIPTION_1",
"invoice_note": "SHIPPING_PROFILE_INVOICE_NOTE_1",
"type": "SHIPPING_PROFILE_TYPE_1",
"fixed_amount": "SHIPPING_PROFILE_FIXED_AMOUNT_1",
"is_tax_exempt": "SHIPPING_PROFILE_TAX_EXEMPT_1",
"is_tax_inclusive": "SHIPPING_PROFILE_TAX_INCLUSIVE_1",
"tax_configuration": {
"uuid": "TAX_CONFIGURATION_UUID_1",
"code": "TAX_CONFIGURATION_CODE_1",
"rate": "TAX_CONFIGURATION_RATE_1",
"link": "TAX_CONFIGURATION_LINK_1"
},
"accounting_code": "SHIPPING_PROFILE_ACCOUNTING_CODE_1"
},
{
"uuid": "SHIPPING_PROFILE_UUID_2",
"status": "SHIPPING_PROFILE_STATUS_2",
"name": "SHIPPING_PROFILE_NAME_2",
"display_name": "SHIPPING_PROFILE_DISPLAY_NAME_2",
"description": "SHIPPING_PROFILE_DESCRIPTION_2",
"invoice_note": "SHIPPING_PROFILE_INVOICE_NOTE_2",
"type": "SHIPPING_PROFILE_TYPE_2",
"fixed_amount": "SHIPPING_PROFILE_FIXED_AMOUNT_2",
"is_tax_exempt": "SHIPPING_PROFILE_TAX_EXEMPT_2",
"is_tax_inclusive": "SHIPPING_PROFILE_TAX_INCLUSIVE_2",
"tax_configuration": {
"uuid": "TAX_CONFIGURATION_UUID_2",
"code": "TAX_CONFIGURATION_CODE_2",
"rate": "TAX_CONFIGURATION_RATE_2",
"link": "TAX_CONFIGURATION_LINK_2"
},
"accounting_code": "SHIPPING_PROFILE_ACCOUNTING_CODE_2"
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PAGINATION_PREVIOUS_PAGE",
"next_page": "PAGINATION_NEXT_PAGE"
}
}
Function: readVariationsFromSettings
Purpose
The readVariationsFromSettings()
function retrieves a list of product variations configured in the system settings. Variations are often used for products that come in different options, such as sizes, colors, or materials.
Parameters
This function does not require any parameters.
Use Case
This function is useful for fetching all product variation definitions in the system, which can assist in creating new products, validating existing product setups, or ensuring proper variation mapping during integrations.
def read_variations_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_variations()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readVariationsFromSettings()
{
try {
$response = $this->settingService->readVariations('v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of configured variations. Each variation typically includes attributes like variation name, possible values (e.g., "Small", "Medium", "Large"), and any associated metadata.
VariationsResponseDTO(
variations=[
VariationDTO(
uuid='VARIATION_UUID_1',
status='VARIATION_STATUS_1',
name='VARIATION_NAME_1',
displayName='VARIATION_DISPLAY_NAME_1',
description='VARIATION_DESCRIPTION_1',
options=[
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_1',
uuid='VARIATION_OPTION_UUID_1_1'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_2',
uuid='VARIATION_OPTION_UUID_1_2'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_3',
uuid='VARIATION_OPTION_UUID_1_3'
)
]
),
VariationDTO(
uuid='VARIATION_UUID_2',
status='VARIATION_STATUS_2',
name='VARIATION_NAME_2',
displayName='VARIATION_DISPLAY_NAME_2',
description='VARIATION_DESCRIPTION_2',
options=[
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_1',
uuid='VARIATION_OPTION_UUID_2_1'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_2',
uuid='VARIATION_OPTION_UUID_2_2'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_3',
uuid='VARIATION_OPTION_UUID_2_3'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_4',
uuid='VARIATION_OPTION_UUID_2_4'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_5',
uuid='VARIATION_OPTION_UUID_2_5'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_6',
uuid='VARIATION_OPTION_UUID_2_6'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_7',
uuid='VARIATION_OPTION_UUID_2_7'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_8',
uuid='VARIATION_OPTION_UUID_2_8'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_9',
uuid='VARIATION_OPTION_UUID_2_9'
)
]
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"variations": [
{
"uuid": "VARIATION_UUID_1",
"status": "VARIATION_STATUS_1",
"name": "VARIATION_NAME_1",
"display_name": "VARIATION_DISPLAY_NAME_1",
"description": "VARIATION_DESCRIPTION_1",
"options": [
{
"name": "VARIATION_OPTION_NAME_1_1",
"uuid": "VARIATION_OPTION_UUID_1_1"
},
{
"name": "VARIATION_OPTION_NAME_1_2",
"uuid": "VARIATION_OPTION_UUID_1_2"
},
{
"name": "VARIATION_OPTION_NAME_1_3",
"uuid": "VARIATION_OPTION_UUID_1_3"
}
]
},
{
"uuid": "VARIATION_UUID_2",
"status": "VARIATION_STATUS_2",
"name": "VARIATION_NAME_2",
"display_name": "VARIATION_DISPLAY_NAME_2",
"description": "VARIATION_DESCRIPTION_2",
"options": [
{
"name": "VARIATION_OPTION_NAME_2_1",
"uuid": "VARIATION_OPTION_UUID_2_1"
},
{
"name": "VARIATION_OPTION_NAME_2_2",
"uuid": "VARIATION_OPTION_UUID_2_2"
},
{
"name": "VARIATION_OPTION_NAME_2_3",
"uuid": "VARIATION_OPTION_UUID_2_3"
},
{
"name": "VARIATION_OPTION_NAME_2_4",
"uuid": "VARIATION_OPTION_UUID_2_4"
},
{
"name": "VARIATION_OPTION_NAME_2_5",
"uuid": "VARIATION_OPTION_UUID_2_5"
},
{
"name": "VARIATION_OPTION_NAME_2_6",
"uuid": "VARIATION_OPTION_UUID_2_6"
},
{
"name": "VARIATION_OPTION_NAME_2_7",
"uuid": "VARIATION_OPTION_UUID_2_7"
},
{
"name": "VARIATION_OPTION_NAME_2_8",
"uuid": "VARIATION_OPTION_UUID_2_8"
},
{
"name": "VARIATION_OPTION_NAME_2_9",
"uuid": "VARIATION_OPTION_UUID_2_9"
}
]
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PAGINATION_PREVIOUS_PAGE",
"next_page": "PAGINATION_NEXT_PAGE"
}
}
Function: createVariationsFromSettings
Purpose
The createVariationsFromSettings() function creates a new product variation in the system settings. This is typically used to define options for products, such as size, color, or any other configurable attributes.
Parameters
Name | Type | Description |
name | string | The internal name of the variation (e.g., "VARIATION_NAME"). |
display name | string | The user-friendly name of the variation (e.g., "VARIATION_DISPLAY_NAME"). |
description | string | A brief description of the variation (e.g., "VARIATION_DESCRIPTION"). |
options | array | A list of options under the variation (e.g., ["OPTION_1", "OPTION_2", "OPTION_3"]). |
Use Case
This function is used when setting up new product variations to enhance product flexibility, ensuring consistency in product data across the system, and enabling users to select from predefined options for customizable products.
def create_variations_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
request_data = VariationCreateRequestDTO(
variations=VariationCreateDataDTO(
name="VARIATION_NAME",
displayName="VARIATION_DISPLAY_NAME",
description="VARIATION_DESCRIPTION",
options=["OPTION_1", "OPTION_2", "OPTION_3"]
))
response = exsited_sdk.setting.variation_create(request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function createVariationsFromSettings()
{
$params = [
"variations" => [
"name" => "VARIATION_NAME",
"display_name" => "VARIATION_DISPLAY_NAME",
"description" => "VARIATION_DESCRIPTION",
"options" => [
"OPTION_1",
"OPTION_2",
"OPTION_3"
]
]
];
try {
$response = $this->settingService->createVariations($params, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a confirmation of the newly created variation. This includes details such as the variation ID, name, display name, description, and the list of options.
VariationsResponseDTO(
variations=[
VariationDTO(
uuid='VARIATION_UUID_1',
status='VARIATION_STATUS_1',
name='VARIATION_NAME_1',
displayName='VARIATION_DISPLAY_NAME_1',
description='VARIATION_DESCRIPTION_1',
options=[
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_1',
uuid='VARIATION_OPTION_UUID_1_1'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_2',
uuid='VARIATION_OPTION_UUID_1_2'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1_3',
uuid='VARIATION_OPTION_UUID_1_3'
)
]
),
VariationDTO(
uuid='VARIATION_UUID_2',
status='VARIATION_STATUS_2',
name='VARIATION_NAME_2',
displayName='VARIATION_DISPLAY_NAME_2',
description='VARIATION_DESCRIPTION_2',
options=[
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_1',
uuid='VARIATION_OPTION_UUID_2_1'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_2',
uuid='VARIATION_OPTION_UUID_2_2'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_3',
uuid='VARIATION_OPTION_UUID_2_3'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_4',
uuid='VARIATION_OPTION_UUID_2_4'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_5',
uuid='VARIATION_OPTION_UUID_2_5'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_6',
uuid='VARIATION_OPTION_UUID_2_6'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_7',
uuid='VARIATION_OPTION_UUID_2_7'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_8',
uuid='VARIATION_OPTION_UUID_2_8'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2_9',
uuid='VARIATION_OPTION_UUID_2_9'
)
]
)
],
pagination=PaginationDTO(
records='PAGINATION_RECORDS',
limit='PAGINATION_LIMIT',
offset='PAGINATION_OFFSET',
previousPage='PAGINATION_PREVIOUS_PAGE',
nextPage='PAGINATION_NEXT_PAGE'
)
)
{
"variations": [
{
"uuid": "VARIATION_UUID_1",
"status": "VARIATION_STATUS_1",
"name": "VARIATION_NAME_1",
"display_name": "VARIATION_DISPLAY_NAME_1",
"description": "VARIATION_DESCRIPTION_1",
"options": [
{
"name": "VARIATION_OPTION_NAME_1_1",
"uuid": "VARIATION_OPTION_UUID_1_1"
},
{
"name": "VARIATION_OPTION_NAME_1_2",
"uuid": "VARIATION_OPTION_UUID_1_2"
},
{
"name": "VARIATION_OPTION_NAME_1_3",
"uuid": "VARIATION_OPTION_UUID_1_3"
}
]
},
{
"uuid": "VARIATION_UUID_2",
"status": "VARIATION_STATUS_2",
"name": "VARIATION_NAME_2",
"display_name": "VARIATION_DISPLAY_NAME_2",
"description": "VARIATION_DESCRIPTION_2",
"options": [
{
"name": "VARIATION_OPTION_NAME_2_1",
"uuid": "VARIATION_OPTION_UUID_2_1"
},
{
"name": "VARIATION_OPTION_NAME_2_2",
"uuid": "VARIATION_OPTION_UUID_2_2"
},
{
"name": "VARIATION_OPTION_NAME_2_3",
"uuid": "VARIATION_OPTION_UUID_2_3"
},
{
"name": "VARIATION_OPTION_NAME_2_4",
"uuid": "VARIATION_OPTION_UUID_2_4"
},
{
"name": "VARIATION_OPTION_NAME_2_5",
"uuid": "VARIATION_OPTION_UUID_2_5"
},
{
"name": "VARIATION_OPTION_NAME_2_6",
"uuid": "VARIATION_OPTION_UUID_2_6"
},
{
"name": "VARIATION_OPTION_NAME_2_7",
"uuid": "VARIATION_OPTION_UUID_2_7"
},
{
"name": "VARIATION_OPTION_NAME_2_8",
"uuid": "VARIATION_OPTION_UUID_2_8"
},
{
"name": "VARIATION_OPTION_NAME_2_9",
"uuid": "VARIATION_OPTION_UUID_2_9"
}
]
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PAGINATION_PREVIOUS_PAGE",
"next_page": "PAGINATION_NEXT_PAGE"
}
}
Function: updateVariationsFromSettings
Purpose
The update_variations_from_settings()
function updates an existing variation in the system settings. This is typically used to modify attributes, descriptions, or options of a variation.
Parameters
Parameter Name | Type | Description |
---|---|---|
uuid | string | The unique identifier of the variation to update. |
name | string | The internal name of the variation. |
display name | string | The user-friendly name of the variation. |
description | string | A brief description of the variation. |
options | array | A list of options with their names and display order under the variation. Each option includes: |
name |
string |
The name of the option. |
order |
integer |
The display order of the option. |
Use Case
This function is used to update the details of an existing variation, including its name, description, and options. It's especially useful when correcting or enhancing the variation configuration for products.
def update_variations_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
request_data = VariationCreateRequestDTO(
variations=VariationCreateDataDTO(
name="UPDATED_VARIATION",
displayName="Updated Variation",
description="Updated description",
options=[OptionDTO(name="OPTION_1_NAME", order=0)]
))
response = exsited_sdk.setting.variation_update(uuid="VARIATION_UUID", request_data=request_data)
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function updateVariationsFromSettings()
{
$uuId = "VARIATION_UUID";
$params = [
"variations" => [
"name" => "UPDATED_VARIATION",
"display_name" => "Updated Variation",
"description" => "Updated description",
"options" => [
[
"name" => "OPTION_1_NAME",
"order" => 0
]
]
]
];
try {
$response = $this->settingService->changeVariations($params, $uuId);
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a confirmation of the updated variation, including details such as the variation ID, updated name, description, and options.
VariationUpdateResponseDTO(
variation=VariationDTO(
uuid='VARIATION_UUID',
status='VARIATION_STATUS',
name='VARIATION_NAME',
displayName='VARIATION_DISPLAY_NAME',
description='VARIATION_DESCRIPTION',
options=[
VariationOptionDTO(
name='VARIATION_OPTION_NAME_1',
uuid='VARIATION_OPTION_UUID_1'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_2',
uuid='VARIATION_OPTION_UUID_2'
),
VariationOptionDTO(
name='VARIATION_OPTION_NAME_3',
uuid='VARIATION_OPTION_UUID_3'
)
]
)
)
{
"variation": {
"uuid": "VARIATION_UUID",
"status": "VARIATION_STATUS",
"name": "VARIATION_NAME",
"display_name": "VARIATION_DISPLAY_NAME",
"description": "VARIATION_DESCRIPTION",
"options": [
{
"name": "VARIATION_OPTION_NAME_1",
"uuid": "VARIATION_OPTION_UUID_1"
},
{
"name": "VARIATION_OPTION_NAME_2",
"uuid": "VARIATION_OPTION_UUID_2"
},
{
"name": "VARIATION_OPTION_NAME_3",
"uuid": "VARIATION_OPTION_UUID_3"
}
]
}
}
Function: readComponentsFromSettings
Purpose
The readComponentsFromSettings()
function retrieves a list of system components configured in the settings. This is typically used to validate or review the available components for system configuration and operation.
Parameters
This function does not require any parameters.
Use Case
This function is used to fetch all system components from the settings, which can be utilized for configuration, validation, and debugging purposes.
def read_components_from_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.setting.get_settings_components()
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function readComponentsFromSettings()
{
try {
$response = $this->settingService->readComponents();
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns a list of components configured in the system settings. Each component includes details such as the name, type, description, and status.
ComponentResponseDTO(
components=[
ComponentDataDTO(
uuid='COMPONENT_UUID_1',
status='COMPONENT_STATUS_1',
name='COMPONENT_NAME_1',
displayName='COMPONENT_DISPLAY_NAME_1',
description='COMPONENT_DESCRIPTION_1',
useIn=[UseInDTO(resource='COMPONENT_RESOURCE_1')],
relation='COMPONENT_RELATION_1'
),
ComponentDataDTO(
uuid='COMPONENT_UUID_2',
status='COMPONENT_STATUS_2',
name='COMPONENT_NAME_2',
displayName='COMPONENT_DISPLAY_NAME_2',
description='COMPONENT_DESCRIPTION_2',
useIn=[UseInDTO(resource='COMPONENT_RESOURCE_2')],
relation='COMPONENT_RELATION_2'
),
ComponentDataDTO(
uuid='COMPONENT_UUID_3',
status='COMPONENT_STATUS_3',
name='COMPONENT_NAME_3',
displayName='COMPONENT_DISPLAY_NAME_3',
description='COMPONENT_DESCRIPTION_3',
useIn=[UseInDTO(resource='COMPONENT_RESOURCE_3')],
relation='COMPONENT_RELATION_3'
)
]
pagination=PaginationDTO(
records='TOTAL_RECORDS',
limit='PAGE_LIMIT',
offset='PAGE_OFFSET',
previousPage='PREVIOUS_PAGE_LINK',
nextPage='NEXT_PAGE_LINK'
)
)
{
"components": [
{
"uuid": "COMPONENT_UUID_1",
"status": "COMPONENT_STATUS_1",
"name": "COMPONENT_NAME_1",
"display_name": "COMPONENT_DISPLAY_NAME_1",
"description": "COMPONENT_DESCRIPTION_1",
"use_in": [
{
"resource": "COMPONENT_RESOURCE_1"
}
],
"relation": "COMPONENT_RELATION_1"
},
{
"uuid": "COMPONENT_UUID_2",
"status": "COMPONENT_STATUS_2",
"name": "COMPONENT_NAME_2",
"display_name": "COMPONENT_DISPLAY_NAME_2",
"description": "COMPONENT_DESCRIPTION_2",
"use_in": [
{
"resource": "COMPONENT_RESOURCE_2"
}
],
"relation": "COMPONENT_RELATION_2"
},
{
"uuid": "COMPONENT_UUID_3",
"status": "COMPONENT_STATUS_3",
"name": "COMPONENT_NAME_3",
"display_name": "COMPONENT_DISPLAY_NAME_3",
"description": "COMPONENT_DESCRIPTION_3",
"use_in": [
{
"resource": "COMPONENT_RESOURCE_3"
}
],
"relation": "COMPONENT_RELATION_3"
}
// Additional components can be added here as needed
],
"pagination": {
"records": "TOTAL_RECORDS",
"limit": "PAGE_LIMIT",
"offset": "PAGE_OFFSET",
"previous_page": "PREVIOUS_PAGE_LINK",
"next_page": "NEXT_PAGE_LINK"
}
}
Configuration
Before using any of these functions, ensure that your API credentials are properly configured.
- Python: The request token is retrieved from CommonData.get_request_token_dto().
- PHP: Configuration is managed via ConfigManager and $this->$settingService.
Language-Specific Details
Feature |
Python |
PHP |
---|---|---|
SDK Initialization |
Uses ExsitedSDK with OAuth token for authentication. |
Initializes the settingService to interact with Exsited. |
Error Handling |
Catches ABException to handle API errors. |
Catches general Exception to handle errors. |
Response Output |
Uses print() to display the response in raw format. |
Uses json_encode() to output the settings in JSON format. |
Detailed Logs |
Enables request and response logging through SDKConfig. |
No specific logging configuration needed. |