PHPackages                             aniket-in/laravel-shiprocket - 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. [API Development](/categories/api)
4. /
5. aniket-in/laravel-shiprocket

ActiveLibrary[API Development](/categories/api)

aniket-in/laravel-shiprocket
============================

Shiprocket API Wrapper for Laravel

0.0.2(4y ago)299↓66.7%2[4 PRs](https://github.com/Aniket-IN/laravel-shiprocket/pulls)MITPHPPHP ^7.3|^8.0CI passing

Since May 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Aniket-IN/laravel-shiprocket)[ Packagist](https://packagist.org/packages/aniket-in/laravel-shiprocket)[ Docs](https://github.com/aniket-in/laravel-shiprocket)[ RSS](/packages/aniket-in-laravel-shiprocket/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (11)Versions (7)Used By (0)

Laravel-Shiprocket
==================

[](#laravel-shiprocket)

Shiprocket API Wrapper for Laravel

Table of Contents
-----------------

[](#table-of-contents)

1. [Features](#features)
2. [Installation](#installation)
3. [Import](#installation)
4. [Authentication](#authentication)
5. [Response](#response)
6. [Usage](#response)
    1. [Orders](#orders)
    2. [Couriers](#couriers)
    3. [Return Orders](#return-orders)
    4. [Shipments](#shipments)
    5. [Tracking](#tracking)
    6. [Pickup Addresses](#pickup-addresses)
    7. [Wallet](#wallet)
    8. [Products](#products)

Features
--------

[](#features)

- Up-to-date with Shiprocket's API
- Fully Customizeable
- Easy One Liners
- Token Caching
- Any Data Type for Response

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

[](#installation)

You can install the package via composer:

```
  composer require aniket-in/shiprocket-laravel
```

You can publish config file with:

```
  php artisan vendor:publish --provider="AniketIN\Shiprocket\ShiprocketServiceProvider" --tag="shiprocket-config"
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Shiprocket Credentilas
    |--------------------------------------------------------------------------
    |
    | Here you can set multiple shiprocket credentilas pair.
    | And then use any credential pair by their key i.e. default, second
    |
    */

    'credentials' => [
        'default' => [
            'email' => env('SHIPROCKET_EMAIL', 'example@email.com'),
            'password' => env('SHIPROCKET_PASSWORD', 'password'),
        ],
        // 'second' => [
        //     'email' => env('SHIPROCKET_SECOND_EMAIL', 'example@email.com'),
        //     'password' => env('SHIPROCKET_SECOND_PASSWORD', 'password'),
        // ],
    ],

     /*
    |--------------------------------------------------------------------------
    | Shiprocket Credentilas
    |--------------------------------------------------------------------------
    |
    | Here you can set the default credentilas to use by their key.
    | i.e. default, second
    |
    */

    'default_credentials' => env('SHIPROCKET_DEFAULT_CREDENTIALS', 'default'),

     /*
    |--------------------------------------------------------------------------
    | Shiprocket Credentilas
    |--------------------------------------------------------------------------
    |
    | Here you can set the behaviour whether to use caching or not for auth tokens.
    |
    */
    'token_cache' => env('SHIPROCKET_TOKEN_CACHE', true),

    /*
    |--------------------------------------------------------------------------
    | Token Cache Expiry Duration
    |--------------------------------------------------------------------------
    |
    | Here you can set token's cache expiry duration
    |
    */
    'token_cache_duration' => env('SHIPROCKET_TOKEN_CACHE_DURATION', 86400),

];
```

Import
------

[](#import)

To use the methods of this package, import the Facade on top of your controller like this:

```
use AniketIN\Shiprocket\Facades\Shiprocket;
```

Authentication
--------------

[](#authentication)

Using this package handle the Authentication itself, you don't need to do anything other than, just setting up your Shiprocket credentials in the `config/shiprocket.php` file.

You can also configure *token caching* to `true` in that config file. This will save a lot of time by caching the *token* and not generating new token on every request. The `cache duration` is also customizeable.

However, if you want to just get the token

```
Shiprocket::getToken();
```

Also, if you want to use different credential other than the default one, then:

```
Shiprocket::withCredential('another-credential-key')->nowCallYourMethod(...);
```

Response
--------

[](#response)

To get the returned response from the API, you may use any of the Laravel provided method, like:

```
Shiprocket::order()->all()->json();
```

All available methods:

```
$response->body() : string;
$response->json($key = null) : array|mixed;
$response->object() : object;
$response->collect($key = null) : Illuminate\Support\Collection;
$response->status() : int;
$response->ok() : bool;
$response->successful() : bool;
$response->redirect(): bool;
$response->failed() : bool;
$response->serverError() : bool;
$response->clientError() : bool;
$response->header($header) : string;
$response->headers() : array;
```

For more information refer

Orders
------

[](#orders)

#### Create Custom Order

[](#create-custom-order)

```
Shiprocket::order()->create([
    // refer above url for required parameters...
])
```

#### Create Channel Specific Order

[](#create-channel-specific-order)

```
Shiprocket::order()->createChannelSpecific([
    // refer above url for required parameters...
])
```

#### Change/Update Pickup Location of Created Orders

[](#changeupdate-pickup-location-of-created-orders)

```
Shiprocket::order()->updatePickupAddress([
    // refer above url for required parameters...
])
```

#### Update Customer Delivery Address

[](#update-customer-delivery-address)

```
Shiprocket::order()->updateCustomerAddress([
    // refer above url for required parameters...
])
```

#### Update Order

[](#update-order)

```
Shiprocket::order()->update([
    // refer above url for required parameters...
])
```

#### Cancel an Order

[](#cancel-an-order)

```
Shiprocket::order()->cancelByIds([
    // order ids...
])
```

#### Get all Orders

[](#get-all-orders)

```
Shiprocket::order()->all([
    // refer above url for required parameters...
])
```

#### Get Specific Order Details

[](#get-specific-order-details)

```
Shiprocket::order()->detailsById($orderId)
```

Couriers
--------

[](#couriers)

#### Generate AWB for Shipment

[](#generate-awb-for-shipment)

```
Shiprocket::courier()->generateAwbForShipment([
    // refer above url for required parameters...
])
```

#### List of Couriers

[](#list-of-couriers)

```
Shiprocket::courier()->list([
    // refer above url for required parameters...
])
```

#### Check Courier Serviceability

[](#check-courier-serviceability)

```
Shiprocket::courier()->serviceability([
    // refer above url for required parameters...
])
```

#### Check International Courier Serviceability

[](#check-international-courier-serviceability)

```
Shiprocket::courier()->internationalServiceability([
    // refer above url for required parameters...
])
```

#### Request for Shipment Pickup

[](#request-for-shipment-pickup)

```
Shiprocket::courier()->requestShipmentPickup([
    // refer above url for required parameters...
])
```

Return Orders
-------------

[](#return-orders)

#### Create a Return Order

[](#create-a-return-order)

```
Shiprocket::return()->create([
    // refer above url for required parameters...
])
```

#### Get All Return Orders

[](#get-all-return-orders)

```
Shiprocket::return()->all([
    // refer above url for required parameters...
])
```

Shipments
---------

[](#shipments)

#### Get All Shipment Details

[](#get-all-shipment-details)

```
Shiprocket::shipment()->all([
    // refer above url for required parameters...
])
```

#### Get Details of Specific Shipment

[](#get-details-of-specific-shipment)

```
Shiprocket::shipment()->detailsById($shipment_id)
```

#### Cancel Shipments By AWBs

[](#cancel-shipments-by-awbs)

```
Shiprocket::shipment()->cancelByAWBs([123456, 7890123])
```

Tracking
--------

[](#tracking)

#### Get Tracking through AWB

[](#get-tracking-through-awb)

```
Shiprocket::track()->awb($awb)
```

#### Get Tracking Data for Multiple AWBS

[](#get-tracking-data-for-multiple-awbs)

```
Shiprocket::track()->multipleAwb($awb_array)
```

#### Get Tracking through Shipment ID

[](#get-tracking-through-shipment-id)

```
Shiprocket::track()->shipment($shipment_id)
```

#### Get Tracking Data through Order iD

[](#get-tracking-data-through-order-id)

```
Shiprocket::track()->order($order_id)
```

Pickup Addresses
----------------

[](#pickup-addresses)

#### Get All Pickup Locations

[](#get-all-pickup-locations)

```
Shiprocket::pickupAddress()->all()
```

#### Add a New Pickup Location

[](#add-a-new-pickup-location)

```
Shiprocket::pickupAddress()->create([
    // refer above url for required parameters...
])
```

Wallet
------

[](#wallet)

#### Get Wallet Balance

[](#get-wallet-balance)

```
Shiprocket::wallet()->getBalance()
```

Products
--------

[](#products)

#### Get All Products

[](#get-all-products)

```
Shiprocket::product()->all([
    // refer above url for required parameters...
])
```

#### Get Specific Product Details

[](#get-specific-product-details)

```
Shiprocket::product()->detailsById($product_id)
```

#### Add New Products

[](#add-new-products)

```
Shiprocket::product()->create([
    // refer above url for required parameters...
])
```

Authors
-------

[](#authors)

- [@Aniket-IN](https://github.com/Aniket-IN)

Support &amp; Feedback
----------------------

[](#support--feedback)

For support or feedback, email  or raise your issue.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance60

Regular maintenance activity

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.8% 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 ~0 days

Total

2

Last Release

1472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9197e9903fefa6fc932913aff2f4aebc6d41e5cc10fc6a82f8c0c3e144866eb1?d=identicon)[Aniket-IN](/maintainers/Aniket-IN)

---

Top Contributors

[![Aniket-IN](https://avatars.githubusercontent.com/u/64463116?v=4)](https://github.com/Aniket-IN "Aniket-IN (55 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (21 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![RohitM-IN](https://avatars.githubusercontent.com/u/28777412?v=4)](https://github.com/RohitM-IN "RohitM-IN (2 commits)")

---

Tags

laravelAniket-INlaravel-shiprocket

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aniket-in-laravel-shiprocket/health.svg)

```
[![Health](https://phpackages.com/badges/aniket-in-laravel-shiprocket/health.svg)](https://phpackages.com/packages/aniket-in-laravel-shiprocket)
```

###  Alternatives

[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[likeabas/filament-chatgpt-agent

Integrate with OpenAI ChatGPT

235.3k](/packages/likeabas-filament-chatgpt-agent)

PHPackages © 2026

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