Salla Docs
Merchant
Merchant
  • Merchant API
  • Salla OAuth 2.0
  • Merchant Dashboard
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • App Functions
  • Billing System Salla partners
  • Report Builder
  • App Onboarding
  • Communication Apps
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Change Log
Salla CLI
Merchant
Merchant
  • Merchant API
  • Salla OAuth 2.0
  • Merchant Dashboard
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • App Functions
  • Billing System Salla partners
  • Report Builder
  • App Onboarding
  • Communication Apps
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Communication Apps
  • Get Started
  • App Events
  • Create Your First App
  • Root
  • Settlements
    • List Instant Settlements
    • Create Instant Settlement
    • Update Instant Settlement
    • Instant Settlement Details
  • App Details Builder
    • Get Started
    • Components
      • App Information
      • App Features
      • App Reviews
      • App Contact Info
      • App Brands
      • App FAQ
      • App Statistics
  • Settings
    • App Setting Details
    • Update App Settings
  • Subscriptions
    • App Subscription Details
    • Update Subscription Balance
  • Report Creator
    • Overview
    • Getting Started
    • JMESPath Tutorial
    • Salla Reports Examples
    • Understanding the Report Lifecycle
    • Report Types
      • Unit
      • Bar
      • Breakdown
      • Calendar
      • Distribution
      • Pipe
      • Plot
      • Ranking
      • Summary
      • Agrid
  • App Onboarding Steps
    • Overview
    • Get Started
    • Interfaces and Responses
    • Example
  • Communication Apps
    • Overview
    • Get Started
    • Interfaces and Responses
    • Examples
  1. Communication Apps

Examples

These examples demonstrate how to process different communication channels. Each handler receives settings which are pre-filled based on the App Settings you defined in the Partner Portal.

Channel Handlers#

SMS Handler
Handles communication.sms.send. This example demonstrates using a generic SMS gateway with a 10-second timeout.
Key logic:
Validates that the merchant has configured their API key in the Partner Portal.
Uses the first recipient from the notifiable array for SMS delivery.
Email Handler (SendGrid)
WhatsApp Handler (Meta)

Logic Patterns#

Handling High-Priority OTPs
OTP messages require high reliability and low latency. It is recommended to use shorter timeouts (e.g., 5 seconds) to fail fast and allow Salla to potentially retry or fall back.
Multi-channel Routing

Troubleshooting Common Errors#

When your App Function returns a Resp.error(), Salla logs the status code and message. Use the table below to identify and fix common implementation hurdles.
Status CodeError MessageCommon CauseRecommended Fix
422Missing settings...The merchant hasn't filled in the required API keys in the app settings.Check if the merchant has completed the app setup in the Salla Dashboard.
503Provider timed outThe third-party SMS/Email API took longer than your AbortSignal.timeout.Increase the timeout slightly (max 20s) or check the provider's status page.
401/403UnauthorizedThe API key provided in settings is invalid or expired.Ensure the merchant is using a valid, active API key from their provider.
429Too Many RequestsYou've hit the rate limit of your SMS or Email provider.Implement retry logic or check provider throughput limits.
500Internal Server ErrorUnhandled exception in your code (e.g., null pointer on entity).Verify safe access to optional fields like meta or entity.
Pro Tip: Testing Payloads
Before going live, Test Feature in the Partner Portal to send dummy payloads to your function. This ensures your mapping logic for notifiable and content is solid across different event types.
Modified at 2026-03-16 11:33:16
Previous
Interfaces and Responses