{ "swagger": "2.0", "info": { "title": "AfterShip", "description": "AfterShip is a shipment tracking solution. It partners with over 900 carriers across the globe including popular services such as FedEx, DHL etc. This connector allows a user to track and receive notifications on shipments and integrate with other services such as Dynamics 365 and third party services to strengthen your ecommerce or streamline your internal business processes.", "version": "1.0", "contact": { "name": "Taiki Yoshida", "url": "https://memo.tyoshida.me/power-platform/connectors/aftership-connector/", "email": "tayoshi@microsoft.com" } }, "host": "api.aftership.com", "basePath": "/v4", "schemes": [ "https" ], "consumes": [], "produces": [ "application/json" ], "paths": { "/couriers": { "get": { "summary": "Get user activated couriers", "description": "Return a list of [couriers activated at your AfterShip account](https://admin.aftership.com/settings/couriers).", "operationId": "GetUserActivatedCouriers", "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "total": { "type": "integer", "format": "int32", "description": "total" }, "couriers": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "name": { "type": "string", "description": "Name" }, "phone": { "type": "string", "description": "Phone number" }, "other_name": { "type": "string", "description": "Alternative name" }, "web_url": { "type": "string", "description": "URL of the website" }, "required_fields": { "type": "array", "items": { "type": "string" }, "description": "Required fields" }, "optional_fields": { "type": "array", "items": { "type": "string" }, "description": "Optional fields" }, "default_language": { "type": "string", "description": "Default language" }, "support_languages": { "type": "array", "items": { "type": "string" }, "description": "Supported languages" }, "service_from_country_iso3": { "type": "array", "items": { "type": "string" }, "description": "Country code of the service in ISO3 format" } } }, "description": "Couriers information" } }, "description": "data" } } } } } } }, "/couriers/detect": { "post": { "summary": "Detect courier", "description": "Return a list of matched couriers based on tracking number format and [selected couriers](https://admin.aftership.com/settings/couriers) or a list of couriers.", "operationId": "DetectCourier", "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "tracking_number": { "type": "string", "description": "Tracking number" } }, "description": "tracking" } }, "default": { "tracking": { "tracking_number": "906587618687" } }, "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "total": { "type": "integer", "format": "int32", "description": "total" }, "couriers": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "name": { "type": "string", "description": "Name" }, "phone": { "type": "string", "description": "Phone number" }, "other_name": { "type": "string", "description": "Alternative name" }, "web_url": { "type": "string", "description": "URL of the website" }, "required_fields": { "type": "array", "items": { "type": "string" }, "description": "Required fields" }, "optional_fields": { "type": "array", "items": { "type": "string" }, "description": "Optional fields" }, "default_language": { "type": "string", "description": "Default language" }, "support_languages": { "type": "array", "items": { "type": "string" }, "description": "Supported languages" }, "service_from_country_iso3": { "type": "array", "items": { "type": "string" }, "description": "Country code of the service in ISO3 format" } } }, "description": "Couriers information" } }, "description": "data" } } } } } } }, "/couriers/all": { "get": { "summary": "Get all couriers", "description": "Return a list of all couriers.", "operationId": "GetAllCouriers", "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "total": { "type": "integer", "format": "int32", "description": "total" }, "couriers": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "name": { "type": "string", "description": "Name" }, "phone": { "type": "string", "description": "Phone number" }, "other_name": { "type": "string", "description": "Alternative name" }, "web_url": { "type": "string", "description": "URL of the website" }, "required_fields": { "type": "array", "items": {}, "description": "Required fields" }, "optional_fields": { "type": "array", "items": {}, "description": "Optional fields" } } }, "description": "Couriers information" } }, "description": "data" } } } } } } }, "/trackings": { "get": { "summary": "Get trackings", "description": "Get tracking results of multiple trackings.", "operationId": "GetTrackings", "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "page": { "type": "integer", "format": "int32", "description": "page" }, "limit": { "type": "integer", "format": "int32", "description": "limit" }, "count": { "type": "integer", "format": "int32", "description": "count" }, "keyword": { "type": "string", "description": "keyword" }, "slug": { "type": "string", "description": "Courier Name" }, "origin": { "type": "array", "items": {}, "description": "origin" }, "destination": { "type": "array", "items": {}, "description": "destination" }, "tag": { "type": "string", "description": "Tags" }, "fields": { "type": "string", "description": "fields" }, "created_at_min": { "type": "string", "description": "created_at_min" }, "created_at_max": { "type": "string", "description": "created_at_max" }, "last_updated_at": { "type": "string", "description": "Last updated date and time" }, "return_to_sender": { "type": "array", "items": {}, "description": "return_to_sender" }, "courier_destination_country_iso3": { "type": "array", "items": {}, "description": "Courier country code in ISO 3 format" }, "trackings": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "created_at": { "type": "string", "description": "Created date and time" }, "updated_at": { "type": "string", "description": "Updated date and time" }, "last_updated_at": { "type": "string", "description": "Last updated date and time" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "active": { "type": "boolean", "description": "Active or inactive tracking" }, "android": { "type": "array", "items": {}, "description": "Android" }, "custom_fields": { "type": "string", "description": "Custom fields" }, "customer_name": { "type": "string", "description": "Customer Name" }, "delivery_time": { "type": "integer", "format": "int32", "description": "Delivery date and time" }, "destination_country_iso3": { "type": "string", "description": "Destination country code in ISO 3 format" }, "courier_destination_country_iso3": { "type": "string", "description": "Courier country code in ISO 3 format" }, "emails": { "type": "array", "items": { "type": "string" }, "description": "Email addresses" }, "expected_delivery": { "type": "string", "description": "Expected delivery date and time" }, "ios": { "type": "array", "items": {}, "description": "iOS" }, "note": { "type": "string", "description": "Notes" }, "order_id": { "type": "string", "description": "Order ID" }, "order_id_path": { "type": "string", "description": "Order ID path" }, "origin_country_iso3": { "type": "string", "description": "Originating country code in ISO 3 format" }, "shipment_package_count": { "type": "integer", "format": "int32", "description": "Number of packages in the shipment" }, "shipment_pickup_date": { "type": "string", "description": "Date and time of packages picked up" }, "shipment_delivery_date": { "type": "string", "description": "Date and time of packages delivered" }, "shipment_type": { "type": "string", "description": "Type of shipment" }, "shipment_weight": { "type": "string", "description": "Weight of shipment" }, "shipment_weight_unit": { "type": "string", "description": "Unit of shipment weight" }, "signed_by": { "type": "string", "description": "Signed by" }, "smses": { "type": "array", "items": { "type": "string" }, "description": "SMS" }, "source": { "type": "string", "description": "Source" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "title": { "type": "string", "description": "title" }, "tracked_count": { "type": "integer", "format": "int32", "description": "Number of times tracked" }, "last_mile_tracking_supported": { "type": "string", "description": "Last mile tracking is supported" }, "language": { "type": "string", "description": "Language" }, "unique_token": { "type": "string", "description": "Unique token" }, "checkpoints": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "city": { "type": "string", "description": "City" }, "created_at": { "type": "string", "description": "Created date and time" }, "location": { "type": "string", "description": "Location" }, "country_name": { "type": "string", "description": "Country name" }, "message": { "type": "string", "description": "Message" }, "country_iso3": { "type": "string", "description": "Country code in ISO 3 format" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "checkpoint_time": { "type": "string", "description": "Time reached checkpoint" }, "coordinates": { "type": "array", "items": {}, "description": "Coordinates" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "Zip code" }, "raw_tag": { "type": "string", "description": "Raw tags" } } }, "description": "checkpoints" }, "subscribed_smses": { "type": "array", "items": { "type": "string" }, "description": "subscribed_smses" }, "subscribed_emails": { "type": "array", "items": { "type": "string" }, "description": "subscribed_emails" }, "return_to_sender": { "type": "boolean", "description": "return_to_sender" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" }, "order_promised_delivery_date": { "type": "string", "description": "order_promised_delivery_date" }, "delivery_type": { "type": "string", "description": "delivery_type" }, "pickup_location": { "type": "string", "description": "pickup_location" }, "pickup_note": { "type": "string", "description": "pickup_note" }, "courier_tracking_link": { "type": "string", "description": "courier_tracking_link" }, "courier_redirect_link": { "type": "string", "description": "courier_redirect_link" }, "first_attempted_at": { "type": "string", "description": "first_attempted_at" } } }, "description": "trackings" } }, "description": "data" } } } } } }, "post": { "summary": "Create Tracking", "description": "Create a tracking.", "operationId": "CreateTracking", "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "title": { "type": "string", "description": "title" }, "smses": { "type": "array", "items": {}, "description": "SMS" }, "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "order_id": { "type": "string", "description": "Order ID" }, "order_id_path": { "type": "string", "description": "Order ID path" }, "custom_fields": { "type": "object", "properties": { "product_name": { "type": "string", "description": "product_name" }, "product_price": { "type": "string", "description": "product_price" } }, "description": "Custom fields" }, "language": { "type": "string", "description": "Language" }, "order_promised_delivery_date": { "type": "string", "description": "order_promised_delivery_date" }, "delivery_type": { "type": "string", "description": "delivery_type" }, "pickup_location": { "type": "string", "description": "pickup_location" }, "pickup_note": { "type": "string", "description": "pickup_note" } }, "description": "tracking" } }, "default": { "tracking": { "slug": "dhl", "tracking_number": "123456789", "title": "Title Name", "smses": [], "emails": [], "order_id": "ID 1234", "order_id_path": "http://www.aftership.com/order_id=1234", "custom_fields": { "product_name": "iPhone Case", "product_price": "USD19.99" }, "language": "en", "order_promised_delivery_date": "2019-05-20", "delivery_type": "pickup_at_store", "pickup_location": "Flagship Store", "pickup_note": "Reach out to our staffs when you arrive our stores for shipment pickup" } }, "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "created_at": { "type": "string", "description": "Created date and time" }, "updated_at": { "type": "string", "description": "Updated date and time" }, "last_updated_at": { "type": "string", "description": "Last updated date and time" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "active": { "type": "boolean", "description": "Active or inactive tracking" }, "android": { "type": "array", "items": {}, "description": "Android" }, "custom_fields": { "type": "string", "description": "Custom fields" }, "customer_name": { "type": "string", "description": "Customer Name" }, "delivery_time": { "type": "integer", "format": "int32", "description": "Delivery date and time" }, "destination_country_iso3": { "type": "string", "description": "Destination country code in ISO 3 format" }, "courier_destination_country_iso3": { "type": "string", "description": "Courier country code in ISO 3 format" }, "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "expected_delivery": { "type": "string", "description": "Expected delivery date and time" }, "ios": { "type": "array", "items": {}, "description": "iOS" }, "note": { "type": "string", "description": "Notes" }, "order_id": { "type": "string", "description": "Order ID" }, "order_id_path": { "type": "string", "description": "Order ID path" }, "origin_country_iso3": { "type": "string", "description": "Originating country code in ISO 3 format" }, "shipment_package_count": { "type": "integer", "format": "int32", "description": "Number of packages in the shipment" }, "shipment_pickup_date": { "type": "string", "description": "Date and time of packages picked up" }, "shipment_delivery_date": { "type": "string", "description": "Date and time of packages delivered" }, "shipment_type": { "type": "string", "description": "Type of shipment" }, "shipment_weight": { "type": "integer", "format": "int32", "description": "Weight of shipment" }, "shipment_weight_unit": { "type": "string", "description": "Unit of shipment weight" }, "signed_by": { "type": "string", "description": "Signed by" }, "smses": { "type": "array", "items": {}, "description": "SMS" }, "source": { "type": "string", "description": "Source" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "title": { "type": "string", "description": "title" }, "tracked_count": { "type": "integer", "format": "int32", "description": "Number of times tracked" }, "last_mile_tracking_supported": { "type": "boolean", "description": "Last mile tracking is supported" }, "language": { "type": "string", "description": "Language" }, "unique_token": { "type": "string", "description": "Unique token" }, "checkpoints": { "type": "array", "items": {}, "description": "checkpoints" }, "subscribed_smses": { "type": "array", "items": {}, "description": "subscribed_smses" }, "subscribed_emails": { "type": "array", "items": {}, "description": "subscribed_emails" }, "return_to_sender": { "type": "boolean", "description": "return_to_sender" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" }, "order_promised_delivery_date": { "type": "string", "description": "order_promised_delivery_date" }, "delivery_type": { "type": "string", "description": "delivery_type" }, "pickup_location": { "type": "string", "description": "pickup_location" }, "pickup_note": { "type": "string", "description": "pickup_note" }, "courier_tracking_link": { "type": "string", "description": "courier_tracking_link" }, "courier_redirect_link": { "type": "string", "description": "courier_redirect_link" }, "first_attempted_at": { "type": "string", "description": "first_attempted_at" } }, "description": "tracking" } }, "description": "data" } } } } } } }, "/trackings/{slug}/{tracking_number}": { "get": { "summary": "Get a tracking", "description": "Get tracking results of a single tracking.", "operationId": "GetATracking", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "created_at": { "type": "string", "description": "Created date and time" }, "updated_at": { "type": "string", "description": "Updated date and time" }, "last_updated_at": { "type": "string", "description": "Last updated date and time" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "active": { "type": "boolean", "description": "Active or inactive tracking" }, "android": { "type": "array", "items": {}, "description": "Android" }, "custom_fields": { "type": "string", "description": "Custom fields" }, "customer_name": { "type": "string", "description": "Customer Name" }, "delivery_time": { "type": "integer", "format": "int32", "description": "Delivery date and time" }, "destination_country_iso3": { "type": "string", "description": "Destination country code in ISO 3 format" }, "courier_destination_country_iso3": { "type": "string", "description": "Courier country code in ISO 3 format" }, "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "expected_delivery": { "type": "string", "description": "Expected delivery date and time" }, "ios": { "type": "array", "items": {}, "description": "iOS" }, "note": { "type": "string", "description": "Notes" }, "order_id": { "type": "string", "description": "Order ID" }, "order_id_path": { "type": "string", "description": "Order ID path" }, "origin_country_iso3": { "type": "string", "description": "Originating country code in ISO 3 format" }, "shipment_package_count": { "type": "integer", "format": "int32", "description": "Number of packages in the shipment" }, "shipment_pickup_date": { "type": "string", "description": "Date and time of packages picked up" }, "shipment_delivery_date": { "type": "string", "description": "Date and time of packages delivered" }, "shipment_type": { "type": "string", "description": "Type of shipment" }, "shipment_weight": { "type": "integer", "format": "int32", "description": "Weight of shipment" }, "shipment_weight_unit": { "type": "string", "description": "Unit of shipment weight" }, "signed_by": { "type": "string", "description": "Signed by" }, "smses": { "type": "array", "items": {}, "description": "SMS" }, "source": { "type": "string", "description": "Source" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "title": { "type": "string", "description": "title" }, "tracked_count": { "type": "integer", "format": "int32", "description": "Number of times tracked" }, "last_mile_tracking_supported": { "type": "string", "description": "Last mile tracking is supported" }, "language": { "type": "string", "description": "Language" }, "unique_token": { "type": "string", "description": "Unique token" }, "checkpoints": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "city": { "type": "string", "description": "City" }, "created_at": { "type": "string", "description": "Created date and time" }, "location": { "type": "string", "description": "Location" }, "country_name": { "type": "string", "description": "Country name" }, "message": { "type": "string", "description": "Message" }, "country_iso3": { "type": "string", "description": "Country code in ISO 3 format" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "checkpoint_time": { "type": "string", "description": "Time reached checkpoint" }, "coordinates": { "type": "array", "items": {}, "description": "Coordinates" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "Zip code" }, "raw_tag": { "type": "string", "description": "Raw tags" } } }, "description": "checkpoints" }, "subscribed_smses": { "type": "array", "items": {}, "description": "subscribed_smses" }, "subscribed_emails": { "type": "array", "items": {}, "description": "subscribed_emails" }, "return_to_sender": { "type": "boolean", "description": "return_to_sender" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" }, "order_promised_delivery_date": { "type": "string", "description": "order_promised_delivery_date" }, "delivery_type": { "type": "string", "description": "delivery_type" }, "pickup_location": { "type": "string", "description": "pickup_location" }, "pickup_note": { "type": "string", "description": "pickup_note" }, "courier_tracking_link": { "type": "string", "description": "courier_tracking_link" }, "courier_redirect_link": { "type": "string", "description": "courier_redirect_link" }, "first_attempted_at": { "type": "string", "description": "first_attempted_at" } }, "description": "tracking" } }, "description": "data" } } } } } }, "delete": { "summary": "Delete a tracking", "description": "Delete a tracking.", "operationId": "DeleteATracking", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" } }, "description": "tracking" } }, "description": "data" } } } } } }, "put": { "summary": "Update a tracking", "description": "Update a tracking.", "operationId": "UpdateATracking", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "title": { "type": "string", "description": "title" }, "note": { "type": "string", "description": "Notes" } }, "description": "tracking" } }, "default": { "tracking": { "title": "New Title", "note": "some notes" } }, "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "created_at": { "type": "string", "description": "Created date and time" }, "updated_at": { "type": "string", "description": "Updated date and time" }, "last_updated_at": { "type": "string", "description": "Last updated date and time" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "active": { "type": "boolean", "description": "Active or inactive tracking" }, "android": { "type": "array", "items": {}, "description": "Android" }, "custom_fields": { "type": "string", "description": "Custom fields" }, "customer_name": { "type": "string", "description": "Customer Name" }, "delivery_time": { "type": "integer", "format": "int32", "description": "Delivery date and time" }, "destination_country_iso3": { "type": "string", "description": "Destination country code in ISO 3 format" }, "courier_destination_country_iso3": { "type": "string", "description": "Courier country code in ISO 3 format" }, "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "expected_delivery": { "type": "string", "description": "Expected delivery date and time" }, "ios": { "type": "array", "items": {}, "description": "iOS" }, "note": { "type": "string", "description": "Notes" }, "order_id": { "type": "string", "description": "Order ID" }, "order_id_path": { "type": "string", "description": "Order ID path" }, "origin_country_iso3": { "type": "string", "description": "Originating country code in ISO 3 format" }, "shipment_package_count": { "type": "integer", "format": "int32", "description": "Number of packages in the shipment" }, "shipment_pickup_date": { "type": "string", "description": "Date and time of packages picked up" }, "shipment_delivery_date": { "type": "string", "description": "Date and time of packages delivered" }, "shipment_type": { "type": "string", "description": "Type of shipment" }, "shipment_weight": { "type": "integer", "format": "int32", "description": "Weight of shipment" }, "shipment_weight_unit": { "type": "string", "description": "Unit of shipment weight" }, "signed_by": { "type": "string", "description": "Signed by" }, "smses": { "type": "array", "items": {}, "description": "SMS" }, "source": { "type": "string", "description": "Source" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "title": { "type": "string", "description": "title" }, "tracked_count": { "type": "integer", "format": "int32", "description": "Number of times tracked" }, "last_mile_tracking_supported": { "type": "string", "description": "Last mile tracking is supported" }, "language": { "type": "string", "description": "Language" }, "unique_token": { "type": "string", "description": "Unique token" }, "checkpoints": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "city": { "type": "string", "description": "City" }, "created_at": { "type": "string", "description": "Created date and time" }, "location": { "type": "string", "description": "Location" }, "country_name": { "type": "string", "description": "Country name" }, "message": { "type": "string", "description": "Message" }, "country_iso3": { "type": "string", "description": "Country code in ISO 3 format" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "checkpoint_time": { "type": "string", "description": "Time reached checkpoint" }, "coordinates": { "type": "array", "items": {}, "description": "Coordinates" }, "state": { "type": "string", "description": "State" }, "zip": { "type": "string", "description": "Zip code" }, "raw_tag": { "type": "string", "description": "Raw tags" } } }, "description": "checkpoints" }, "subscribed_smses": { "type": "array", "items": {}, "description": "subscribed_smses" }, "subscribed_emails": { "type": "array", "items": {}, "description": "subscribed_emails" }, "return_to_sender": { "type": "boolean", "description": "return_to_sender" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" }, "order_promised_delivery_date": { "type": "string", "description": "order_promised_delivery_date" }, "delivery_type": { "type": "string", "description": "delivery_type" }, "pickup_location": { "type": "string", "description": "pickup_location" }, "pickup_note": { "type": "string", "description": "pickup_note" }, "courier_tracking_link": { "type": "string", "description": "courier_tracking_link" }, "courier_redirect_link": { "type": "string", "description": "courier_redirect_link" }, "first_attempted_at": { "type": "string", "description": "first_attempted_at" } }, "description": "tracking" } }, "description": "data" } } } } } } }, "/trackings/{slug}/{tracking_number}/retrack": { "post": { "summary": "Retrack an expired tracking", "description": "Retrack an expired tracking. Max 3 times per tracking.", "operationId": "RetrackAnExpiredTracking", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" }, "message": { "type": "string", "description": "Message" }, "type": { "type": "string", "description": "type" } }, "description": "meta" }, "data": { "type": "object", "properties": { "tracking": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "tracking_account_number": { "type": "string", "description": "tracking_account_number" }, "tracking_origin_country": { "type": "string", "description": "tracking_origin_country" }, "tracking_destination_country": { "type": "string", "description": "tracking_destination_country" }, "tracking_key": { "type": "string", "description": "tracking_key" }, "tracking_postal_code": { "type": "string", "description": "tracking_postal_code" }, "tracking_ship_date": { "type": "string", "description": "tracking_ship_date" }, "tracking_state": { "type": "string", "description": "tracking_state" }, "active": { "type": "boolean", "description": "Active or inactive tracking" } }, "description": "tracking" } }, "description": "data" } } } } } } }, "/trackings/{slug}/{tracking_number}/mark-as-completed": { "post": { "summary": "Mark tracking as completed", "description": "Mark a tracking as completed. The tracking won't auto update until retrack it.", "operationId": "MarkTrackingAsCompleted", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "fedex", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "reason": { "type": "string", "description": "reason", "x-ms-visibility": "important", "enum": [ "DELIVERED", "LOST", "RETURNED_TO_SENDER" ] } }, "default": { "reason": "RETURNED_TO_SENDER" }, "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" }, "message": { "type": "string", "description": "Message" }, "type": { "type": "string", "description": "type" } }, "description": "meta" }, "data": { "type": "object", "properties": {}, "description": "data" } } } } } } }, "/notifications/{slug}/{tracking_number}": { "get": { "summary": "Get tracking notification", "description": "Get contact information for the users to notify when the tracking changes. Please note that only customer receivers will be returned. Any `email`, `sms` or `webhook` that belongs to the Store will not be returned.", "operationId": "GetTrackingNotification", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "notification": { "type": "object", "properties": { "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "smses": { "type": "array", "items": { "type": "string" }, "description": "SMS" } }, "description": "notification" } }, "description": "data" } } } } } } }, "/notifications/{slug}/{tracking_number}/add": { "post": { "summary": "Add a notification", "description": "Add notification receivers to a tracking number.", "operationId": "AddANotification", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true, "x-ms-visibility": "important" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "notification": { "type": "object", "properties": { "emails": { "type": "object", "properties": {}, "description": "Email addresses" }, "smses": { "type": "object", "properties": {}, "description": "SMS" } }, "description": "notification" } }, "default": { "notification": { "emails": {}, "smses": {} } } }, "required": true } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "notification": { "type": "object", "properties": { "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "smses": { "type": "array", "items": { "type": "string" }, "description": "SMS" } }, "description": "notification" } }, "description": "data" } } } } } } }, "/notifications/{slug}/{tracking_number}/remove": { "post": { "summary": "Remove a notification", "description": "Remove notification receivers from a tracking number.", "operationId": "RemoveANotification", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" }, { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "notification": { "type": "object", "properties": { "emails": { "type": "object", "properties": {}, "description": "Email addresses" }, "smses": { "type": "object", "properties": {}, "description": "SMS" } }, "description": "notification" } }, "default": { "notification": { "emails": {}, "smses": {} } } }, "required": true } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "notification": { "type": "object", "properties": { "emails": { "type": "array", "items": {}, "description": "Email addresses" }, "smses": { "type": "array", "items": { "type": "string" }, "description": "SMS" } }, "description": "notification" } }, "description": "data" } } } } } } }, "/last_checkpoint/{slug}/{tracking_number}": { "get": { "summary": "Get last checkpoint", "description": "Return the tracking information of the last checkpoint of a single tracking.", "operationId": "GetLastCheckpoint", "parameters": [ { "name": "slug", "description": "Courier slug", "x-ms-summary": "Courier slug", "default": "FedEx", "in": "path", "type": "string", "required": true }, { "name": "tracking_number", "description": "Enter the tracking number", "x-ms-summary": "Tracking number", "default": "123456789", "in": "path", "type": "string", "required": true }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json", "description": "Content-Type", "x-ms-visibility": "internal" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "code" } }, "description": "meta" }, "data": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "tracking_number": { "type": "string", "description": "Tracking number" }, "slug": { "type": "string", "description": "Courier Name" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "checkpoint": { "type": "object", "properties": { "slug": { "type": "string", "description": "Courier Name" }, "created_at": { "type": "string", "description": "Created date and time" }, "checkpoint_time": { "type": "string", "description": "Time reached checkpoint" }, "city": { "type": "string", "description": "City" }, "coordinates": { "type": "array", "items": {}, "description": "Coordinates" }, "country_iso3": { "type": "string", "description": "Country code in ISO 3 format" }, "country_name": { "type": "string", "description": "Country name" }, "message": { "type": "string", "description": "Message" }, "state": { "type": "string", "description": "State" }, "tag": { "type": "string", "description": "Tags" }, "subtag": { "type": "string", "description": "Sub tags" }, "subtag_message": { "type": "string", "description": "Sub tag messages" }, "zip": { "type": "string", "description": "Zip code" }, "raw_tag": { "type": "string", "description": "Raw tags" } }, "description": "checkpoint" } }, "description": "data" } } } } } } } }, "definitions": {}, "parameters": {}, "responses": {}, "securityDefinitions": { "api_key": { "type": "apiKey", "in": "header", "name": "aftership-api-key" } }, "security": [], "tags": [], "x-ms-connector-metadata": [ { "propertyName": "Website", "propertyValue": "https://www.aftership.com" }, { "propertyName": "Privacy policy", "propertyValue": "https://www.automizely.com/legal/privacy" }, { "propertyName": "Categories", "propertyValue": "Commerce" } ] }