List shipping profiles
Returns all shipping rate profiles with ruleCount (number of wilaya rules) and productCount (how many products override the store default with this profile).
List shipping profiles › Responses
List of shipping profiles
successcountNumber of items returned
Create shipping profile
Creates a profile (rate-card metadata only). Use PUT /{id}/rules afterwards to populate wilaya rates. Setting isDefault: true atomically unsets the current default profile.
Create shipping profile › Request Body
nameisDefaultnotesCreate shipping profile › Responses
Profile created
successShipping profile with its full list of wilaya rules
Get default-profile rules
Returns the wilaya rules of the currently-active default profile. Used by the order form to auto-fill deliveryFee. Returns an empty array if no profile is marked default.
Get default-profile rules › Responses
Default profile rules (empty array if no default configured)
successGet shipping profile
Returns a single profile with its full list of wilaya rules (including homeEnabled / stopDeskEnabled).
path Parameters
idShipping profile ID
Shipping profile ID
Get shipping profile › Responses
Profile with rules
successShipping profile with its full list of wilaya rules
Update shipping profile
Partial update of profile metadata. Include only the fields you want to change. Set notes to null to clear it.
Default invariant: the system always keeps exactly one profile marked isDefault. Setting isDefault: true here atomically unsets the current default. Setting isDefault: false on the only default profile is rejected with 422 DEFAULT_PROFILE_REQUIRED.
path Parameters
idShipping profile ID
Shipping profile ID
Update shipping profile › Request Body
nameisDefaultnotesUpdate shipping profile › Responses
Profile updated
successShipping profile with its full list of wilaya rules
Delete shipping profile
Permanently deletes a profile and all of its wilaya rules (commune overrides cascade).
Blocked when:
- The profile is currently referenced by one or more products →
422 PROFILE_IN_USE - The profile is the default profile →
422 DEFAULT_PROFILE_REQUIRED(set another profile as default first)
path Parameters
idShipping profile ID
Shipping profile ID
Delete shipping profile › Responses
Profile deleted
successReplace wilaya rules
Atomically replaces the full rules list for a profile — prior rules are deleted (commune overrides cascade) before new ones are inserted.
Constraints:
- Each
wilayaIdmay appear at most once per profile. Duplicates are rejected withDUPLICATE_WILAYA_RULE. - Setting both
homeEnabled: falseandstopDeskEnabled: falseon a wilaya effectively disables delivery for that wilaya under this profile. - Sending an empty
rulesarray clears all rules for the profile.
path Parameters
idShipping profile ID
Shipping profile ID
Replace wilaya rules › Responses
Rules replaced — returns the profile with its new rules
successShipping profile with its full list of wilaya rules
List commune overrides
Returns every commune in a wilaya with its override status. For each commune the response includes:
- Raw override fields (
homeEnabled,stopDeskEnabled,homePrice,stopDeskPrice) —nullmeans that field inherits from the wilaya rule. - Effective values (
effectiveHome*,effectiveStopDesk*) — the actual values used during fee resolution (commune override merged onto the wilaya defaults). - hasOverride —
trueif any override row exists for this commune.
Requires that the profile already has a rule for the given wilaya — otherwise responds 404 SHIPPING_RULE_NOT_FOUND.
path Parameters
idShipping profile ID
Shipping profile ID
wilayaIdWilaya ID (1–58)
Wilaya ID (1–58)
List commune overrides › Responses
All communes in this wilaya with override status
successSet or update commune override
Upserts a commune-level override on top of the wilaya rule.
Semantics:
- Any field set to
null(or omitted — which is treated as null) inherits from the wilaya rule at fee-resolution time. - If all four override fields (
homeEnabled,stopDeskEnabled,homePrice,stopDeskPrice) are null, the override row is deleted (equivalent toDELETE). - Prices must be ≥ 0 when provided.
Effects on orders: subsequent online orders with this wilaya + commune pair will use the overridden values. Disabling homeEnabled or stopDeskEnabled causes 422 DELIVERY_NOT_AVAILABLE at order creation for that mode.
path Parameters
idShipping profile ID
Shipping profile ID
wilayaIdWilaya ID (1–58)
Wilaya ID (1–58)
communeIdCommune ID
Commune ID
Set or update commune override › Request Body
homeEnabledstopDeskEnabledhomePricestopDeskPriceSet or update commune override › Responses
Override upserted (or removed if all fields null)
successRemove commune override
Removes the commune override row — the commune will again inherit the wilaya rule. Returns 404 COMMUNE_OVERRIDE_NOT_FOUND if no override row exists for this commune.
path Parameters
idShipping profile ID
Shipping profile ID
wilayaIdWilaya ID (1–58)
Wilaya ID (1–58)
communeIdCommune ID
Commune ID
Remove commune override › Responses
Override removed — commune reverts to wilaya defaults
success