### Installing Shiprocket Laravel SDK via Composer - Bash Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This command installs the seshac/laravel-shiprocket-api package into your Laravel project using Composer, making the Shiprocket API SDK available for use. It adds the package dependency to your composer.json file and downloads the necessary files. ```bash composer require seshac/laravel-shiprocket-api ``` -------------------------------- ### Get All Integrated Channels using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Demonstrates how to retrieve details about all integrated sales channels using the `get` method of the Shiprocket channel facade. ```php $channels = Shiprocket::channel($token)->get(); ``` -------------------------------- ### Get All Products (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Retrieves a list of all products from the Shiprocket account. An optional filter parameter array can be used for sorting or filtering results. ```php $filterParam = []; // you can use sort, sort_by, filter,filter_by $shipments = Shiprocket::product($token)->get(); ``` -------------------------------- ### Get All Pickup Locations using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Explains how to retrieve details for all configured pickup locations using the `getLocations` method of the Shiprocket pickup facade. ```php $location = Shiprocket::pickup($token)->getLocations(); ``` -------------------------------- ### Get Specific Product Details (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Retrieves the details of a single product by its ID. Requires the product ID as a parameter to the getSpecific method. ```php $productId = 1232122; $shipments = Shiprocket::product($token)->getSpecific($productId); ``` -------------------------------- ### Get All Shipment Details using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Shows how to retrieve details for all shipments using the `get` method of the Shiprocket shipment facade. Optional filtering and sorting parameters can be provided in the `$filterParam` array. ```php $filterParam = []; // you can use sort, sort_by, filter,filter_by $shipments = Shiprocket::shipment($token)->get(); ``` -------------------------------- ### Get Tracking by Multiple AWBs using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Shows how to retrieve tracking data for multiple shipments using an array of AWB numbers via the `throwMultipleAwb` method. Requires an array of `$awbs`. ```php $awbs = ["788830567028","788829354408"]; $response = Shiprocket::track($token)->throwMultipleAwb($awb); ``` -------------------------------- ### Get Specific Shipment Details using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Explains how to retrieve details for a single shipment using the `getSpecific` method of the Shiprocket shipment facade. Requires the `$shipemntId` of the specific shipment. ```php $shipemntId = 1232122; $shipments = Shiprocket::shipment($token)->getSpecific($shipemntId); ``` -------------------------------- ### Getting Shiprocket API Token from Config - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This snippet shows how to retrieve the Shiprocket API authentication token using the Shiprocket::getToken() method. This method uses the credentials configured in the shiprocket.php config file to perform the login and return the token. ```php use Seshac\Shiprocket\Shiprocket; . . . $token = Shiprocket::getToken();// if you added credentials at shiprocket.php config ``` -------------------------------- ### Get Specific NDR Shipment Details (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Retrieves detailed information for a specific shipment that is in NDR status, identified by its AWB code. ```php $awb_code = '0212331233322'; $response = Shiprocket::ndr($this->token)->getSpecificShipment($awb_code); // GET : https://apiv2.shiprocket.in/v1/external/ndr/{AWB} Where you can information of specific AWB which is in NDR ``` -------------------------------- ### Get All NDR Shipments (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Retrieves a list of all shipments currently in Non-Delivery Report (NDR) status using the NDR module of the Shiprocket wrapper. ```php $response = Shiprocket::ndr($this->token)->getShipments(); // EX : GET : https://apiv2.shiprocket.in/v1/external/ndr/all where you can get all the shipments that are in NDR. ``` -------------------------------- ### Get Tracking by AWB using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Demonstrates retrieving tracking information for a single shipment using its AWB number via the `throughAwb` method of the Shiprocket track facade. Requires the `$awb` number. ```php $awb = 1234444222; $response = Shiprocket::track($token)->throughAwb($awb); ``` -------------------------------- ### Get Tracking by Order ID using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Demonstrates retrieving tracking information for a shipment using its Order ID via the `throwOrderId` method of the Shiprocket track facade. Requires the `$orderId` and an optional `$channelID`. ```php $orderId = 123213; $channelID = 121; //optional $shipment = Shiprocket::track($token)->throwOrderId($orderId,$channelID); ``` -------------------------------- ### Get Tracking by Shipment ID using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Explains how to retrieve tracking information for a shipment using its Shipment ID via the `throwShipmentId` method of the Shiprocket track facade. Requires the `$shipmentId`. ```php $shipmentId = 123213; $response = Shiprocket::track($token)->throwShipmentId($shipmentId); ``` -------------------------------- ### Create Quick Order using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Demonstrates how to use the `quickCreate` method of the Shiprocket order facade to create, ship, add pickup, and generate labels/manifest for an order in a single call. Requires an array `$orderDetails` containing necessary parameters as specified in the Shiprocket API documentation. ```php $orderDetails = [ // refer aboce url for required parameters ]; $response = Shiprocket::order($token)->quickCreate($orderDetails); ``` -------------------------------- ### Publishing Shiprocket SDK Configuration - Bash Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This Artisan command publishes the configuration file for the Shiprocket Laravel SDK to your application's config directory. This allows you to customize settings like API credentials and response type. ```bash php artisan vendor:publish --provider="Seshac\Shiprocket\ShiprocketServiceProvider" --tag="config" ``` -------------------------------- ### Add New Products (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Creates new product entries in the Shiprocket account. Requires an array containing the product details according to the Shiprocket API documentation. ```php $productDetails = [ // refer above url for required parameters ]; $response = Shiprocket::product($token)->create($productDetails); ``` -------------------------------- ### Creating a Custom Shiprocket Order - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This code demonstrates how to create a new custom order in Shiprocket. It requires an authentication token and an array ($orderDetails) containing all the necessary order details as defined by the Shiprocket API documentation for creating custom orders. ```php $orderDetails = [ // refer above url for required parameters ]; $token = Shiprocket::getToken(); $response = Shiprocket::order($token)->create($orderDetails); ``` -------------------------------- ### Print Manifest using Order IDs (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Prints a previously generated manifest document for a list of order IDs. The manifest must be generated first using the 'Generate Manifest' API before attempting to print it. ```php $orderIds = [ 'order_ids' => [121221,122112] ]; $response = Shiprocket::generate($token)->printManifest(orderIds); ``` -------------------------------- ### Retrieving All Shiprocket Orders - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This code demonstrates how to fetch a list of all orders from the Shiprocket API. It requires an authentication token and accepts an array of parameters (like per_page) to filter or paginate the results, as specified in the Shiprocket API documentation. ```php $token = Shiprocket::getToken(); $orderDetails = [ // refer above url for required parameters 'per_page'=>20, ]; $response = Shiprocket::order($token)->getOrders($orderDetails); ``` -------------------------------- ### Request Shipment Pickup using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Illustrates requesting a pickup for shipments using the `requestPickup` method of the Shiprocket courier facade. Requires an array `$pickupDetails` containing details about the pickup request as specified in the Shiprocket API documentation. ```php $pickupDetails = [ // for paramets refer obove url. ]; $response = Shiprocket::courier($token)->requestPickup($pickupDetails); ``` -------------------------------- ### Authenticating with Shiprocket API using Credentials - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This code snippet demonstrates how to authenticate with the Shiprocket API by explicitly providing email and password credentials to the Shiprocket::login() method. This is useful if you don't want to rely on the credentials set in the published configuration file. ```php use Seshac\Shiprocket\Shiprocket; . . . $loginDetails = Shiprocket::login([ 'email' => 'yourAPiMail@example.com', 'password' => 'example' ]) // if you added credentials at shiprocket.php config file no need to pass credentials ``` -------------------------------- ### Shiprocket SDK Published Configuration File - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This is the content of the configuration file published by the SDK. It allows setting default Shiprocket API credentials (email and password, typically from environment variables) and specifying the desired response type for API calls (collection, object, or array). ```php return [ /* |-------------------------------------------------------------------------- | Default Shiprocket Credentilas |-------------------------------------------------------------------------- | | Here you can set the default shiprocket credentilas. However, you can pass the credentials while connecting to shiprocket client | */ 'credentials' => [ 'email' => env('SHIPROCKET_EMAIL', 'example@email.com'), 'password' => env('SHIPROCKET_PASSWORD', 'password'), ], /* |-------------------------------------------------------------------------- | Default output response type |-------------------------------------------------------------------------- | | Here you may specify which of the output response you need. | | Supported: "collection" , "object", "array" | */ 'responseType' => 'collection', ]; ``` -------------------------------- ### Creating a Channel Specific Shiprocket Order - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This snippet shows how to create an order associated with a specific sales channel in Shiprocket. It requires an authentication token, the order details array, and a boolean flag ($channelSpecificOrder) set to true to indicate it's a channel-specific order. ```php $orderDetails = [ // refer above url for required parameters ]; $channelSpecificOrder = true; $response = Shiprocket::order($token)->create($orderDetails,$channelSpecificOrder); ``` -------------------------------- ### Generate Manifest using Shipment IDs (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Generates a manifest document for a list of shipment IDs using the Shiprocket API wrapper. Requires a valid authentication token and an array of shipment IDs. ```php $shipmentIds = [ 'shipment_id' => [121221,122112] ]; $manifestDetails = Shiprocket::generate($token)->manifest(shipmentIds); ``` -------------------------------- ### Check Warehouse SRF Serviceability (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Checks the serviceability of a warehouse for a specific delivery postcode, SKU, and quantity. Requires filter parameters including postcode, SKU, and quantity in an array. ```php $filterParam = [ 'postcode' => 110030, // Delivery Post Code 'sku' => "SKU name", 'quantity' => 1, //Quantity in numbers ]; $response = Shiprocket::warehouse($this->token)->checkServiceability($filterParam); // EX : https://apiv2.shiprocket.in/v1/warehouse/srf-serviceability?postcode=784001&sku=Baby-socket&quantity=1 // Response : ['serviceability'=>true,'etd'=>'2020-12-06'] ``` -------------------------------- ### Add New Pickup Location using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Shows how to add a new pickup location using the `addLocation` method of the Shiprocket pickup facade. Requires an array `$newLocation` containing details for the new location as specified in the Shiprocket API documentation. ```php $newLocation = []; //Refer the above url for required parameteres $location = Shiprocket::pickup($token)->addLocation($newLocation); ``` -------------------------------- ### Generate Invoice using Order IDs (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Generates invoices for a list of order IDs. The order IDs should be provided in an array with the key 'ids'. ```php $orderIds = [ 'ids' => [121221,122112] ]; $response = Shiprocket::generate($token)->invoice(orderIds); ``` -------------------------------- ### Check Domestic Courier Serviceability using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Shows how to check if courier services are available for a given pincode using the `checkServiceability` method of the Shiprocket courier facade. Requires an array `$pincodeDetails` with relevant parameters as specified in the Shiprocket API documentation. ```php $pincodeDetails = [ // for paramets refer obove url. ]; $response = Shiprocket::courier($token)->checkServiceability($pincodeDetails); ``` -------------------------------- ### Check International Courier Serviceability using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Demonstrates checking international courier serviceability using the `checkInterNationalServiceability` method of the Shiprocket courier facade. Requires an array `$pincodeDetails` with international-specific parameters as specified in the Shiprocket API documentation. ```php $pincodeDetails = [ // for paramets refer obove url. ]; $response = Shiprocket::courier($token)->checkInterNationalServiceability($pincodeDetails); ``` -------------------------------- ### Generate Label using Shipment IDs (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Generates shipping labels for a list of shipment IDs. The shipment IDs should be passed as an array to the label generation method. ```php $shipmentIds = [ 'shipment_id' => [121221,122112] ]; $response = Shiprocket::generate($token)->label(shipmentIds); ``` -------------------------------- ### Retrieving a Specific Shiprocket Order - PHP Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md This snippet shows how to retrieve details for a single Shiprocket order using its unique order ID. It requires an authentication token and the specific order ID you want to fetch. ```php $token = Shiprocket::getToken(); $orderId = 16167171; $response = Shiprocket::order($token)->find($orderId); ``` -------------------------------- ### Cancel Orders using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Shows how to cancel one or more orders using the `cancel` method of the Shiprocket order facade. Requires an array `ids` containing the order IDs to be cancelled. ```php $ids = [12345,12346]; $response = Shiprocket::order($token)->cancel(['ids' => $ids]); ``` -------------------------------- ### Update Order Pickup Location using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Illustrates updating the pickup location for one or more orders using the `updatePickupLocation` method. Requires an array `$orderDetails` specifying `order_id` (array of IDs) and `pickup_location` (string name). ```php $orderDetails = [ 'order_id' => [12345,123456 ], 'pickup_location' => 'location name' ]; $response = Shiprocket::order($token)->updatePickupLocation($orderDetails); ``` -------------------------------- ### Generate AWB for Shipment using Laravel Shiprocket API (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Explains how to generate an AWB for a specific shipment using the `generateAWB` method of the Shiprocket courier facade. Requires an array `$data` containing `shipment_id` and `courier_id`. ```php $data = [ 'shipment_id' => '', 'courier_id' => '' ]; $response = Shiprocket::courier($token)->generateAWB($data); // for more details visit above url ``` -------------------------------- ### Reattempt NDR Shipment (PHP) Source: https://github.com/seshac/laravel-shiprocket-api/blob/master/README.md Initiates a reattempt delivery action for an open NDR shipment. Requires shipment details including AWB, address, and phone number in an array. ```php $shipmentDetails = ['awb' => '', 'address_1' => '', 'address2' => '', 'phone' => '']; $response = Shiprocket::ndr($this->token)->reattempt($shipmentDetails); // POST : https://apiv2.shiprocket.in/v1/external/ndr/reattempt?awb=190729394&address1=Dr Nageshwar&address2=opposite Ashok Nagar&phone=9534952626&deferred_date=2020-08-27 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.