Skip to main content

Overview

This page documents enum types and constant values used throughout the Komerza API.

Order Enums

Delivery Item Type

file
string
File - Downloadable file delivered via secure link
dynamic
string
Dynamic - Content generated via webhook. See Dynamic Delivery Guide
license_key
string
License Key - Auto-assigned from pre-generated inventory
plaintext
string
Plaintext - Static text content

Delivery Item Source

static
string
Static - Pre-defined content configured in product settings
generated
string
Generated - System-generated (e.g., license key from inventory)
external
string
External - Retrieved from external webhook endpoint

Refund Reason

Fraudulent
integer
Suspected or confirmed fraudulent activity
RequestedByCustomer
integer
Customer requested refund
Duplicate
integer
Duplicate transaction or order
Other
integer
Reason not covered by other categories
Example:
{
  "reason": 1,
  "amount": 29.99,
  "note": "Customer requested refund"
}

Product Enums

Product Privacy

Public
integer
Visible on store page, searchable, and accessible to all visitors
Unlisted
integer
Hidden from store page, only accessible via direct URL
Private
integer
Only visible to administrators, not purchasable

Stock Calculation Mode

Calculated
integer
Automatically calculated from inventory items. Decrements with each purchase.
Ignored
integer
Stock not tracked. Allows unlimited purchases.
Fixed
integer
Manually set to a specific number. Requires manual adjustment after sales.
Example:
{
  "name": "Software License",
  "privacy": 0,
  "stockCalculationMode": 0
}

Ticket Enums

Ticket Status

Opened
integer
Customer submitted ticket, awaiting seller response
Resolved
integer
Ticket closed with issue resolved (final state)
Closed
integer
Ticket closed without resolution (final state)
Responded
integer
Seller responded, awaiting customer reply
CustomerResponded
integer
Customer replied, awaiting seller response
Status flow:
Opened → Responded ⇄ CustomerResponded → Resolved/Closed

Usage in Code

  • JavaScript
  • Python
  • C#
const Privacy = {
  PUBLIC: 0,
  UNLISTED: 1,
  PRIVATE: 2
};

const product = {
  name: "Premium License",
  privacy: Privacy.PUBLIC,
  stockCalculationMode: 0
};

Important Notes

String enums are case-sensitive: file, dynamic, license_key, plaintext, static, generated, external
Integer enums are zero-based: Privacy (0-2), StockMode (0-2), RefundReason (0-3), TicketStatus (0-4)

Order Enums

Delivery Item Type

Defines the type of content delivered to customers after purchase.
file
string
File Delivery - A downloadable file (software, documents, media, etc.) Used when the product is delivered as a file download. The system provides a secure download link to the customer.
dynamic
string
Dynamic Delivery - Content generated via webhook The delivery content is dynamically generated by your webhook endpoint. See Dynamic Delivery Guide for implementation details.
license_key
string
License Key - Software license or activation key A license key or activation code from your pre-generated inventory. The system automatically assigns the next available key from your stock.
plaintext
string
Plain Text - Simple text content Static text content displayed to the customer. Useful for instructions, access codes, or simple information.

Usage Example

{
  "deliveryType": "license_key",
  "deliveryContent": "ABCD-EFGH-IJKL-MNOP"
}

Delivery Item Source

Indicates how the delivery content was generated or obtained.
static
string
Static Source - Pre-defined content The delivery content was statically defined when configuring the product (e.g., a fixed download link or pre-written text).
generated
string
Generated Source - System-generated content The content was automatically generated by the Komerza system (e.g., a license key from inventory).
external
string
External Source - Third-party webhook The content was obtained from an external webhook endpoint (dynamic delivery).

Usage Example

{
  "deliveryType": "license_key",
  "deliverySource": "generated",
  "deliveryContent": "XXXX-YYYY-ZZZZ-WWWW"
}

Source by Type Matrix

Delivery TypeCommon SourcesDescription
filestaticPre-uploaded file
dynamicexternalWebhook-generated content
license_keygeneratedAuto-assigned from inventory
plaintextstaticPre-defined text

Refund Reason

Specifies the reason for issuing a refund.
Fraudulent
enum
Fraudulent Activity - Refund due to suspected or confirmed fraud Use when:
  • Chargeback filed - Fraudulent payment detected - Stolen payment method used
  • Identity theft suspected
RequestedByCustomer
enum
Customer Request - Customer requested a refund Use when: - Customer dissatisfied with product - Product didn’t meet expectations - Customer changed their mind - Accidental purchase
Duplicate
enum
Duplicate Order - Duplicate transaction or order Use when: - Customer accidentally ordered twice - Payment processed multiple times - System error created duplicates
Other
enum
Other Reason - Reason not covered by other categories Use when: - Technical issue with delivery - Product out of stock after purchase - Custom business reason

API Usage

POST /api/orders/{orderId}/refund
{
  "reason": 1,
  "amount": 29.99,
  "note": "Customer requested refund due to compatibility issues"
}

Product Enums

Product Privacy

Controls the visibility of products in your store.
Public
enum
Public - Visible on store page The product is: - Displayed on your store page - Searchable in your store - Indexed by search engines (if enabled) - Visible to all visitors Use for: All regular products you want to sell publicly
Unlisted
enum
Unlisted - Hidden from store, accessible via direct link The product is: - Not shown on your store page - Not included in search results - Only accessible via direct URL - Not indexed by search engines Use for: - Private deals or exclusive offers - Beta products - Limited-time offers - Invitation-only products
Private
enum
Private - Only visible to administrators The product is: - Completely hidden from customers - Only visible in dashboard - Not purchasable by customers - Useful for drafts and testing Use for: - Draft products - Testing configurations - Internal-only products - Archived products

API Usage

{
  "name": "Premium License",
  "privacy": 0,
  "price": 29.99
}

Privacy Level Comparison

FeaturePublicUnlistedPrivate
Store page✅ Visible❌ Hidden❌ Hidden
Direct link✅ Accessible✅ Accessible❌ Not accessible
Search✅ Searchable❌ Not searchable❌ Not searchable
Purchasable✅ Yes✅ Yes❌ No
Admin only❌ No❌ No✅ Yes

Stock Calculation Mode

Determines how product stock is calculated and displayed.
Calculated
enum
Calculated - Stock based on individual items Stock is: - Automatically calculated from inventory items - Decremented with each purchase - Based on actual available items (license keys, serials, etc.) - Accurate real-time count Use for: - License key delivery - Serial numbers - Digital codes - Limited physical inventory Example: You have 50 license keys uploaded → Stock shows 50
Ignored
enum
Ignored - Stock value not used Stock is: - Not displayed to customers - Not tracked or enforced - Allows unlimited purchases - Never shows “out of stock” Use for: - Unlimited digital products - Services - Dynamically generated content - Products with external inventory Example: Digital course - unlimited enrollments possible
Fixed
enum
Fixed - Manually set stock value Stock is: - Set to a specific number manually - Not automatically updated - Requires manual adjustment after sales
  • Used for display purposes Use for: - Physical products tracked externally - Approximate stock levels - Marketing purposes (“Only 10 left!”) Example: Set to 100 and manually update as needed

API Usage

{
  "name": "Software License",
  "stockCalculationMode": 0,
  "items": ["KEY-1234-ABCD", "KEY-5678-EFGH", "KEY-9012-IJKL"]
}

Mode Selection Guide

Ticket Enums

Ticket Status

Represents the current state of a support ticket.
Opened
enum
Opened - Awaiting seller response - Customer submitted a new ticket - Waiting for seller to respond - Highest priority for response - Shows as “Open” in dashboard Transitions to: Responded, Closed
Responded
enum
Responded - Seller has responded - Seller replied to the ticket - Waiting for customer reply - Shows seller is actively handling - Customer can respond or close Transitions to: CustomerResponded, Resolved, Closed
CustomerResponded
enum
Customer Responded - Customer replied - Customer sent a new message - Waiting for seller response again - Indicates ongoing conversation - Requires seller attention Transitions to: Responded, Resolved, Closed
Resolved
enum
Resolved - Closed and marked resolved - Ticket closed by customer - Customer confirmed issue resolved - Positive outcome - Final state (success) Transitions to: None (final state)
Closed
enum
Closed - Closed without resolution - Ticket closed without resolution - Could be by timeout, seller, or customer - Issue not necessarily resolved - Final state (inconclusive) Transitions to: None (final state)

Status Flow

API Usage

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 3,
  "subject": "Problem with license activation",
  "messages": [
    {
      "from": "customer",
      "content": "Can't activate my license",
      "timestamp": "2025-11-27T10:00:00Z"
    },
    {
      "from": "seller",
      "content": "I'll help you with that...",
      "timestamp": "2025-11-27T10:15:00Z"
    }
  ]
}

Status Meaning by Actor

StatusFor SellerFor Customer
Opened🔴 Action requiredâŗ Awaiting response
Respondedâŗ Awaiting customer🔴 Response received
CustomerResponded🔴 Action requiredâŗ Awaiting response
Resolved✅ Successfully resolved✅ Issue resolved
Closedâ„šī¸ Ticket closedâ„šī¸ Ticket closed

Best Practices

Using Enums in API Requests

  • JavaScript/TypeScript
  • Python
  • C#
// Define enum constants
const Privacy = {
  PUBLIC: 0,
  UNLISTED: 1,
  PRIVATE: 2
} as const;

const StockMode = {
  CALCULATED: 0,
  IGNORED: 1,
  FIXED: 2
} as const;

// Use in API calls
const product = {
  name: "Premium License",
  privacy: Privacy.PUBLIC,
  stockCalculationMode: StockMode.CALCULATED
};

Validation

Always validate enum values before sending to API
Handle unknown enum values gracefully in responses
Use constants instead of magic numbers
Document enum usage in your integration
Enum values are case-sensitive for string types

String vs Integer Enums

TypeExamplesNotes
IntegerPrivacy (0, 1, 2), RefundReason (0-3), TicketStatus (0-4), StockMode (0-2)Use exact integer values
StringDeliveryItemType, DeliveryItemSource, PaymentMethodUse exact string values
Integer enums use zero-based indexing. Always use the exact integer value, not the enum name.