diff --git a/README.md b/README.md index 41b3422..c156850 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ If you need support using AfterShip products, please contact support@aftership.c - [AfterShip Tracking API library for PHP](#aftership-tracking-api-library-for-php) - [Table of Contents](#table-of-contents) - [Before you begin](#before-you-begin) + - [API and SDK Version](#api-and-sdk-version) - [Quick Start](#quick-start) - [Installation](#installation) - - [Usage](#usage) - [Constructor](#constructor) - [Example](#example) - [Rate Limiter](#rate-limiter) @@ -22,8 +22,6 @@ If you need support using AfterShip products, please contact support@aftership.c - [Endpoints](#endpoints) - [/trackings](#trackings) - [/couriers](#couriers) - - [/last\_checkpoint](#last_checkpoint) - - [/notifications](#notifications) - [/estimated-delivery-date](#estimated-delivery-date) - [Help](#help) - [License](#license) @@ -37,41 +35,31 @@ Before you begin to integrate: - [Create an API key](https://organization.automizely.com/api-keys). - [Install PHP](https://www.php.net/downloads.php) version 8.0 or later. -## Quick Start +### API and SDK Version -### Installation -```bash -composer require aftership/tracking-sdk -``` +Each SDK version is designed to work with a specific API version. Please refer to the table below to identify the supported API versions for each SDK version, ensuring you select the appropriate SDK version for the API version you intend to use. -### Usage -```php - 'YOUR_API_KEY', - 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_API_KEY, -]); +## Quick Start -try { - $trackingInfo = $client->tracking->getTrackingById(''); - var_dump($trackingInfo->checkpoints); -} catch (\Tracking\Exception\AfterShipError $e) { - // Handle the error - var_dump($e->getErrorCode()); - var_dump($e->getStatusCode()); -} +### Installation +```bash +composer require aftership/tracking-sdk ``` - ## Constructor Create AfterShip instance with options | Name | Type | Required | Description | -|------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------| +| ---------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | api_key | string | ✔ | Your AfterShip API key | | auth_type | enum | | Default value: `AuthType.API_KEY`
AES authentication: `AuthType.AES`
RSA authentication: `AuthType.RSA` | | api_secret | string | | Required if the authentication type is `AuthType.AES` or `AuthType.RSA` | @@ -84,23 +72,35 @@ Create AfterShip instance with options ### Example ```php + 'YOUR_API_KEY', - 'apiSecret' => 'YOUR_API_SECRET', - 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_AES, + 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_API_KEY, ]); + +try { + $trackingInfo = $client->tracking->getTrackingById(''); + var_dump($trackingInfo->checkpoints); +} catch (\Tracking\Exception\AfterShipError $e) { + // Handle the error + var_dump($e->getErrorCode()); + var_dump($e->getStatusCode()); +} ``` ## Rate Limiter -See the [Rate Limit](https://www.aftership.com/docs/aftership/quickstart/rate-limit) to understand the AfterShip rate limit policy. +See the [Rate Limit](https://www.aftership.com/docs/tracking/2024-07/quickstart/rate-limit) to understand the AfterShip rate limit policy. ## Error Handling The SDK will return an error object when there is any error during the request, with the following specification: | Name | Type | Description | -|---------------|--------|--------------------------------| +| ------------- | ------ | ------------------------------ | | message | string | Detail message of the error | | code | enum | Error code enum for API Error. | | meta_code | number | API response meta code. | @@ -110,30 +110,30 @@ The SDK will return an error object when there is any error during the request, ### Error List -| code | meta_code | status_code | message | -|-----------------------------------|------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | -| INVALID_JSON | 4001 | 400 | Invalid JSON data. | -| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | -| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | -| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | -| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | -| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | -| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | -| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | -| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | -| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | -| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | -| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | -| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. | -| ID_INVALID | 4015 | 400 | The value of id is invalid. | -| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | -| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | -| API_KEY_INVALID | 401 | 401 | The API key is invalid. | -| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | -| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | -| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | -| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. | +| code | meta_code | status_code | message | +| --------------------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | +| INVALID_JSON | 4001 | 400 | Invalid JSON data. | +| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | +| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | +| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | +| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | +| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | +| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | +| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | +| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | +| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | +| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | +| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | +| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. | +| ID_INVALID | 4015 | 400 | The value of id is invalid. | +| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | +| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | +| API_KEY_INVALID | 401 | 401 | The API key is invalid. | +| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | +| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | +| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | +| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. | ## Endpoints @@ -141,16 +141,14 @@ The AfterShip instance has the following properties which are exactly the same a - courier - Get a list of our supported couriers. - tracking - Create trackings, update trackings, and get tracking results. -- last_checkpoint - Get tracking information of the last checkpoint of a tracking. -- notification - Get, add or remove contacts (sms or email) to be notified when the status of a tracking has changed. - +- estimated-delivery-date - Get estimated delivery date for your order. ### /trackings **POST** /trackings ```php -$payload = new \Tracking\API\Tracking\TrackingCreateTrackingRequest(); +$payload = new \Tracking\API\Tracking\CreateTrackingRequest(); $payload->tracking_number = ''; $payload->slug = ''; $trackingInfo = $client->tracking->createTracking($payload); @@ -160,7 +158,7 @@ var_dump($trackingInfo); **DELETE** /trackings/:id ```php -$trackingInfo = $client->tracking->deleteTrackingById(''); +$trackingInfo = $client->tracking->deleteTrackingById(''); var_dump($trackingInfo); ``` @@ -178,23 +176,23 @@ var_dump($trackingInfo); **GET** /trackings/:id ```php -$trackingInfo = $client->tracking->getTrackingById(''); +$trackingInfo = $client->tracking->getTrackingById(''); var_dump($trackingInfo); ``` **PUT** /trackings/:id ```php -$payload = new \Tracking\API\Tracking\TrackingUpdateTrackingByIdRequest(); +$payload = new \Tracking\API\Tracking\UpdateTrackingByIdRequest(); $payload->title = 'test'; -$trackingInfo = $client->tracking->updateTrackingById('', $payload); +$trackingInfo = $client->tracking->updateTrackingById('', $payload); var_dump($trackingInfo); ``` **POST** /trackings/:id/retrack ```php -$trackingInfo = $client->tracking->retrackTrackingById(''); +$trackingInfo = $client->tracking->retrackTrackingById(''); var_dump($trackingInfo); ``` @@ -203,7 +201,7 @@ var_dump($trackingInfo); ```php $payload = new \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest(); $payload->reason = 'DELIVERED'; -$trackingInfo = $client->tracking->markTrackingCompletedById('', $payload); +$trackingInfo = $client->tracking->markTrackingCompletedById('', $payload); var_dump($trackingInfo); ``` @@ -226,48 +224,12 @@ var_dump($couriers); ```php $payload = new \Tracking\API\Courier\TrackingDetectCourierRequest(); -$payload->slug = ''; +$payload->slug = ['']; $payload->tracking_number = ''; $couriers = $client->courier->detectCourier($payload); var_dump($couriers); ``` -### /last_checkpoint - -**GET** /last_checkpoint/:id - -```php -$checkpoint = $client->last_checkpoint->getCheckpointByTrackingId(''); -var_dump($checkpoint); -``` - -### /notifications - -**GET** /notifications/:id - -```php -$notification = $client->notification->getNotificationByTrackingId(''); -var_dump($notification); -``` - -**POST** /notifications/:id/add - -```php -$payload = new \Tracking\Model\NotificationRequestV1(); -$payload->emails = ['YOUR_EMAIL']; -$notification = $client->notification->addNotificationByTrackingId('', $payload); -var_dump($notification); -``` - -**POST** /notifications/:id/remove - -```php -$payload = new \Tracking\Model\NotificationRequestV1(); -$payload->emails = ['YOUR_EMAIL']; -$notification = $client->notification->deleteNotificationByTrackingId('', $payload); -var_dump($notification); -``` - ### /estimated-delivery-date **POST** /estimated-delivery-date/predict-batch @@ -276,6 +238,16 @@ var_dump($notification); $payload = new \Tracking\API\EstimatedDeliveryDate\PredictBatchRequest(); $edd = new \Tracking\Model\EstimatedDeliveryDateRequest(); $edd->slug = ''; +$edd->pickup_time = '2024-08-01 06:42:30'; +$orginAddress = new \Tracking\Model\OriginAddressEstimatedDeliveryDateRequest(); +$orginAddress->country = ''; +$orginAddress->state = ''; +$edd->origin_address = $orginAddress; + +$destAddress = new \Tracking\Model\DestinationAddressEstimatedDeliveryDateRequest(); +$destAddress->country = ''; +$destAddress->state = ''; +$edd->destination_address = $destAddress; $payload->estimated_delivery_dates = [$edd]; $notification = $client->estimated_delivery_date->predictBatch($payload); var_dump($notification); diff --git a/composer.json b/composer.json index 11c4521..4c19714 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require": { - "php": ">=8.1.0", + "php": ">=8.0.0", "guzzlehttp/guzzle": "6.5.8", "phpseclib/phpseclib": "3.0.37", "symfony/serializer": "^3.4", diff --git a/composer.lock b/composer.lock index 04ee6b4..95e1402 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "66a36581a05774a47156b44b3746f298", + "content-hash": "8c13bc6687afa832f21c89e97bc23a1b", "packages": [ { "name": "doctrine/deprecations", @@ -1820,30 +1820,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -1871,7 +1879,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.2.0" }, "funding": [ { @@ -1887,20 +1895,20 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-07-25T09:36:02+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -1952,7 +1960,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -1968,7 +1976,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", @@ -2146,16 +2154,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.60.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e595e4e070d17c5d42ed8c4206f630fcc5f401a4", + "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4", "shasum": "" }, "require": { @@ -2237,7 +2245,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.60.0" }, "funding": [ { @@ -2245,7 +2253,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-07-25T09:26:51+00:00" }, { "name": "psr/container", @@ -2774,31 +2782,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -2842,7 +2850,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -2850,7 +2858,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -2932,29 +2940,29 @@ }, { "name": "sebastian/diff", - "version": "5.1.1", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2986,8 +2994,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -2995,28 +3002,27 @@ "type": "github" } ], - "time": "2024-03-02T07:15:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "symfony/console", - "version": "v6.4.9", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed", + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -3030,16 +3036,18 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "autoload": { @@ -3068,12 +3076,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command-line", + "command line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.9" + "source": "https://github.com/symfony/console/tree/v6.0.19" }, "funding": [ { @@ -3089,29 +3097,29 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3140,7 +3148,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { @@ -3156,29 +3164,28 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.4.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8d7507f02b06e06815e56bb39aa0128e3806208b" + "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8d7507f02b06e06815e56bb39aa0128e3806208b", - "reference": "8d7507f02b06e06815e56bb39aa0128e3806208b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2.5|^3" + "php": ">=8.0.2", + "symfony/event-dispatcher-contracts": "^2|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/service-contracts": "<2.5" + "symfony/dependency-injection": "<5.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -3186,13 +3193,17 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, "type": "library", "autoload": { @@ -3220,7 +3231,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" }, "funding": [ { @@ -3236,30 +3247,33 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "psr/event-dispatcher": "^1" }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3296,7 +3310,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" }, "funding": [ { @@ -3312,30 +3326,27 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.9", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b51ef8059159330b74a4d52f68e671033c0fe463" + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b51ef8059159330b74a4d52f68e671033c0fe463", - "reference": "b51ef8059159330b74a4d52f68e671033c0fe463", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, - "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" - }, "type": "library", "autoload": { "psr-4": { @@ -3362,7 +3373,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.9" + "source": "https://github.com/symfony/filesystem/tree/v6.0.19" }, "funding": [ { @@ -3378,27 +3389,24 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2023-01-20T17:44:14+00:00" }, { "name": "symfony/finder", - "version": "v6.4.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" + "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3ef977a43883215d560a2cecb82ec8e62131471c", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", + "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11", + "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0|^7.0" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -3426,7 +3434,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.8" + "source": "https://github.com/symfony/finder/tree/v6.0.19" }, "funding": [ { @@ -3442,25 +3450,25 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2023-01-20T17:44:14+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.4.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "22ab9e9101ab18de37839074f8a1197f55590c1b" + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/22ab9e9101ab18de37839074f8a1197f55590c1b", - "reference": "22ab9e9101ab18de37839074f8a1197f55590c1b", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/6a180d1c45e0d9797470ca9eb46215692de00fa3", + "reference": "6a180d1c45e0d9797470ca9eb46215692de00fa3", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { @@ -3493,7 +3501,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.8" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.19" }, "funding": [ { @@ -3509,7 +3517,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -3747,20 +3755,20 @@ }, { "name": "symfony/process", - "version": "v6.4.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5" + "reference": "2114fd60f26a296cc403a7939ab91478475a33d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8d92dd79149f29e89ee0f480254db595f6a6a2c5", - "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5", + "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4", + "reference": "2114fd60f26a296cc403a7939ab91478475a33d4", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -3788,7 +3796,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.8" + "source": "https://github.com/symfony/process/tree/v6.0.19" }, "funding": [ { @@ -3804,34 +3812,36 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.0.2", + "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" }, + "suggest": { + "symfony/service-implementation": "" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3841,10 +3851,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3871,7 +3878,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" }, "funding": [ { @@ -3887,25 +3894,25 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2022-05-30T19:17:58+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.4.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "63e069eb616049632cde9674c46957819454b8aa" + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/63e069eb616049632cde9674c46957819454b8aa", - "reference": "63e069eb616049632cde9674c46957819454b8aa", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/011e781839dd1d2eb8119f65ac516a530f60226d", + "reference": "011e781839dd1d2eb8119f65ac516a530f60226d", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^2.5|^3" + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", "autoload": { @@ -3933,7 +3940,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.8" + "source": "https://github.com/symfony/stopwatch/tree/v6.0.19" }, "funding": [ { @@ -3949,38 +3956,37 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/string", - "version": "v6.4.9", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/76792dbd99690a5ebef8050d9206c60c59e681d7", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.5" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -4019,7 +4025,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.9" + "source": "https://github.com/symfony/string/tree/v6.0.19" }, "funding": [ { @@ -4035,7 +4041,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:25:38+00:00" + "time": "2023-01-01T08:36:10+00:00" } ], "aliases": [], @@ -4044,7 +4050,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.1.0", + "php": ">=8.0.0", "ext-json": "*", "ext-mbstring": "*" }, diff --git a/src/API/Courier.php b/src/API/Courier.php index 2901326..02c8169 100644 --- a/src/API/Courier.php +++ b/src/API/Courier.php @@ -22,42 +22,42 @@ public function __construct(Http $httpClient) /** * @throws AfterShipError */ - public function getUserCouriers( + public function getAllCouriers( array $headers = [] - ): \Tracking\API\Courier\GetUserCouriersResponse { + ): \Tracking\API\Courier\GetAllCouriersResponse { $options = [ 'headers' => $headers, ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/couriers"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetUserCouriersResponse::class); + $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-07/couriers/all"), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetAllCouriersResponse::class); return $result; } /** * @throws AfterShipError */ - public function getAllCouriers( + public function getUserCouriers( array $headers = [] - ): \Tracking\API\Courier\GetAllCouriersResponse { + ): \Tracking\API\Courier\GetUserCouriersResponse { $options = [ 'headers' => $headers, ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/couriers/all"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetAllCouriersResponse::class); + $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-07/couriers"), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetUserCouriersResponse::class); return $result; } /** * @throws AfterShipError */ public function detectCourier( - \Tracking\API\Courier\TrackingDetectCourierRequest $body, + \Tracking\API\Courier\DetectCourierRequest $body, array $headers = [] ): \Tracking\API\Courier\DetectCourierResponse { $options = [ 'headers' => $headers, - 'json' => ['tracking' => $body->toRequestArray()], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/couriers/detect"), $options); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/couriers/detect"), $options); $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\DetectCourierResponse::class); return $result; } diff --git a/src/API/Courier/DetectCourierRequest.php b/src/API/Courier/DetectCourierRequest.php index 3bfde10..0954a15 100644 --- a/src/API/Courier/DetectCourierRequest.php +++ b/src/API/Courier/DetectCourierRequest.php @@ -10,7 +10,51 @@ class DetectCourierRequest extends Base { /** - * @var TrackingDetectCourierRequest Detect courier request + * @var string Tracking number of a shipment. */ - public $tracking; + public $tracking_number; + /** + * @var array[] If not specified, Aftership will automatically detect the courier based on the tracking number format and your . Use array to input a list of couriers for auto detect. Cannot be used with slug_group at the same time. + */ + public $slug; + /** + * @var string The postal code of receiver's address. Required by some couriers. Refer to for more details + */ + public $tracking_postal_code; + /** + * @var string Shipping date in `YYYYMMDD` format. Required by some couriers. Refer to for more details + */ + public $tracking_ship_date; + /** + * @var string Account number of the shipper for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_account_number; + /** + * @var string Key of the shipment for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_key; + /** + * @var string Origin Country/Region of the shipment for a specific courier. Required by some couriers. + */ + public $tracking_origin_country; + /** + * @var string Destination Country/Region of the shipment for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_destination_country; + /** + * @var string State of the destination shipping address of the shipment. Required by some couriers. + */ + public $tracking_state; + /** + * @var string|null|\Tracking\Model\SlugGroupV1 Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. ( + */ + public $slug_group; + /** + * @var string Enter . + */ + public $origin_country_iso3; + /** + * @var string Enter . + */ + public $destination_country_iso3; } diff --git a/src/API/EstimatedDeliveryDate.php b/src/API/EstimatedDeliveryDate.php index 8adae05..33dd6c9 100644 --- a/src/API/EstimatedDeliveryDate.php +++ b/src/API/EstimatedDeliveryDate.php @@ -31,7 +31,7 @@ public function predictBatch( 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/estimated-delivery-date/predict-batch"), $options); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/estimated-delivery-date/predict-batch"), $options); $result = $this->parseSingleResource($resp, '', \Tracking\API\EstimatedDeliveryDate\PredictBatchResponse::class); return $result; } diff --git a/src/API/Tracking.php b/src/API/Tracking.php index cca9bda..0775ed0 100644 --- a/src/API/Tracking.php +++ b/src/API/Tracking.php @@ -9,12 +9,12 @@ use Tracking\Exception\AfterShipError; use Tracking\Exception\ErrorCode; use Tracking\Transport\Http; -use Tracking\API\Tracking\GetTrackingsQuery; +use Tracking\API\Tracking\UpdateTrackingBySlugTrackingNumberQuery; +use Tracking\API\Tracking\RetrackTrackingBySlugTrackingNumberQuery; use Tracking\API\Tracking\DeleteTrackingBySlugTrackingNumberQuery; use Tracking\API\Tracking\GetTrackingByIdQuery; -use Tracking\API\Tracking\RetrackTrackingBySlugTrackingNumberQuery; -use Tracking\API\Tracking\UpdateTrackingBySlugTrackingNumberQuery; use Tracking\API\Tracking\GetTrackingBySlugTrackingNumberQuery; +use Tracking\API\Tracking\GetTrackingsQuery; use Tracking\API\Tracking\MarkTrackingCompletedBySlugTrackingNumberQuery; class Tracking extends APIBase @@ -29,31 +29,31 @@ public function __construct(Http $httpClient) /** * @throws AfterShipError */ - public function getTrackings( - GetTrackingsQuery $query = null, + public function updateTrackingById( + string $id, + \Tracking\API\Tracking\UpdateTrackingByIdRequest $body, array $headers = [] - ): \Tracking\API\Tracking\GetTrackingsResponse { + ): \Tracking\API\Tracking\UpdateTrackingByIdResponse { + if ($id === "") { + throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); + } + $options = [ 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], + + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings"), $options); - $data = $this->parseMultipleResources( - $resp, - 'trackings', - \Tracking\Model\Tracking::class, - \Tracking\Model\PaginationPage::class - ); - $result = new \Tracking\API\Tracking\GetTrackingsResponse($data['resources'], $data['pagination']); + $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-07/trackings/%s", $id), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\UpdateTrackingByIdResponse::class); return $result; } /** * @throws AfterShipError */ - public function retrackTrackingById( + public function deleteTrackingById( string $id, array $headers = [] - ): \Tracking\Model\PartialUpdateTracking { + ): \Tracking\API\Tracking\DeleteTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -61,19 +61,20 @@ public function retrackTrackingById( $options = [ 'headers' => $headers, ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/retrack", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialUpdateTracking::class); + $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-07/trackings/%s", $id), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\DeleteTrackingByIdResponse::class); return $result; } /** * @throws AfterShipError */ - public function deleteTrackingBySlugTrackingNumber( + public function updateTrackingBySlugTrackingNumber( string $slug, string $tracking_number, - DeleteTrackingBySlugTrackingNumberQuery $query = null, + \Tracking\API\Tracking\UpdateTrackingBySlugTrackingNumberRequest $body, + UpdateTrackingBySlugTrackingNumberQuery $query = null, array $headers = [] - ): \Tracking\Model\PartialDeleteTracking { + ): \Tracking\API\Tracking\UpdateTrackingBySlugTrackingNumberResponse { if ($slug === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); } @@ -84,39 +85,44 @@ public function deleteTrackingBySlugTrackingNumber( $options = [ 'headers' => $headers, 'query' => $query ? $query->toArray() : [], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialDeleteTracking::class); + $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-07/trackings/%s/%s", $slug, $tracking_number), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\UpdateTrackingBySlugTrackingNumberResponse::class); return $result; } /** * @throws AfterShipError */ - public function getTrackingById( - string $id, - GetTrackingByIdQuery $query = null, + public function retrackTrackingBySlugTrackingNumber( + string $slug, + string $tracking_number, + RetrackTrackingBySlugTrackingNumberQuery $query = null, array $headers = [] - ): \Tracking\Model\Tracking { - if ($id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); + ): \Tracking\API\Tracking\RetrackTrackingBySlugTrackingNumberResponse { + if ($slug === "") { + throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); + } + if ($tracking_number === "") { + throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); } $options = [ 'headers' => $headers, 'query' => $query ? $query->toArray() : [], ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/trackings/%s/%s/retrack", $slug, $tracking_number), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\RetrackTrackingBySlugTrackingNumberResponse::class); return $result; } /** * @throws AfterShipError */ - public function updateTrackingById( + public function markTrackingCompletedById( string $id, - \Tracking\API\Tracking\TrackingUpdateTrackingByIdRequest $body, + \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\MarkTrackingCompletedByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -124,21 +130,21 @@ public function updateTrackingById( $options = [ 'headers' => $headers, - 'json' => ['tracking' => $body->toRequestArray()], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/trackings/%s/mark-as-completed", $id), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\MarkTrackingCompletedByIdResponse::class); return $result; } /** * @throws AfterShipError */ - public function retrackTrackingBySlugTrackingNumber( + public function deleteTrackingBySlugTrackingNumber( string $slug, string $tracking_number, - RetrackTrackingBySlugTrackingNumberQuery $query = null, + DeleteTrackingBySlugTrackingNumberQuery $query = null, array $headers = [] - ): \Tracking\Model\PartialUpdateTracking { + ): \Tracking\API\Tracking\DeleteTrackingBySlugTrackingNumberResponse { if ($slug === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); } @@ -150,89 +156,62 @@ public function retrackTrackingBySlugTrackingNumber( 'headers' => $headers, 'query' => $query ? $query->toArray() : [], ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/%s/retrack", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialUpdateTracking::class); + $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-07/trackings/%s/%s", $slug, $tracking_number), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\DeleteTrackingBySlugTrackingNumberResponse::class); return $result; } /** * @throws AfterShipError */ public function createTracking( - \Tracking\API\Tracking\TrackingCreateTrackingRequest $body, + \Tracking\API\Tracking\CreateTrackingRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\CreateTrackingResponse { $options = [ 'headers' => $headers, - 'json' => ['tracking' => $body->toRequestArray()], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings"), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/trackings"), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\CreateTrackingResponse::class); return $result; } /** * @throws AfterShipError */ - public function deleteTrackingById( + public function getTrackingById( string $id, + GetTrackingByIdQuery $query = null, array $headers = [] - ): \Tracking\Model\PartialDeleteTracking { + ): \Tracking\API\Tracking\GetTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } - $options = [ - 'headers' => $headers, - ]; - $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialDeleteTracking::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function updateTrackingBySlugTrackingNumber( - string $slug, - string $tracking_number, - \Tracking\API\Tracking\TrackingUpdateTrackingBySlugTrackingNumberRequest $body, - UpdateTrackingBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Tracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - $options = [ 'headers' => $headers, 'query' => $query ? $query->toArray() : [], - 'json' => ['tracking' => $body->toRequestArray()], ]; - $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-07/trackings/%s", $id), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\GetTrackingByIdResponse::class); return $result; } /** * @throws AfterShipError */ - public function markTrackingCompletedById( + public function retrackTrackingById( string $id, - \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\RetrackTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } $options = [ 'headers' => $headers, - - 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/mark-as-completed", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/trackings/%s/retrack", $id), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\RetrackTrackingByIdResponse::class); return $result; } /** @@ -243,7 +222,7 @@ public function getTrackingBySlugTrackingNumber( string $tracking_number, GetTrackingBySlugTrackingNumberQuery $query = null, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\GetTrackingBySlugTrackingNumberResponse { if ($slug === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); } @@ -255,8 +234,29 @@ public function getTrackingBySlugTrackingNumber( 'headers' => $headers, 'query' => $query ? $query->toArray() : [], ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-07/trackings/%s/%s", $slug, $tracking_number), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\GetTrackingBySlugTrackingNumberResponse::class); + return $result; + } + /** + * @throws AfterShipError + */ + public function getTrackings( + GetTrackingsQuery $query = null, + array $headers = [] + ): \Tracking\API\Tracking\GetTrackingsResponse { + $options = [ + 'headers' => $headers, + 'query' => $query ? $query->toArray() : [], + ]; + $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-07/trackings"), $options); + $data = $this->parseMultipleResources( + $resp, + 'trackings', + \Tracking\Model\Tracking::class, + \Tracking\Model\PaginationPage::class + ); + $result = new \Tracking\API\Tracking\GetTrackingsResponse($data['resources'], $data['pagination']); return $result; } /** @@ -268,7 +268,7 @@ public function markTrackingCompletedBySlugTrackingNumber( \Tracking\API\Tracking\MarkTrackingCompletedBySlugTrackingNumberRequest $body, MarkTrackingCompletedBySlugTrackingNumberQuery $query = null, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\MarkTrackingCompletedBySlugTrackingNumberResponse { if ($slug === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); } @@ -281,8 +281,8 @@ public function markTrackingCompletedBySlugTrackingNumber( 'query' => $query ? $query->toArray() : [], 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/%s/mark-as-completed", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); + $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-07/trackings/%s/%s/mark-as-completed", $slug, $tracking_number), $options); + $result = $this->parseSingleResource($resp, '', \Tracking\API\Tracking\MarkTrackingCompletedBySlugTrackingNumberResponse::class); return $result; } } diff --git a/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php b/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php new file mode 100644 index 0000000..128064b --- /dev/null +++ b/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php @@ -0,0 +1,28 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightCreateTrackingResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateCreateTrackingResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateCreateTrackingResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryCreateTrackingResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryCreateTrackingResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersCreateTrackingResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsCreateTrackingResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php b/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php new file mode 100644 index 0000000..6069486 --- /dev/null +++ b/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php @@ -0,0 +1,28 @@ +In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersDeleteTrackingByIdResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsDeleteTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php index 0ee77fc..4ca7662 100644 --- a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php +++ b/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php @@ -10,7 +10,319 @@ class DeleteTrackingBySlugTrackingNumberResponse extends Base { /** - * @var \Tracking\Model\PartialDeleteTracking Partial tracking model + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightDeleteTrackingBySlugTrackingNumberResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateDeleteTrackingBySlugTrackingNumberResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateDeleteTrackingBySlugTrackingNumberResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryDeleteTrackingBySlugTrackingNumberResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryDeleteTrackingBySlugTrackingNumberResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersDeleteTrackingBySlugTrackingNumberResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsDeleteTrackingBySlugTrackingNumberResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/FirstEstimatedDeliveryCreateTrackingResponse.php b/src/API/Tracking/FirstEstimatedDeliveryCreateTrackingResponse.php new file mode 100644 index 0000000..31b4602 --- /dev/null +++ b/src/API/Tracking/FirstEstimatedDeliveryCreateTrackingResponse.php @@ -0,0 +1,32 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightGetTrackingByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateGetTrackingByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateGetTrackingByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryGetTrackingByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryGetTrackingByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersGetTrackingByIdResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsGetTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php index c98ec40..ca772c2 100644 --- a/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php +++ b/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php @@ -10,7 +10,319 @@ class GetTrackingBySlugTrackingNumberResponse extends Base { /** - * @var \Tracking\Model\Tracking Object describes the tracking information.
+ * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightGetTrackingBySlugTrackingNumberResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateGetTrackingBySlugTrackingNumberResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateGetTrackingBySlugTrackingNumberResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryGetTrackingBySlugTrackingNumberResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryGetTrackingBySlugTrackingNumberResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersGetTrackingBySlugTrackingNumberResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsGetTrackingBySlugTrackingNumberResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/LatestEstimatedDeliveryCreateTrackingResponse.php b/src/API/Tracking/LatestEstimatedDeliveryCreateTrackingResponse.php new file mode 100644 index 0000000..5b0b2b8 --- /dev/null +++ b/src/API/Tracking/LatestEstimatedDeliveryCreateTrackingResponse.php @@ -0,0 +1,32 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightMarkTrackingCompletedByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersMarkTrackingCompletedByIdResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsMarkTrackingCompletedByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberResponse.php b/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberResponse.php index e9b1e23..a42117b 100644 --- a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberResponse.php +++ b/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberResponse.php @@ -10,7 +10,319 @@ class MarkTrackingCompletedBySlugTrackingNumberResponse extends Base { /** - * @var \Tracking\Model\Tracking Object describes the tracking information.
+ * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightMarkTrackingCompletedBySlugTrackingNumberResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateMarkTrackingCompletedBySlugTrackingNumberResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateMarkTrackingCompletedBySlugTrackingNumberResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryMarkTrackingCompletedBySlugTrackingNumberResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryMarkTrackingCompletedBySlugTrackingNumberResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersMarkTrackingCompletedBySlugTrackingNumberResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsMarkTrackingCompletedBySlugTrackingNumberResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/NextCouriersCreateTrackingRequest.php b/src/API/Tracking/NextCouriersCreateTrackingRequest.php new file mode 100644 index 0000000..f428507 --- /dev/null +++ b/src/API/Tracking/NextCouriersCreateTrackingRequest.php @@ -0,0 +1,20 @@ +In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersRetrackTrackingByIdResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsRetrackTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php index f65e18b..33a3ffe 100644 --- a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php +++ b/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php @@ -10,7 +10,319 @@ class RetrackTrackingBySlugTrackingNumberResponse extends Base { /** - * @var \Tracking\Model\PartialUpdateTracking Partial tracking + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightRetrackTrackingBySlugTrackingNumberResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateRetrackTrackingBySlugTrackingNumberResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateRetrackTrackingBySlugTrackingNumberResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryRetrackTrackingBySlugTrackingNumberResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryRetrackTrackingBySlugTrackingNumberResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersRetrackTrackingBySlugTrackingNumberResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsRetrackTrackingBySlugTrackingNumberResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/ShipmentWeightCreateTrackingResponse.php b/src/API/Tracking/ShipmentWeightCreateTrackingResponse.php new file mode 100644 index 0000000..b123366 --- /dev/null +++ b/src/API/Tracking/ShipmentWeightCreateTrackingResponse.php @@ -0,0 +1,20 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightUpdateTrackingByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateUpdateTrackingByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryUpdateTrackingByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryUpdateTrackingByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersUpdateTrackingByIdResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsUpdateTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php index 82a3e1d..a77fa87 100644 --- a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php +++ b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php @@ -10,7 +10,103 @@ class UpdateTrackingBySlugTrackingNumberRequest extends Base { /** - * @var TrackingUpdateTrackingBySlugTrackingNumberRequest + * @var array[] The phone number(s) to receive sms notifications. Supports up to 3 phone numbers. */ - public $tracking; + public $smses; + /** + * @var array[] Email address(es) to receive email notifications. Supports up to 3 email addresses. + */ + public $emails; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var string Customer name of the tracking. + */ + public $customer_name; + /** + * @var string A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var CustomFieldsUpdateTrackingBySlugTrackingNumberRequest Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any + */ + public $custom_fields; + /** + * @var string Text field for the note + */ + public $note; + /** + * @var string The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an to specify the language. + */ + public $language; + /** + * @var string The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null|string Shipment delivery type- `pickup_at_store`- `pickup_at_courier`- `door_to_door` + */ + public $delivery_type; + /** + * @var string Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string Unique code of each courier. Provide a single courier.(https://admin.aftership.com/settings/couriers). Get a list of courier slug using + */ + public $slug; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var string A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var string Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 + */ + public $order_date; + /** + * @var string The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; } diff --git a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberResponse.php index c02a717..de67be8 100644 --- a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberResponse.php +++ b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberResponse.php @@ -10,7 +10,319 @@ class UpdateTrackingBySlugTrackingNumberResponse extends Base { /** - * @var \Tracking\Model\Tracking Object describes the tracking information.
+ * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $last_updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var string|null Customer name of the tracking. + */ + public $customer_name; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_iso3; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_iso3; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_iso3; + /** + * @var array[] Email address(es) to receive email notifications. + */ + public $emails; + /** + * @var string|null The estimated delivery date provided by the carrier. It uses the shipment recipient’s timezone and the format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $expected_delivery; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightUpdateTrackingBySlugTrackingNumberResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var array[] The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number. + */ + public $smses; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateUpdateTrackingBySlugTrackingNumberResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateUpdateTrackingBySlugTrackingNumberResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryUpdateTrackingBySlugTrackingNumberResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryUpdateTrackingBySlugTrackingNumberResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var NextCouriersUpdateTrackingBySlugTrackingNumberResponse[] The next couriers get the second carrier information from user or AfterShip. + */ + public $next_couriers; + /** + * @var string|null (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country; + /** + * @var string|null (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsUpdateTrackingBySlugTrackingNumberResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/Client.php b/src/Client.php index 9cc3bba..f124983 100644 --- a/src/Client.php +++ b/src/Client.php @@ -5,11 +5,9 @@ */ namespace Tracking; -use Tracking\API\Notification; use Tracking\API\Tracking; use Tracking\API\Courier; use Tracking\API\EstimatedDeliveryDate; -use Tracking\API\LastCheckpoint; use Tracking\Exception\AfterShipError; class Client @@ -18,10 +16,6 @@ class Client private static $instance = null; - /** - * @var Notification - */ - public $notification; /** * @var Tracking */ @@ -34,10 +28,6 @@ class Client * @var EstimatedDeliveryDate */ public $estimated_delivery_date; - /** - * @var LastCheckpoint - */ - public $last_checkpoint; /** * @throws AfterShipError */ @@ -46,11 +36,9 @@ public function __construct(array $conf = []) $config = new Config($conf); $this->config = $config; - $this->notification = new Notification(new Transport\Http($config)); $this->tracking = new Tracking(new Transport\Http($config)); $this->courier = new Courier(new Transport\Http($config)); $this->estimated_delivery_date = new EstimatedDeliveryDate(new Transport\Http($config)); - $this->last_checkpoint = new LastCheckpoint(new Transport\Http($config)); } /** diff --git a/src/Model/EstimatedDeliveryDateResponse.php b/src/Model/EstimatedDeliveryDateResponse.php index 0fc5bc8..801a602 100644 --- a/src/Model/EstimatedDeliveryDateResponse.php +++ b/src/Model/EstimatedDeliveryDateResponse.php @@ -9,6 +9,10 @@ class EstimatedDeliveryDateResponse extends Base { + /** + * @var string A string that acts as a unique identifier for the estimated delivery date value generated by AfterShip Predict API + */ + public $id; /** * @var string AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download. */ diff --git a/src/Model/ShipmentWeightTracking.php b/src/Model/ShipmentWeightTracking.php new file mode 100644 index 0000000..64dec87 --- /dev/null +++ b/src/Model/ShipmentWeightTracking.php @@ -0,0 +1,20 @@ + */ public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; } diff --git a/src/Model/TrackingResponseV1.php b/src/Model/TrackingResponseV1.php index 3dd0b09..71bcb96 100644 --- a/src/Model/TrackingResponseV1.php +++ b/src/Model/TrackingResponseV1.php @@ -14,7 +14,7 @@ class TrackingResponseV1 extends Base */ public $meta; /** - * @var DataTrackingResponseV1 + * @var \Tracking\Model\Tracking Object describes the tracking information.
*/ public $data; } diff --git a/src/Transport/Http.php b/src/Transport/Http.php index 5b044dc..188fe47 100644 --- a/src/Transport/Http.php +++ b/src/Transport/Http.php @@ -21,7 +21,7 @@ class Http private $config; const CONTENT_TYPE = 'application/json'; - const SDK_VERSION = '7.0.0'; + const SDK_VERSION = '8.0.0'; public function __construct(Config $config) {