PHPackages                             laraditz/courier-sfexpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laraditz/courier-sfexpress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laraditz/courier-sfexpress
==========================

SF Express driver for laraditz/courier.

v1.0.1(1mo ago)18MITPHPPHP ^8.1

Since Jun 18Pushed 1w agoCompare

[ Source](https://github.com/laraditz/courier-sfexpress)[ Packagist](https://packagist.org/packages/laraditz/courier-sfexpress)[ RSS](/packages/laraditz-courier-sfexpress/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (8)Versions (4)Used By (0)

laraditz/courier-sfexpress
==========================

[](#laraditzcourier-sfexpress)

SF Express driver for [laraditz/courier](https://github.com/laraditz/courier).

Targets the **SF Express International Open Platform** (`api-ifsp.sf.global`) — domestic shipping for Malaysia, Indonesia, and Vietnam.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, 12, or 13
- `laraditz/courier` ^1.0

Installation
------------

[](#installation)

```
composer require laraditz/courier-sfexpress
```

Both service providers are auto-discovered. Publish the config:

```
php artisan vendor:publish --tag=courier-config
php artisan vendor:publish --tag=courier-sfexpress-config
```

Configuration
-------------

[](#configuration)

Add to your `.env`:

```
COURIER_DRIVER=sfexpress

SFEXPRESS_KEY=your-app-key
SFEXPRESS_SECRET=your-app-secret
SFEXPRESS_CUSTOMER_CODE=your-customer-code
SFEXPRESS_AES_KEY=your-43-char-encoding-aes-key
SFEXPRESS_PAY_MONTH_CARD=your-pay-month-card
SFEXPRESS_COUNTRY=MY
SFEXPRESS_SCOPE=OSMY
SFEXPRESS_SANDBOX=true
```

`config/sfexpress.php` (published separately):

```
return [
    'key'              => env('SFEXPRESS_KEY'),
    'secret'           => env('SFEXPRESS_SECRET'),
    'customer_code'    => env('SFEXPRESS_CUSTOMER_CODE'),
    'encoding_aes_key' => env('SFEXPRESS_AES_KEY'),
    'pay_month_card'   => env('SFEXPRESS_PAY_MONTH_CARD'),
    'country'          => env('SFEXPRESS_COUNTRY', 'MY'),
    'scope_name'       => env('SFEXPRESS_SCOPE', 'OSMY'),
    'sandbox'          => env('SFEXPRESS_SANDBOX', false),
    'base_url'         => 'https://api-ifsp.sf.global',
    'sandbox_url'      => 'https://api-ifsp-sit.sf.global',
    'timeout'          => 30,
];
```

KeyDescription`key`App key from the SF Express Open Platform`secret`App secret for token generation`customer_code`Customer code assigned by SF Express (e.g. `OSMYICRM-OSMY00009Z38`)`encoding_aes_key`43-character AES key for request/response encryption`pay_month_card`Monthly billing card number`country`2-letter country code: `MY`, `ID`, or `VN``scope_name`Scope assigned to your account (e.g. `OSMY`, `OSID`, `OSVN`)Available Methods
-----------------

[](#available-methods)

MethodParametersReturnsNotes`createShipment``ShipmentPayload $payload``ShipmentResult``IUOP_OS_CREATE_ORDER``track``string $trackingNumber``TrackingResult``IUOP_OS_QUERY_TRACK``getLabel``string $waybillNumber``LabelResult``IUOP_OS_PRINT_ORDER` — PDF bytes`cancelShipment``string $waybillNumber``CancelResult``IUOP_OS_CANCEL_ORDER``getRates``RatePayload $payload`—Throws `UnsupportedOperationException``getAvailability``AvailabilityPayload $payload`—Throws `UnsupportedOperationException`Rate queries and service availability checks are not supported by the SF Express domestic API.

Refer to the [laraditz/courier README](https://github.com/laraditz/courier) for payload/result DTO definitions and full usage examples.

Usage
-----

[](#usage)

```
use Laraditz\Courier\Facades\Courier;

Courier::createShipment($payload);   // ShipmentResult
Courier::track($waybillNumber);      // TrackingResult
Courier::cancelShipment($waybill);   // CancelResult
Courier::getLabel($waybill);         // LabelResult — content is raw PDF bytes
```

API Notes
---------

[](#api-notes)

**Authentication:** An access token is fetched automatically via `GET /openapi/api/token` before each request and cached for the lifetime of the request. Tokens expire after ~2 hours.

**Encryption:** All dispatch request bodies are AES-256-CBC encrypted using the `encoding_aes_key`. Responses are decrypted automatically.

**Error handling:** Two levels of error checking apply:

1. Outer envelope: `apiResultCode` must equal `0` (integer) — any other value throws `CourierException`
2. Inner business result (after decryption): `success` must be `true` and `code` must be `'0'` — any other value throws `CourierException`

**Labels:** `getLabel` downloads the PDF from the signed URL returned by the API and returns the raw bytes in `LabelResult::$content`. The original URL is available in `$result->meta()['label_url']`.

**Not found:** `track()` throws `ShipmentNotFoundException` when the waybill is not known to the system.

Service Codes
-------------

[](#service-codes)

Pass the service code as `ShipmentPayload::$serviceCode`. Common domestic codes:

CountryCodeDescriptionMY`M111`StandardMY`M101`EconomyMY`M102`ExpressMY`M105`BulkyID`ID101`StandardID`ID102`EconomyVN`SFVN100101`StandardFull lists are in the SF Express Open Platform appendix.

Status Mapping
--------------

[](#status-mapping)

SF Express `opCode` values mapped to the [normalized status vocabulary](https://github.com/laraditz/courier#normalized-status-vocabulary):

opCodeStatus`50``picked_up``30``in_transit``70``out_for_delivery``80``delivered``90``failed_delivery``35``returned`other`unknown`License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1203676?v=4)[Raditz Farhan](/maintainers/raditzfarhan)[@raditzfarhan](https://github.com/raditzfarhan)

---

Top Contributors

[![raditzfarhan](https://avatars.githubusercontent.com/u/1203676?v=4)](https://github.com/raditzfarhan "raditzfarhan (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laraditz-courier-sfexpress/health.svg)

```
[![Health](https://phpackages.com/badges/laraditz-courier-sfexpress/health.svg)](https://phpackages.com/packages/laraditz-courier-sfexpress)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.4M352](/packages/psalm-plugin-laravel)[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k36.9M381](/packages/yajra-laravel-datatables-oracle)[spatie/laravel-export

Create a static site bundle from a Laravel app

679153.2k6](/packages/spatie-laravel-export)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

1007.4k](/packages/zidbih-laravel-deadlock)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
