diff --git a/README.md b/README.md index f72832d..702fc44 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,13 @@ If you need support using AfterShip products, please contact support@aftership.c - [Constructor](#constructor) - [Example](#example) - [Rate Limiter](#rate-limiter) - - [On successful requests](#on-successful-requests) - - [On rate-limited requests](#on-rate-limited-requests) - [Error Handling](#error-handling) - [Error List](#error-list) - [Endpoints](#endpoints) - - [/estimated-delivery-date](#estimated-delivery-date) - [/trackings](#trackings) - [/couriers](#couriers) - [/courier-connections](#courier-connections) + - [/estimated-delivery-date](#estimated-delivery-date) - [Help](#help) - [License](#license) @@ -39,8 +37,8 @@ Before you begin to integrate: ### API and SDK Version -- SDK Version: 16.0.0 -- API Version: 2026-01 +- SDK Version: 17.0.0 +- API Version: 2026-07 ## Quick Start @@ -94,53 +92,26 @@ aftership.tracking See the [Rate Limit](https://www.aftership.com/docs/tracking/quickstart/rate-limit) to understand the AfterShip rate limit policy. -The API returns the current rate limit status in the headers of **every** response, and the SDK exposes them on both successful and failed requests, so you can monitor your consumption proactively instead of waiting for `429` errors. - -| Header | Description | -| ----------------------- | ---------------------------------------------------- | -| `x-ratelimit-limit` | The rate limit ceiling for the current endpoint per second | -| `x-ratelimit-remaining` | The number of requests left for the 1-second window | -| `x-ratelimit-reset` | The Unix timestamp when the rate limit will be reset | - -> Note: header names in `response_headers` are lower-cased. - -### On successful requests +The API returns its current rate limit status in the headers of every response, and the SDK exposes these headers on both successful responses and rate-limited errors, so you can monitor your consumption proactively instead of waiting for `429` errors. -Every successful response contains a `response_headers` object alongside `data` (available since v15.0.0): +| Header | Description | +| ----------------------- | ---------------------------------------------------------- | +| `X-RateLimit-Limit` | The rate limit ceiling for the current endpoint per second | +| `X-RateLimit-Remaining` | The number of requests left for the 1-second window | +| `X-RateLimit-Reset` | The Unix timestamp when the rate limit will be reset | -```typescript -import { AfterShip } from "@aftership/tracking-sdk"; - -const aftership = new AfterShip({ api_key: "" }); - -const result = await aftership.tracking.getTrackings(); +Every successful response exposes a `response_headers` object alongside `data` (header names are lower-cased). Taking the Quick Start example above: -console.log(result.data.trackings); - -// Rate limit status for this endpoint -const limit = Number(result.response_headers["x-ratelimit-limit"]); +```javascript const remaining = Number(result.response_headers["x-ratelimit-remaining"]); const resetAt = Number(result.response_headers["x-ratelimit-reset"]); if (remaining <= 1) { - // Throttle or defer lower-priority workflows before hitting the limit + // Throttle or defer lower-priority requests until `resetAt` } ``` -### On rate-limited requests - -When the limit is exceeded, the SDK throws an `AftershipError` with `code = TOO_MANY_REQUEST`. The same headers are available on the error: - -```typescript -try { - await aftership.tracking.getTrackings(); -} catch (e) { - if (e.code === "TOO_MANY_REQUEST") { - const resetAt = Number(e.response_headers["x-ratelimit-reset"]); - // Wait until resetAt before retrying - } -} -``` +When the rate limit is exceeded, the request fails with a `429` error that carries the same headers — see [Error Handling](#error-handling). ## Error Handling @@ -184,15 +155,13 @@ The SDK will return an error object when there is any error during the request, | INTERNAL_ERROR | 502 | 502 | Something went wrong on AfterShip's end. | | INTERNAL_ERROR | 503 | 503 | Something went wrong on AfterShip's end. | | INTERNAL_ERROR | 504 | 504 | Something went wrong on AfterShip's end. | -| | + + | ## Endpoints The AfterShip instance has the following properties which are exactly the same as the API endpoints: -- estimatedDeliveryDate - - Prediction for the Estimated Delivery Date - - Batch prediction for the Estimated Delivery Date - tracking - Get trackings - Create a tracking @@ -210,34 +179,9 @@ The AfterShip instance has the following properties which are exactly the same a - Get courier connection by id - Update courier connection by id - Delete courier connection by id - -### /estimated-delivery-date - -**POST** /estimated-delivery-date/predict - -```javascript -const predictRequestBody = { - slug: "valid_value", - origin_address: {}, // EstimatedDeliveryDateRequestOriginAddress - destination_address: {}, // EstimatedDeliveryDateRequestDestinationAddress -}; - -aftership.estimatedDeliveryDate - .predict(predictRequestBody) - .then((result) => console.log(result)) - .catch((e) => console.log(e)); -``` - -**POST** /estimated-delivery-date/predict-batch - -```javascript -const predictBatchRequestBody = {}; - -aftership.estimatedDeliveryDate - .predictBatch(predictBatchRequestBody) - .then((result) => console.log(result)) - .catch((e) => console.log(e)); -``` +- estimatedDeliveryDate + - Prediction for the Estimated Delivery Date + - Batch prediction for the Estimated Delivery Date ### /trackings @@ -410,6 +354,34 @@ aftership.courierConnection .catch((e) => console.log(e)); ``` +### /estimated-delivery-date + +**POST** /estimated-delivery-date/predict + +```javascript +const predictRequestBody = { + slug: "valid_value", + origin_address: {}, // EstimatedDeliveryDateRequestOriginAddress + destination_address: {}, // EstimatedDeliveryDateRequestDestinationAddress +}; + +aftership.estimatedDeliveryDate + .predict(predictRequestBody) + .then((result) => console.log(result)) + .catch((e) => console.log(e)); +``` + +**POST** /estimated-delivery-date/predict-batch + +```javascript +const predictBatchRequestBody = {}; + +aftership.estimatedDeliveryDate + .predictBatch(predictBatchRequestBody) + .then((result) => console.log(result)) + .catch((e) => console.log(e)); +``` + ## Help If you get stuck, we're here to help: diff --git a/package.json b/package.json index 5dad7ff..4814330 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aftership/tracking-sdk", - "version": "16.0.0", + "version": "17.0.0", "description": "Tracking NodeJS SDK", "main": "dist/aftership.js", "types": "dist/aftership.d.ts", diff --git a/src/aftership.ts b/src/aftership.ts index 0771074..5f2f265 100644 --- a/src/aftership.ts +++ b/src/aftership.ts @@ -2,10 +2,10 @@ * This code was auto generated by AfterShip SDK Generator. * Do not edit the class manually. */ -import { EstimatedDeliveryDateApi } from "./api/EstimatedDeliveryDate"; import { TrackingApi } from "./api/Tracking"; import { CourierApi } from "./api/Courier"; import { CourierConnectionApi } from "./api/CourierConnection"; +import { EstimatedDeliveryDateApi } from "./api/EstimatedDeliveryDate"; import { AftershipError, AfterShipErrorCodes } from "./error"; import { AuthType } from "./lib/authentication"; import { @@ -33,10 +33,10 @@ export interface Options { const SDK_ENV_PREFIX = "AFTERSHIP_TRACKING_SDK_"; export class AfterShip { - public readonly estimatedDeliveryDate: EstimatedDeliveryDateApi; public readonly tracking: TrackingApi; public readonly courier: CourierApi; public readonly courierConnection: CourierConnectionApi; + public readonly estimatedDeliveryDate: EstimatedDeliveryDateApi; private readonly options: Options; constructor(options?: Options) { @@ -100,10 +100,10 @@ export class AfterShip { user_agent: this.options.user_agent, proxy: parseProxy(this.options.proxy), }); - this.estimatedDeliveryDate = new EstimatedDeliveryDateApi(request); this.tracking = new TrackingApi(request); this.courier = new CourierApi(request); this.courierConnection = new CourierConnectionApi(request); + this.estimatedDeliveryDate = new EstimatedDeliveryDateApi(request); } private validateOptions() { diff --git a/src/api/Courier.ts b/src/api/Courier.ts index 3df772c..3ff30f3 100644 --- a/src/api/Courier.ts +++ b/src/api/Courier.ts @@ -4,10 +4,10 @@ */ import { Request } from "../lib/request"; import { AftershipError, AfterShipErrorCodes } from "../error"; -import { DetectCourierRequest } from "../model/DetectCourierRequest"; -import { DetectCourierResponse } from "../model/DetectCourierResponse"; import { GetCouriersResponse } from "../model/GetCouriersResponse"; import { GetCouriersQuery } from "../model/GetCouriersQuery"; +import { DetectCourierRequest } from "../model/DetectCourierRequest"; +import { DetectCourierResponse } from "../model/DetectCourierResponse"; export class CourierApi { private readonly request: Request; @@ -23,7 +23,7 @@ export class CourierApi { query?: GetCouriersQuery, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/couriers`; + const url = `/tracking/2026-07/couriers`; return this.request.makeRequest({ url: url, method: "GET", @@ -38,7 +38,7 @@ export class CourierApi { body: DetectCourierRequest, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/couriers/detect`; + const url = `/tracking/2026-07/couriers/detect`; return this.request.makeRequest({ url: url, method: "POST", diff --git a/src/api/CourierConnection.ts b/src/api/CourierConnection.ts index 6df899b..d16cb4c 100644 --- a/src/api/CourierConnection.ts +++ b/src/api/CourierConnection.ts @@ -4,14 +4,14 @@ */ import { Request } from "../lib/request"; import { AftershipError, AfterShipErrorCodes } from "../error"; -import { GetCourierConnectionsResponse } from "../model/GetCourierConnectionsResponse"; -import { GetCourierConnectionsQuery } from "../model/GetCourierConnectionsQuery"; -import { PostCourierConnectionsRequest } from "../model/PostCourierConnectionsRequest"; -import { PostCourierConnectionsResponse } from "../model/PostCourierConnectionsResponse"; import { GetCourierConnectionsByIdResponse } from "../model/GetCourierConnectionsByIdResponse"; import { PutCourierConnectionsByIdRequest } from "../model/PutCourierConnectionsByIdRequest"; import { PutCourierConnectionsByIdResponse } from "../model/PutCourierConnectionsByIdResponse"; import { DeleteCourierConnectionsByIdResponse } from "../model/DeleteCourierConnectionsByIdResponse"; +import { GetCourierConnectionsResponse } from "../model/GetCourierConnectionsResponse"; +import { GetCourierConnectionsQuery } from "../model/GetCourierConnectionsQuery"; +import { PostCourierConnectionsRequest } from "../model/PostCourierConnectionsRequest"; +import { PostCourierConnectionsResponse } from "../model/PostCourierConnectionsResponse"; export class CourierConnectionApi { private readonly request: Request; @@ -27,7 +27,7 @@ export class CourierConnectionApi { query?: GetCourierConnectionsQuery, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/courier-connections`; + const url = `/tracking/2026-07/courier-connections`; return this.request.makeRequest({ url: url, method: "GET", @@ -42,7 +42,7 @@ export class CourierConnectionApi { body: PostCourierConnectionsRequest, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/courier-connections`; + const url = `/tracking/2026-07/courier-connections`; return this.request.makeRequest({ url: url, method: "POST", @@ -63,7 +63,7 @@ export class CourierConnectionApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/courier-connections/${id}`; + const url = `/tracking/2026-07/courier-connections/${id}`; return this.request.makeRequest({ url: url, method: "GET", @@ -84,7 +84,7 @@ export class CourierConnectionApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/courier-connections/${id}`; + const url = `/tracking/2026-07/courier-connections/${id}`; return this.request.makeRequest({ url: url, method: "PATCH", @@ -105,7 +105,7 @@ export class CourierConnectionApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/courier-connections/${id}`; + const url = `/tracking/2026-07/courier-connections/${id}`; return this.request.makeRequest({ url: url, method: "DELETE", diff --git a/src/api/EstimatedDeliveryDate.ts b/src/api/EstimatedDeliveryDate.ts index 685d557..517f91e 100644 --- a/src/api/EstimatedDeliveryDate.ts +++ b/src/api/EstimatedDeliveryDate.ts @@ -4,10 +4,10 @@ */ import { Request } from "../lib/request"; import { AftershipError, AfterShipErrorCodes } from "../error"; -import { EstimatedDeliveryDateRequest } from "../model/EstimatedDeliveryDateRequest"; -import { PredictResponse } from "../model/PredictResponse"; import { PredictBatchRequest } from "../model/PredictBatchRequest"; import { PredictBatchResponse } from "../model/PredictBatchResponse"; +import { EstimatedDeliveryDateRequest } from "../model/EstimatedDeliveryDateRequest"; +import { PredictResponse } from "../model/PredictResponse"; export class EstimatedDeliveryDateApi { private readonly request: Request; @@ -23,7 +23,7 @@ export class EstimatedDeliveryDateApi { body: EstimatedDeliveryDateRequest, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/estimated-delivery-date/predict`; + const url = `/tracking/2026-07/estimated-delivery-date/predict`; return this.request.makeRequest({ url: url, method: "POST", @@ -38,7 +38,7 @@ export class EstimatedDeliveryDateApi { body: PredictBatchRequest, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/estimated-delivery-date/predict-batch`; + const url = `/tracking/2026-07/estimated-delivery-date/predict-batch`; return this.request.makeRequest({ url: url, method: "POST", diff --git a/src/api/Tracking.ts b/src/api/Tracking.ts index 636afe6..e1a813e 100644 --- a/src/api/Tracking.ts +++ b/src/api/Tracking.ts @@ -4,18 +4,18 @@ */ import { Request } from "../lib/request"; import { AftershipError, AfterShipErrorCodes } from "../error"; -import { GetTrackingByIdQuery } from "../model/GetTrackingByIdQuery"; -import { UpdateTrackingByIdRequest } from "../model/UpdateTrackingByIdRequest"; -import { MarkTrackingCompletedByIdResponse } from "../model/MarkTrackingCompletedByIdResponse"; import { GetTrackingsResponse } from "../model/GetTrackingsResponse"; import { GetTrackingsQuery } from "../model/GetTrackingsQuery"; +import { CreateTrackingRequest } from "../model/CreateTrackingRequest"; import { GetTrackingByIdResponse } from "../model/GetTrackingByIdResponse"; -import { UpdateTrackingByIdResponse } from "../model/UpdateTrackingByIdResponse"; import { DeleteTrackingByIdResponse } from "../model/DeleteTrackingByIdResponse"; +import { MarkTrackingCompletedByIdResponse } from "../model/MarkTrackingCompletedByIdResponse"; +import { CreateTrackingResponse } from "../model/CreateTrackingResponse"; +import { GetTrackingByIdQuery } from "../model/GetTrackingByIdQuery"; +import { UpdateTrackingByIdRequest } from "../model/UpdateTrackingByIdRequest"; +import { UpdateTrackingByIdResponse } from "../model/UpdateTrackingByIdResponse"; import { RetrackTrackingByIdResponse } from "../model/RetrackTrackingByIdResponse"; import { MarkTrackingCompletedByIdRequest } from "../model/MarkTrackingCompletedByIdRequest"; -import { CreateTrackingRequest } from "../model/CreateTrackingRequest"; -import { CreateTrackingResponse } from "../model/CreateTrackingResponse"; export class TrackingApi { private readonly request: Request; @@ -31,7 +31,7 @@ export class TrackingApi { query?: GetTrackingsQuery, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/trackings`; + const url = `/tracking/2026-07/trackings`; return this.request.makeRequest({ url: url, method: "GET", @@ -46,7 +46,7 @@ export class TrackingApi { body: CreateTrackingRequest, headers?: { [key: string]: any }, ): Promise { - const url = `/tracking/2026-01/trackings`; + const url = `/tracking/2026-07/trackings`; return this.request.makeRequest({ url: url, method: "POST", @@ -68,7 +68,7 @@ export class TrackingApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/trackings/${id}`; + const url = `/tracking/2026-07/trackings/${id}`; return this.request.makeRequest({ url: url, method: "GET", @@ -90,7 +90,7 @@ export class TrackingApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/trackings/${id}`; + const url = `/tracking/2026-07/trackings/${id}`; return this.request.makeRequest({ url: url, method: "PUT", @@ -111,7 +111,7 @@ export class TrackingApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/trackings/${id}`; + const url = `/tracking/2026-07/trackings/${id}`; return this.request.makeRequest({ url: url, method: "DELETE", @@ -131,7 +131,7 @@ export class TrackingApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/trackings/${id}/retrack`; + const url = `/tracking/2026-07/trackings/${id}/retrack`; return this.request.makeRequest({ url: url, method: "POST", @@ -152,7 +152,7 @@ export class TrackingApi { AfterShipErrorCodes.BAD_REQUEST, ); } - const url = `/tracking/2026-01/trackings/${id}/mark-as-completed`; + const url = `/tracking/2026-07/trackings/${id}/mark-as-completed`; return this.request.makeRequest({ url: url, method: "POST", diff --git a/src/lib/request.ts b/src/lib/request.ts index 4210fb4..8663a5f 100644 --- a/src/lib/request.ts +++ b/src/lib/request.ts @@ -16,7 +16,7 @@ export const DEFAULT_MAX_RETRY = 3; export const MAX_MAX_RETRY = 10; export const MIN_MAX_RETRY = 0; export const DEFAULT_USER_AGENT = - "tracking-sdk-nodejs/16.0.0 (https://www.aftership.com) axios/1.7.2"; + "tracking-sdk-nodejs/17.0.0 (https://www.aftership.com) axios/1.7.2"; type ResponseData = { meta: { diff --git a/src/model/AdditionalFields.ts b/src/model/AdditionalFields.ts index 8670597..b566110 100644 --- a/src/model/AdditionalFields.ts +++ b/src/model/AdditionalFields.ts @@ -7,11 +7,11 @@ * All available additional fields */ export enum AdditionalFields { - "tracking_account_number" = "tracking_account_number", - "destination_postal_code" = "destination_postal_code", - "destination_state" = "destination_state", - "tracking_key" = "tracking_key", - "origin_country_region" = "origin_country_region", - "destination_country_region" = "destination_country_region", - "tracking_ship_date" = "tracking_ship_date", + tracking_account_number = "tracking_account_number", + destination_postal_code = "destination_postal_code", + destination_state = "destination_state", + tracking_key = "tracking_key", + origin_country_region = "origin_country_region", + destination_country_region = "destination_country_region", + tracking_ship_date = "tracking_ship_date", } diff --git a/src/model/Checkpoint.ts b/src/model/Checkpoint.ts index bbb83eb..0c0192b 100644 --- a/src/model/Checkpoint.ts +++ b/src/model/Checkpoint.ts @@ -79,4 +79,8 @@ export interface Checkpoint { * The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed. */ source?: CheckpointSource; + /** + * Unique hash identifier for each checkpoint event, could be used for deduplication. + */ + hash?: string; } diff --git a/src/model/CheckpointSource.ts b/src/model/CheckpointSource.ts index 63dcc35..80319d6 100644 --- a/src/model/CheckpointSource.ts +++ b/src/model/CheckpointSource.ts @@ -7,6 +7,6 @@ * The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed. */ export enum CheckpointSource { - "carrier" = "carrier", - "user" = "user", + carrier = "carrier", + user = "user", } diff --git a/src/model/CreateTrackingRequest.ts b/src/model/CreateTrackingRequest.ts index aee1362..aca7ecd 100644 --- a/src/model/CreateTrackingRequest.ts +++ b/src/model/CreateTrackingRequest.ts @@ -6,6 +6,7 @@ import { CreateTrackingRequestOrderPromisedDeliveryDate } from "./CreateTracking import { CreateTrackingRequestDeliveryType } from "./CreateTrackingRequestDeliveryType"; import { CreateTrackingRequestLastMile } from "./CreateTrackingRequestLastMile"; import { CreateTrackingRequestCustomers } from "./CreateTrackingRequestCustomers"; +import { CreateTrackingRequestShipmentDirection } from "./CreateTrackingRequestShipmentDirection"; /** * @@ -155,4 +156,8 @@ export interface CreateTrackingRequest { * The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. */ customers?: CreateTrackingRequestCustomers[]; + /** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.When provided, this field gives AfterShip additional context about the shipment's intent, enabling more accurate status identification. + */ + shipment_direction?: CreateTrackingRequestShipmentDirection; } diff --git a/src/model/CreateTrackingRequestCustomers.ts b/src/model/CreateTrackingRequestCustomers.ts index e21eb30..b462ff8 100644 --- a/src/model/CreateTrackingRequestCustomers.ts +++ b/src/model/CreateTrackingRequestCustomers.ts @@ -27,4 +27,8 @@ export interface CreateTrackingRequestCustomers { * The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. */ language?: string; + /** + * The customer's identifier on the merchant or platform (for example, Shopify) side. + */ + id?: string; } diff --git a/src/model/CreateTrackingRequestDeliveryType.ts b/src/model/CreateTrackingRequestDeliveryType.ts index 0ee59d2..03af367 100644 --- a/src/model/CreateTrackingRequestDeliveryType.ts +++ b/src/model/CreateTrackingRequestDeliveryType.ts @@ -7,7 +7,7 @@ * Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door */ export enum CreateTrackingRequestDeliveryType { - "pickup_at_store" = "pickup_at_store", - "door_to_door" = "door_to_door", - "pickup_at_courier" = "pickup_at_courier", + pickup_at_store = "pickup_at_store", + door_to_door = "door_to_door", + pickup_at_courier = "pickup_at_courier", } diff --git a/src/model/CreateTrackingRequestShipmentDirection.ts b/src/model/CreateTrackingRequestShipmentDirection.ts new file mode 100644 index 0000000..5234c66 --- /dev/null +++ b/src/model/CreateTrackingRequestShipmentDirection.ts @@ -0,0 +1,12 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.When provided, this field gives AfterShip additional context about the shipment's intent, enabling more accurate status identification. + */ +export enum CreateTrackingRequestShipmentDirection { + forward = "forward", + return = "return", +} diff --git a/src/model/CreateTrackingResponse.ts b/src/model/CreateTrackingResponse.ts index b0b9a33..dd874b4 100644 --- a/src/model/CreateTrackingResponse.ts +++ b/src/model/CreateTrackingResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface CreateTrackingResponse { /** diff --git a/src/model/DeleteTrackingByIdResponse.ts b/src/model/DeleteTrackingByIdResponse.ts index bcc06c5..af8c340 100644 --- a/src/model/DeleteTrackingByIdResponse.ts +++ b/src/model/DeleteTrackingByIdResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface DeleteTrackingByIdResponse { /** diff --git a/src/model/EstimatedDeliveryDateRequestDestinationAddress.ts b/src/model/EstimatedDeliveryDateRequestDestinationAddress.ts index 71412c2..141d5fb 100644 --- a/src/model/EstimatedDeliveryDateRequestDestinationAddress.ts +++ b/src/model/EstimatedDeliveryDateRequestDestinationAddress.ts @@ -12,7 +12,7 @@ export interface EstimatedDeliveryDateRequestDestinationAddress { */ country_region: string; /** - * State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. + * State, province, or the equivalent location of the destination address where the package will be delivered.</br><span style=color:#ff6b2b;padding:2px>**Either `destination_address.state` or `destination_address.postal_code` is required.**</span> */ state?: string | null; /** @@ -20,7 +20,7 @@ export interface EstimatedDeliveryDateRequestDestinationAddress { */ city?: string | null; /** - * Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. + * Postal code of the destination address.</br><span style=color:#ff6b2b;padding:2px>**Either `destination_address.state` or `destination_address.postal_code` is required.**</span> */ postal_code?: string | null; /** diff --git a/src/model/EstimatedDeliveryDateRequestOriginAddress.ts b/src/model/EstimatedDeliveryDateRequestOriginAddress.ts index 4f6442d..43b1e04 100644 --- a/src/model/EstimatedDeliveryDateRequestOriginAddress.ts +++ b/src/model/EstimatedDeliveryDateRequestOriginAddress.ts @@ -12,7 +12,7 @@ export interface EstimatedDeliveryDateRequestOriginAddress { */ country_region: string; /** - * State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. + * State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. </br><span style=color:#ff6b2b;padding:2px>**Either `origin_address.state` or `origin_address.postal_code` is required.**</span> */ state?: string | null; /** @@ -20,7 +20,7 @@ export interface EstimatedDeliveryDateRequestOriginAddress { */ city?: string | null; /** - * Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. + * Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. </br><span style=color:#ff6b2b;padding:2px>**Either `origin_address.state` or `origin_address.postal_code` is required.**</span> */ postal_code?: string | null; /** diff --git a/src/model/GetTrackingByIdResponse.ts b/src/model/GetTrackingByIdResponse.ts index 3cc6b3f..71dd1df 100644 --- a/src/model/GetTrackingByIdResponse.ts +++ b/src/model/GetTrackingByIdResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface GetTrackingByIdResponse { /** diff --git a/src/model/MarkTrackingCompletedByIdRequestReason.ts b/src/model/MarkTrackingCompletedByIdRequestReason.ts index c01c24e..c305e76 100644 --- a/src/model/MarkTrackingCompletedByIdRequestReason.ts +++ b/src/model/MarkTrackingCompletedByIdRequestReason.ts @@ -7,7 +7,7 @@ * One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`. */ export enum MarkTrackingCompletedByIdRequestReason { - "DELIVERED" = "DELIVERED", - "LOST" = "LOST", - "RETURNED_TO_SENDER" = "RETURNED_TO_SENDER", + DELIVERED = "DELIVERED", + LOST = "LOST", + RETURNED_TO_SENDER = "RETURNED_TO_SENDER", } diff --git a/src/model/MarkTrackingCompletedByIdResponse.ts b/src/model/MarkTrackingCompletedByIdResponse.ts index 010f345..227a9e2 100644 --- a/src/model/MarkTrackingCompletedByIdResponse.ts +++ b/src/model/MarkTrackingCompletedByIdResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface MarkTrackingCompletedByIdResponse { /** diff --git a/src/model/MetaType.ts b/src/model/MetaType.ts index b7c0405..5ce804d 100644 --- a/src/model/MetaType.ts +++ b/src/model/MetaType.ts @@ -7,10 +7,10 @@ * error type, only exist if the response status is not 2xx */ export enum MetaType { - "BadRequest" = "BadRequest", - "Unauthorized" = "Unauthorized", - "Forbidden" = "Forbidden", - "NotFound" = "NotFound", - "TooManyRequests" = "TooManyRequests", - "InternalError" = "InternalError", + BadRequest = "BadRequest", + Unauthorized = "Unauthorized", + Forbidden = "Forbidden", + NotFound = "NotFound", + TooManyRequests = "TooManyRequests", + InternalError = "InternalError", } diff --git a/src/model/RetrackTrackingByIdResponse.ts b/src/model/RetrackTrackingByIdResponse.ts index d3c6e8d..6bd2fff 100644 --- a/src/model/RetrackTrackingByIdResponse.ts +++ b/src/model/RetrackTrackingByIdResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface RetrackTrackingByIdResponse { /** diff --git a/src/model/Tag.ts b/src/model/Tag.ts index d0c1d0d..8b417cc 100644 --- a/src/model/Tag.ts +++ b/src/model/Tag.ts @@ -7,13 +7,13 @@ * Current status of tracking. ( */ export enum Tag { - "Pending" = "Pending", - "InfoReceived" = "InfoReceived", - "InTransit" = "InTransit", - "OutForDelivery" = "OutForDelivery", - "AttemptFail" = "AttemptFail", - "Delivered" = "Delivered", - "AvailableForPickup" = "AvailableForPickup", - "Exception" = "Exception", - "Expired" = "Expired", + Pending = "Pending", + InfoReceived = "InfoReceived", + InTransit = "InTransit", + OutForDelivery = "OutForDelivery", + AttemptFail = "AttemptFail", + Delivered = "Delivered", + AvailableForPickup = "AvailableForPickup", + Exception = "Exception", + Expired = "Expired", } diff --git a/src/model/Tracking.ts b/src/model/Tracking.ts index 8d124b5..17c10e6 100644 --- a/src/model/Tracking.ts +++ b/src/model/Tracking.ts @@ -2,23 +2,29 @@ * This code was auto generated by AfterShip SDK Generator. * Do not edit the class manually. */ -import { TrackingOrderPromisedDeliveryDate } from "./TrackingOrderPromisedDeliveryDate"; +import { TrackingCourierEstimatedDeliveryDate } from "./TrackingCourierEstimatedDeliveryDate"; import { TrackingFirstEstimatedDelivery } from "./TrackingFirstEstimatedDelivery"; -import { TrackingLatestEstimatedDelivery } from "./TrackingLatestEstimatedDelivery"; import { TrackingCarbonEmissions } from "./TrackingCarbonEmissions"; +import { TrackingFirstMile } from "./TrackingFirstMile"; +import { Tag } from "./Tag"; +import { TrackingOrderPromisedDeliveryDate } from "./TrackingOrderPromisedDeliveryDate"; import { TrackingAftershipEstimatedDeliveryDate } from "./TrackingAftershipEstimatedDeliveryDate"; +import { TrackingLastMile } from "./TrackingLastMile"; +import { TrackingProofOfDelivery } from "./TrackingProofOfDelivery"; +import { TrackingReturnShipment } from "./TrackingReturnShipment"; +import { TrackingShipmentDimensions } from "./TrackingShipmentDimensions"; import { TrackingCustomEstimatedDeliveryDate } from "./TrackingCustomEstimatedDeliveryDate"; import { TrackingSignatureRequirement } from "./TrackingSignatureRequirement"; -import { TrackingFirstMile } from "./TrackingFirstMile"; -import { TrackingLastMile } from "./TrackingLastMile"; import { TrackingCustomers } from "./TrackingCustomers"; -import { TrackingCourierEstimatedDeliveryDate } from "./TrackingCourierEstimatedDeliveryDate"; +import { TrackingShipmentDirection } from "./TrackingShipmentDirection"; import { TrackingShipmentWeight } from "./TrackingShipmentWeight"; -import { Tag } from "./Tag"; import { Checkpoint } from "./Checkpoint"; +import { TrackingLatestEstimatedDelivery } from "./TrackingLatestEstimatedDelivery"; +import { TrackingMultiPieceInfo } from "./TrackingMultiPieceInfo"; +import { TrackingForwardShipment } from "./TrackingForwardShipment"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface Tracking { /** @@ -141,6 +147,10 @@ export interface Tracking { * 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 */ shipment_weight?: TrackingShipmentWeight | null; + /** + * Physical dimensions of the package (length, width and height). + */ + shipment_dimensions?: TrackingShipmentDimensions | null; /** * Signed by information for delivered shipment. */ @@ -317,4 +327,24 @@ export interface Tracking { * The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. */ customers?: TrackingCustomers[]; + /** + * An array of proof of delivery (POD) records, such as a signature or photo captured upon successful delivery.This field returns a value only after the feature is enabled. Please contact your customer success manager if you'd like to know more. + */ + proof_of_delivery?: TrackingProofOfDelivery[] | null; + /** + * Multi-piece shipment refers to a scenario where a single shipment order is fulfilled by multiple physical packages. Each piece has its own carrier-assigned tracking number, but all pieces belong to the same shipment. This commonly occurs when an order is too large to fit in one box, or when items are packed separately for handling reasons.This field contains multi-piece shipment metadata describing a group of packages that belong to the same shipment.This field returns a value only when your subscription plan includes a multi-piece feature. To enable, go to . + */ + multi_piece_info?: TrackingMultiPieceInfo | null; + /** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.This field is populated in either of the following cases:1. You explicitly provided it when creating the tracking.2. AfterShip automatically detected a linked forward or return shipment.It also determines which related shipment object (`forward_shipment` or `return_shipment`) may appear in the response. + */ + shipment_direction?: TrackingShipmentDirection; + /** + * The associated return shipment linked to the current outbound shipment.This field is only present when `shipment_direction = "forward"` and AfterShip has detected a linked return shipment. + */ + return_shipment?: TrackingReturnShipment | null; + /** + * The original outbound shipment linked to this return. Use this to trace a return back to its source delivery.This field is only present when `shipment_direction = "return"` and AfterShip has detected a linked forward shipment. + */ + forward_shipment?: TrackingForwardShipment | null; } diff --git a/src/model/TrackingCustomEstimatedDeliveryDateType.ts b/src/model/TrackingCustomEstimatedDeliveryDateType.ts index 20eb665..381911a 100644 --- a/src/model/TrackingCustomEstimatedDeliveryDateType.ts +++ b/src/model/TrackingCustomEstimatedDeliveryDateType.ts @@ -7,6 +7,6 @@ * The format of the EDD. Either a single date or a date range. */ export enum TrackingCustomEstimatedDeliveryDateType { - "range" = "range", - "specific" = "specific", + range = "range", + specific = "specific", } diff --git a/src/model/TrackingCustomers.ts b/src/model/TrackingCustomers.ts index bb90462..2a3b0e0 100644 --- a/src/model/TrackingCustomers.ts +++ b/src/model/TrackingCustomers.ts @@ -27,4 +27,8 @@ export interface TrackingCustomers { * The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. */ language?: string | null; + /** + * The customer's identifier on the merchant or platform (for example, Shopify) side. + */ + id?: string | null; } diff --git a/src/model/TrackingFirstEstimatedDeliveryType.ts b/src/model/TrackingFirstEstimatedDeliveryType.ts index 160fbaf..b128205 100644 --- a/src/model/TrackingFirstEstimatedDeliveryType.ts +++ b/src/model/TrackingFirstEstimatedDeliveryType.ts @@ -7,6 +7,6 @@ * The format of the EDD. Either a single date or a date range. */ export enum TrackingFirstEstimatedDeliveryType { - "range" = "range", - "specific" = "specific", + range = "range", + specific = "specific", } diff --git a/src/model/TrackingForwardShipment.ts b/src/model/TrackingForwardShipment.ts new file mode 100644 index 0000000..e84a322 --- /dev/null +++ b/src/model/TrackingForwardShipment.ts @@ -0,0 +1,14 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * The original outbound shipment linked to this return. Use this to trace a return back to its source delivery.This field is only present when `shipment_direction = "return"` and AfterShip has detected a linked forward shipment. + */ +export interface TrackingForwardShipment { + /** + * AfterShip system-assigned unique identifier of the linked outbound shipment. + */ + id?: string; +} diff --git a/src/model/TrackingLastMileSource.ts b/src/model/TrackingLastMileSource.ts index d43cd5e..d6aa5b0 100644 --- a/src/model/TrackingLastMileSource.ts +++ b/src/model/TrackingLastMileSource.ts @@ -7,6 +7,6 @@ * The field indicates the source of last-mile carrier. */ export enum TrackingLastMileSource { - "system" = "system", - "user" = "user", + system = "system", + user = "user", } diff --git a/src/model/TrackingLatestEstimatedDeliveryType.ts b/src/model/TrackingLatestEstimatedDeliveryType.ts index 7e78bb3..4854338 100644 --- a/src/model/TrackingLatestEstimatedDeliveryType.ts +++ b/src/model/TrackingLatestEstimatedDeliveryType.ts @@ -7,6 +7,6 @@ * The format of the EDD. Either a single date or a date range. */ export enum TrackingLatestEstimatedDeliveryType { - "range" = "range", - "specific" = "specific", + range = "range", + specific = "specific", } diff --git a/src/model/TrackingMultiPieceInfo.ts b/src/model/TrackingMultiPieceInfo.ts new file mode 100644 index 0000000..3779791 --- /dev/null +++ b/src/model/TrackingMultiPieceInfo.ts @@ -0,0 +1,20 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +import { TrackingMultiPieceInfoType } from "./TrackingMultiPieceInfoType"; +import { TrackingMultiPieceInfoPieces } from "./TrackingMultiPieceInfoPieces"; + +/** + * Multi-piece shipment refers to a scenario where a single shipment order is fulfilled by multiple physical packages. Each piece has its own carrier-assigned tracking number, but all pieces belong to the same shipment. This commonly occurs when an order is too large to fit in one box, or when items are packed separately for handling reasons.This field contains multi-piece shipment metadata describing a group of packages that belong to the same shipment.This field returns a value only when your subscription plan includes a multi-piece feature. To enable, go to . + */ +export interface TrackingMultiPieceInfo { + /** + * Indicates the role of the current tracking object within the multi-piece shipment.Possible values:- `master`: The main tracking number representing the entire shipment. It may not always exist.- `child`: A sub-tracking number belonging to one of the pieces in the shipment. + */ + type?: TrackingMultiPieceInfoType; + /** + * List of all pieces in the MPS, including the master and all child pieces. + */ + pieces?: TrackingMultiPieceInfoPieces[]; +} diff --git a/src/model/TrackingMultiPieceInfoPieces.ts b/src/model/TrackingMultiPieceInfoPieces.ts new file mode 100644 index 0000000..3a58007 --- /dev/null +++ b/src/model/TrackingMultiPieceInfoPieces.ts @@ -0,0 +1,27 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +import { TrackingMultiPieceInfoPiecesType } from "./TrackingMultiPieceInfoPiecesType"; + +/** + * + */ +export interface TrackingMultiPieceInfoPieces { + /** + * AfterShip system-assigned unique identifier for the piece. + */ + tracking_id?: string; + /** + * Carrier-assigned tracking number for the piece. + */ + tracking_number?: string; + /** + * Type of the piece within the MPS: `master` or `child`. + */ + type?: TrackingMultiPieceInfoPiecesType; + /** + * Indicates whether the tracking number can be used to retrieve tracking updates on the carrier's side. If not, it means the carrier can only return a child tracking number, but cannot independently provide tracking updates for the sub-shipment. In this case, it is not recommended for you to import this tracking number into AfterShip for tracking. + */ + trackable?: boolean; +} diff --git a/src/model/TrackingMultiPieceInfoPiecesType.ts b/src/model/TrackingMultiPieceInfoPiecesType.ts new file mode 100644 index 0000000..ac14fc8 --- /dev/null +++ b/src/model/TrackingMultiPieceInfoPiecesType.ts @@ -0,0 +1,12 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Type of the piece within the MPS: `master` or `child`. + */ +export enum TrackingMultiPieceInfoPiecesType { + master = "master", + child = "child", +} diff --git a/src/model/TrackingMultiPieceInfoType.ts b/src/model/TrackingMultiPieceInfoType.ts new file mode 100644 index 0000000..1fcec91 --- /dev/null +++ b/src/model/TrackingMultiPieceInfoType.ts @@ -0,0 +1,12 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Indicates the role of the current tracking object within the multi-piece shipment.Possible values:- `master`: The main tracking number representing the entire shipment. It may not always exist.- `child`: A sub-tracking number belonging to one of the pieces in the shipment. + */ +export enum TrackingMultiPieceInfoType { + master = "master", + child = "child", +} diff --git a/src/model/TrackingProofOfDelivery.ts b/src/model/TrackingProofOfDelivery.ts new file mode 100644 index 0000000..9516cf1 --- /dev/null +++ b/src/model/TrackingProofOfDelivery.ts @@ -0,0 +1,18 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * + */ +export interface TrackingProofOfDelivery { + /** + * The file type of the proof of delivery record. Currently, only images are supported. + */ + type?: string; + /** + * The URL of the proof of delivery record. + */ + url?: string; +} diff --git a/src/model/TrackingResponse.ts b/src/model/TrackingResponse.ts index 82c3e5b..76ccc3b 100644 --- a/src/model/TrackingResponse.ts +++ b/src/model/TrackingResponse.ts @@ -14,7 +14,7 @@ export interface TrackingResponse { */ meta: Meta; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ data: Tracking; } diff --git a/src/model/TrackingReturnShipment.ts b/src/model/TrackingReturnShipment.ts new file mode 100644 index 0000000..998e427 --- /dev/null +++ b/src/model/TrackingReturnShipment.ts @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * The associated return shipment linked to the current outbound shipment.This field is only present when `shipment_direction = "forward"` and AfterShip has detected a linked return shipment. + */ +export interface TrackingReturnShipment { + /** + * AfterShip system-assigned unique identifier of the linked return shipment.This field is only returned when both of the following conditions are met:1. AfterShip has detected a linked return shipment.2. The Auto-import for return shipments feature is enabled in your AfterShip account.When auto-import is disabled, `id` will not be returned, but `tracking_number` and `slug` may still be present.To enable this feature, go to . + */ + id?: string; + /** + * Carrier-assigned tracking number of the linked return shipment. Can be used together with `return_shipment.slug` to create a new tracking subscription and retrieve the return shipment's checkpoints. + */ + tracking_number?: string; + /** + * Carrier slug (identifier) of the linked return shipment. Can be used together with `return_shipment.tracking_number` to subscribe to tracking updates for the return shipment. + */ + slug?: string; +} diff --git a/src/model/TrackingShipmentDimensions.ts b/src/model/TrackingShipmentDimensions.ts new file mode 100644 index 0000000..7b76d9d --- /dev/null +++ b/src/model/TrackingShipmentDimensions.ts @@ -0,0 +1,26 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Physical dimensions of the package (length, width and height). + */ +export interface TrackingShipmentDimensions { + /** + * The unit in which the dimension values are expressed. Allowed values: cm, in + */ + unit?: string; + /** + * The length of the shipment package. + */ + length?: number; + /** + * The width of the shipment package. + */ + width?: number; + /** + * The height of the shipment package. + */ + height?: number; +} diff --git a/src/model/TrackingShipmentDirection.ts b/src/model/TrackingShipmentDirection.ts new file mode 100644 index 0000000..2a4e913 --- /dev/null +++ b/src/model/TrackingShipmentDirection.ts @@ -0,0 +1,13 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.This field is populated in either of the following cases:1. You explicitly provided it when creating the tracking.2. AfterShip automatically detected a linked forward or return shipment.It also determines which related shipment object (`forward_shipment` or `return_shipment`) may appear in the response. + */ +export enum TrackingShipmentDirection { + forward = "forward", + return = "return", + null = "null", +} diff --git a/src/model/TrackingSignatureRequirement.ts b/src/model/TrackingSignatureRequirement.ts index 749d6c5..6c85b14 100644 --- a/src/model/TrackingSignatureRequirement.ts +++ b/src/model/TrackingSignatureRequirement.ts @@ -7,9 +7,9 @@ * 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.</br> */ export enum TrackingSignatureRequirement { - "signature_required" = "signature_required", - "adult_signature_required" = "adult_signature_required", - "indirect_signature_required" = "indirect_signature_required", - "no_signature_required" = "no_signature_required", - "null" = "null", + signature_required = "signature_required", + adult_signature_required = "adult_signature_required", + indirect_signature_required = "indirect_signature_required", + no_signature_required = "no_signature_required", + null = "null", } diff --git a/src/model/UpdateTrackingByIdRequest.ts b/src/model/UpdateTrackingByIdRequest.ts index a74518a..b45740b 100644 --- a/src/model/UpdateTrackingByIdRequest.ts +++ b/src/model/UpdateTrackingByIdRequest.ts @@ -5,6 +5,7 @@ import { UpdateTrackingByIdRequestOrderPromisedDeliveryDate } from "./UpdateTrackingByIdRequestOrderPromisedDeliveryDate"; import { UpdateTrackingByIdRequestDeliveryType } from "./UpdateTrackingByIdRequestDeliveryType"; import { UpdateTrackingByIdRequestCustomers } from "./UpdateTrackingByIdRequestCustomers"; +import { UpdateTrackingByIdRequestShipmentDirection } from "./UpdateTrackingByIdRequestShipmentDirection"; /** * @@ -130,4 +131,8 @@ export interface UpdateTrackingByIdRequest { * The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. */ customers?: UpdateTrackingByIdRequestCustomers[]; + /** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.When provided, this field gives AfterShip additional context about the shipment's intent, enabling more accurate status identification. + */ + shipment_direction?: UpdateTrackingByIdRequestShipmentDirection; } diff --git a/src/model/UpdateTrackingByIdRequestCustomers.ts b/src/model/UpdateTrackingByIdRequestCustomers.ts index 62fe3be..a342fe3 100644 --- a/src/model/UpdateTrackingByIdRequestCustomers.ts +++ b/src/model/UpdateTrackingByIdRequestCustomers.ts @@ -27,4 +27,8 @@ export interface UpdateTrackingByIdRequestCustomers { * The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. */ language?: string; + /** + * The customer's identifier on the merchant or platform (for example, Shopify) side. + */ + id?: string; } diff --git a/src/model/UpdateTrackingByIdRequestDeliveryType.ts b/src/model/UpdateTrackingByIdRequestDeliveryType.ts index f53fccc..5daf145 100644 --- a/src/model/UpdateTrackingByIdRequestDeliveryType.ts +++ b/src/model/UpdateTrackingByIdRequestDeliveryType.ts @@ -7,7 +7,7 @@ * Shipment delivery type- `pickup_at_store`- `pickup_at_courier`- `door_to_door` */ export enum UpdateTrackingByIdRequestDeliveryType { - "pickup_at_store" = "pickup_at_store", - "pickup_at_courier" = "pickup_at_courier", - "door_to_door" = "door_to_door", + pickup_at_store = "pickup_at_store", + pickup_at_courier = "pickup_at_courier", + door_to_door = "door_to_door", } diff --git a/src/model/UpdateTrackingByIdRequestShipmentDirection.ts b/src/model/UpdateTrackingByIdRequestShipmentDirection.ts new file mode 100644 index 0000000..5dffa6f --- /dev/null +++ b/src/model/UpdateTrackingByIdRequestShipmentDirection.ts @@ -0,0 +1,12 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ + +/** + * Indicates the business direction of the shipment in the e-commerce fulfillment lifecycle.Possible values:- `forward`: A forward (outbound-to-customer) shipment created for order fulfillment.- `return`: A return (customer-to-merchant) shipment created for after-sales return or exchange.When provided, this field gives AfterShip additional context about the shipment's intent, enabling more accurate status identification. + */ +export enum UpdateTrackingByIdRequestShipmentDirection { + forward = "forward", + return = "return", +} diff --git a/src/model/UpdateTrackingByIdResponse.ts b/src/model/UpdateTrackingByIdResponse.ts index f7e8ef9..5a0d07c 100644 --- a/src/model/UpdateTrackingByIdResponse.ts +++ b/src/model/UpdateTrackingByIdResponse.ts @@ -6,7 +6,7 @@ import { Tracking } from "./Tracking"; /** - * Object describes the tracking information.<div style="display:none; height: 0"></div> + * Object describes the tracking information.<div style="visibility:hidden; height: 0"></div> */ export interface UpdateTrackingByIdResponse { /**