Download the PHP package laraditz/courier-jt-express without Composer

On this page you can find all versions of the php package laraditz/courier-jt-express. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package courier-jt-express

laraditz/courier-jt-express

Latest Version on Packagist Total Downloads

J&T Express Malaysia driver for laraditz/courier.

Targets the J&T Express Malaysia Open Platform API (ylopenapi.jtexpress.my) — Malaysia domestic shipping only.

Requirements

Installation

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

Configuration

Add to your .env:

config/jtexpress.php (published separately):

Key Description
api_account Numeric account ID from the J&T Open Platform console — sent as the apiAccount header
private_key Used to sign every request (see Signing below)
customer_code Customer code provided by your J&T outlet, e.g. J0086474299
password The plaintext password J&T issues per account. The driver hashes it (uppercase MD5) on every request — do not pre-hash it yourself
sandbox true to use the demo environment, false for production

Available Methods

Method Parameters Returns Notes
createShipment ShipmentPayload $payload ShipmentResult order/addOrder. Generates a UUID reference if $payload->reference is not supplied.
getShipment string $reference ShipmentResult order/getOrders. $result->status is always 'unknown' — this endpoint carries no delivery-progress field, use track() for live status.
track string $trackingNumber TrackingResult logistics/trace. Throws ShipmentNotFoundException when the waybill is unknown.
cancelShipment string $waybillNumber, ?string $reference = null CancelResult order/cancelOrder. Throws InvalidPayloadException if $reference is null — J&T requires it.
getLabel string $waybillNumber, ?string $reference = null LabelResult order/printOrder. Throws InvalidPayloadException if $reference is null — J&T requires it.
getRates RatePayload $payload Throws UnsupportedOperationException
getAvailability AvailabilityPayload $payload Throws UnsupportedOperationException

Rate quoting and service availability lookup are not supported by the J&T Express Malaysia API.

Why $reference matters here: J&T's cancel and print-label endpoints are keyed on your own order reference (txlogisticId), not the waybill number (billCode) — the opposite of most couriers. Persist ShipmentResult::$reference alongside your order when you create a shipment, and pass it back in to cancelShipment()/getLabel() later.

Refer to the laraditz/courier README for payload/result DTO definitions and full usage examples.

Usage

Webhooks

The driver implements HandlesWebhooks. verifyWebhook() recomputes the request digest from the incoming bizContent and compares it (via hash_equals()) against the digest header — the same signature scheme used for outbound requests, not a static secret token.

Give J&T your app's webhook URL:

Webhook events

Event class Fired when
Laraditz\Courier\JtExpress\Events\TrackingUpdated Once per scan detail in an incoming Tracking Info Callback

Listen for it in your EventServiceProvider:

Signing

Every request is signed per the J&T Open Platform's scheme:

sent as the digest header alongside apiAccount and a millisecond timestamp. The password business parameter is strtoupper(md5($plaintextPassword)), computed fresh on every request from the plaintext password in your config.

Verify before production use. This scheme is implemented from J&T's (partially machine-translated) API documentation and has not been confirmed against a live sandbox call. Test against the demo credentials in J&T's docs before sending real traffic.

Scope

This driver covers Malaysia domestic shipments only, matching what the shared Address/Parcel/ShipmentPayload DTOs carry:

Not supported: international shipments (customs info, province/city/area breakdown), COD, declared-value insurance, and multi-parcel (multipleVotes) orders — none of these exist on the shared DTOs today.

Status Mapping

J&T scanTypeCode values mapped to the normalized status vocabulary. This map is best-effort — J&T's own code/name reference table lost row alignment during translation, so only a handful of codes are confidently mapped; everything else falls back to unknown (the raw scan description is always preserved in TrackingEvent::$description regardless):

scanTypeCode Status
10 picked_up
20 dispatched
30 arrived
94 out_for_delivery
100 delivered
110 problem
172 returned
173 return_delivered
300306 exception
other unknown

Testing

License

MIT


All versions of courier-jt-express with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laraditz/courier Version @dev
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laraditz/courier-jt-express contains the following files

Loading the files please wait ...