1. App Functions
Salla Platform Docs
  • Getting Started
  • Migration to the New API
  • Publish App
  • Change Log
  • Shipping Management
    • App Cycle
    • Test App
    • Create App
    • Setup App
  • Order Fulfilment
    • App Cycle
    • Setup App
    • Test App
    • Create App
  • Salla AWB
    • Getting Started
    • Create Shipping App
    • Setup Shipping App
    • App Functions
      • Shipment Creating
      • Shipment Cancelling
    • Generating AWB
      • Shipment AWB
      • Shipment Return AWB
      • Shipment Cancelled AWB
  • APIs
    • Shipments
      • Create Shipment
      • List Shipments
      • Update Shipment Details
      • Shipment Details
      • Cancel Shipments
      • Return Shipments
      • Shipment Tracking
    • Shipping Companies
      • List Shipping Companies
      • Shipping Company Details
    • Shipping Routes
      • Routes List
      • Route Details
      • Create Route
      • Update Route
      • Default Route
      • Delete Route
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Salla - Opensource
Salla - Developers Community
  1. App Functions

Shipment Cancelling

Use the Shipment Cancelling Function to manage cancellation requests. The function receives the shipment details, and the shipping system can update the status to “Cancelled” when applicable.
Cancellation can be declined if the shipment has already been dispatched or delivered.

Step By Step Guide#

On Salla Partners Portal, click on "+ Add New Function"
SCR-20251118-jhsx.png
Select the App Function you want to add, which is in this case the Shipment Cancelling Function. After selecting, add a name to the function.

Code Details#

Salla auto-generates starter code, which you can overwrite with the following implementation. This gives you a clean foundation to build your shipping logic and ensures the function behaves the way your integration needs.
SCR-20251119-ijhh.png
Explanation
Full Code
1
Function definition
This function is autogenerated by Salla. It runs when Salla triggers Shipment Cancellation, receives the context data, and must return a GenericResponse object.
2
Cancel shipment in shipping company
Sends a POST request to the shipping company's API to cancel the shipment. The request includes the shipment data from the event payload.
3
Return success response
Returns a success response with the shipment data. This is autogenerated by Salla and confirms to Salla that the cancellation was processed.

Sequence Diagram#

The following diagram shows visually how the shipment cancelled app function works within Salla Partners Portal:
Modified at 2026-09-21 14:22:07
Previous
Shipment Creating
Next
Shipment AWB