@datafire/shipengine v3.0.0
@datafire/shipengine
Client library for ShipEngine API
Installation and Usage
npm install --save @datafire/shipengine
let shipengine = require('@datafire/shipengine').create({
api_key: ""
});
.then(data => {
console.log(data);
});
Description
ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices.
Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service.
Getting Started
If you're new to REST APIs then be sure to read our introduction to REST to understand the basics. Learn how to authenticate yourself to ShipEngine, and then use our sandbox environment to kick the tires and get familiar with our API. If you run into any problems, then be sure to check the error handling guide for tips.
Here are some step-by-step tutorials to get you started:
- Learn how to create your first shipping label
- Calculate shipping costs and compare rates across carriers
- Track packages on-demand or in real time
- Validate mailing addresses anywhere on Earth
Shipping Labels for Every Major Carrier
ShipEngine makes it easy to create shipping labels for any carrier and download them in a variety of file formats. You can even customize labels with your own messages and images.
Real-Time Package Tracking
With ShipEngine you can get the current status of a package or subscribe to real-time tracking updates via webhooks. You can also create custimized tracking pages with your own branding so your customers will always know where their package is.
Compare Shipping Costs Across Carriers
Make sure you ship as cost-effectively as possible by comparing rates across carriers using the ShipEngine Rates API. Or if you don't know the full shipment details yet, then you can get rate estimates with limited address info.
Worldwide Address Validation
ShipEngine supports address validation for virtually every country on Earth, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.
Actions
parse_address
The address-recognition API makes it easy for you to extract address data from unstructured text, including the recipient name, line 1, line 2, city, postal code, and more.
Data often enters your system as unstructured text (for example: emails, SMS messages, support tickets, or other documents). ShipEngine's address-recognition API helps you extract meaningful, structured data from this unstructured text. The parsed address data is returned in the same structure that's used for other ShipEngine APIs, such as address validation, rate quotes, and shipping labels.
Note: Address recognition is currently supported for the United States, Canada, Australia, New Zealand, the United Kingdom, and Ireland.
shipengine.parse_address({
"body": {
"text": ""
}
}, context)
Input
- input
object
- body required parse_address_request_body
Output
- output parse_address_response_body
validate_address
Address validation ensures accurate addresses and can lead to reduced shipping costs by preventing address correction surcharges. ShipEngine cross references multiple databases to validate addresses and identify potential deliverability issues.
shipengine.validate_address({
"body": []
}, context)
Input
- input
object
- body required validate_address_request_body
Output
list_batches
List Batches associated with your Shipengine account
shipengine.list_batches({}, context)
Input
- input
object
- status
string
(values: open, queued, processing, completed, completed_with_errors, archived, notifying, invalid): The possible batch status values - page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - page_size
integer
: The number of results to return per response. - sort_dir
string
: Controls the sort order of the query. - sort_by
string
(values: ship_date, processed_at): The possible batches sort by values
- status
Output
- output list_batches_response_body
create_batch
Create a Batch
shipengine.create_batch({
"body": {}
}, context)
Input
- input
object
- body required create_batch_request_body
Output
- output create_batch_response_body
get_batch_by_external_id
Get Batch By External ID
shipengine.get_batch_by_external_id({
"external_batch_id": ""
}, context)
Input
- input
object
- external_batch_id required
string
- external_batch_id required
Output
delete_batch
Delete Batch By Id
shipengine.delete_batch({
"batch_id": ""
}, context)
Input
- input
object
- batch_id required
string
: Batch ID
- batch_id required
Output
- output empty_response_body
get_batch_by_id
Get Batch By ID
shipengine.get_batch_by_id({
"batch_id": ""
}, context)
Input
- input
object
- batch_id required
string
: Batch ID
- batch_id required
Output
update_batch
Update Batch By Id
shipengine.update_batch({
"batch_id": ""
}, context)
Input
- input
object
- batch_id required
string
: Batch ID
- batch_id required
Output
- output empty_response_body
add_to_batch
Add a Shipment or Rate to a Batch
shipengine.add_to_batch({
"body": {},
"batch_id": ""
}, context)
Input
- input
object
- body required add_to_batch_request_body
- batch_id required
string
: Batch ID
Output
- output empty_response_body
list_batch_errors
Error handling in batches are handled differently than in a single synchronous request. You must retrieve the status of your batch by getting a batch and getting an overview of the statuses or you can list errors directly here below to get detailed information about the errors.
shipengine.list_batch_errors({
"batch_id": ""
}, context)
Input
- input
object
- page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - pagesize
integer
- batch_id required
string
: Batch ID
- page
Output
process_batch
Process Batch ID Labels
shipengine.process_batch({
"body": {},
"batch_id": ""
}, context)
Input
- input
object
- body required process_batch_request_body
- batch_id required
string
: Batch ID
Output
- output empty_response_body
remove_from_batch
Remove a shipment or rate from a batch
shipengine.remove_from_batch({
"body": {},
"batch_id": ""
}, context)
Input
- input
object
- body required remove_from_batch_request_body
- batch_id required
string
: Batch ID
Output
- output empty_response_body
list_carriers
List all carriers that have been added to this account
shipengine.list_carriers(null, context)
Input
This action has no parameters
Output
- output get_carriers_response_body
get_carrier_by_id
Retrive carrier info by ID
shipengine.get_carrier_by_id({
"carrier_id": ""
}, context)
Input
- input
object
- carrier_id required
string
: Carrier ID
- carrier_id required
Output
add_funds_to_carrier
Add Funds To A Carrier
shipengine.add_funds_to_carrier({
"body": {
"currency": null,
"amount": 0
},
"carrier_id": ""
}, context)
Input
- input
object
- body required add_funds_to_carrier_request_body
- carrier_id required
string
: Carrier ID
Output
get_carrier_options
Get a list of the options available for the carrier
shipengine.get_carrier_options({
"carrier_id": ""
}, context)
Input
- input
object
- carrier_id required
string
: Carrier ID
- carrier_id required
Output
list_carrier_package_types
List the package types associated with the carrier
shipengine.list_carrier_package_types({
"carrier_id": ""
}, context)
Input
- input
object
- carrier_id required
string
: Carrier ID
- carrier_id required
Output
list_carrier_services
List the services associated with the carrier ID
shipengine.list_carrier_services({
"carrier_id": ""
}, context)
Input
- input
object
- carrier_id required
string
: Carrier ID
- carrier_id required
Output
connect_carrier
Connect a carrier account
shipengine.connect_carrier({
"body": null,
"carrier_name": ""
}, context)
Input
- input
object
- body required connect_carrier_request_body
- carrier_name required
string
(values: access_worldwide, amazon_buy_shipping, apc, asendia, australia_post, canada_post, dhl_ecommerce, dhl_express, dhl_express_au, dhl_express_ca, dhl_express_uk, dpd, endicia, fedex, fedex_uk, firstmile, globegistics, imex, newgistics, ontrac, purolator_canada, royal_mail, rr_donnelley, seko, sendle, stamps_com, ups): The carrier name, such asstamps_com
,ups
,fedex
, ordhl_express
.
Output
disconnect_carrier
Disconnect a carrier
shipengine.disconnect_carrier({
"carrier_name": "",
"carrier_id": ""
}, context)
Input
- input
object
- carrier_name required
string
(values: access_worldwide, amazon_buy_shipping, apc, asendia, australia_post, canada_post, dhl_ecommerce, dhl_express, dhl_express_au, dhl_express_ca, dhl_express_uk, dpd, endicia, fedex, fedex_uk, firstmile, globegistics, imex, newgistics, ontrac, purolator_canada, royal_mail, rr_donnelley, seko, sendle, stamps_com, ups): The carrier name, such asstamps_com
,ups
,fedex
, ordhl_express
. - carrier_id required
string
: Carrier ID
- carrier_name required
Output
- output empty_response_body
get_carrier_settings
Get carrier settings
shipengine.get_carrier_settings({
"carrier_name": "",
"carrier_id": ""
}, context)
Input
- input
object
- carrier_name required
string
(values: dhl_express, fedex, newgistics, ups): The carrier name, such asstamps_com
,ups
,fedex
, ordhl_express
. - carrier_id required
string
: Carrier ID
- carrier_name required
Output
update_carrier_settings
Update carrier settings
shipengine.update_carrier_settings({
"body": null,
"carrier_name": "",
"carrier_id": ""
}, context)
Input
- input
object
- body required update_carrier_settings_request_body
- carrier_name required
string
(values: dhl_express, fedex, newgistics, ups): The carrier name, such asstamps_com
,ups
,fedex
, ordhl_express
. - carrier_id required
string
: Carrier ID
Output
- output empty_response_body
disconnect_insurer
Disconnect a Shipsurance Account
shipengine.disconnect_insurer(null, context)
Input
This action has no parameters
Output
connect_insurer
Connect a Shipsurance Account
shipengine.connect_insurer({
"body": {
"email": null,
"policy_id": ""
}
}, context)
Input
- input
object
- body required connect_insurer_request_body
Output
download_file
Get File
shipengine.download_file({
"subdir": "",
"filename": "",
"dir": ""
}, context)
Input
- input
object
- download
string
- subdir required
string
- filename required
string
- dir required
string
- download
Output
list_webhooks
List all webhooks currently enabled for the account.
shipengine.list_webhooks(null, context)
Input
This action has no parameters
Output
- output list_webhooks_response_body
create_webhook
Create a webook for specific events in the environment.
shipengine.create_webhook({
"body": {
"event": null,
"url": null
}
}, context)
Input
- input
object
- body required create_webhook_request_body
Output
- output create_webhook_response_body
delete_webhook
Delete a webhook
shipengine.delete_webhook({
"webhook_id": ""
}, context)
Input
- input
object
- webhook_id required
string
: Webhook ID
- webhook_id required
Output
- output empty_response_body
get_webhook_by_id
Retrieve individual webhook by an ID
shipengine.get_webhook_by_id({
"webhook_id": ""
}, context)
Input
- input
object
- webhook_id required
string
: Webhook ID
- webhook_id required
Output
update_webhook
Update the webhook url property
shipengine.update_webhook({
"body": {},
"webhook_id": ""
}, context)
Input
- input
object
- body required update_webhook_request_body
- webhook_id required
string
: Webhook ID
Output
- output empty_response_body
add_funds_to_insurance
You may need to auto fund your account from time to time. For example, if you don't normally ship items over $100, and may want to add funds to insurance rather than keeping the account funded.
shipengine.add_funds_to_insurance({
"body": {
"currency": null,
"amount": 0
}
}, context)
Input
- input
object
- body required add_funds_to_insurance_request_body
Output
get_insurance_balance
Retrieve the balance of your Shipsurance account.
shipengine.get_insurance_balance(null, context)
Input
This action has no parameters
Output
list_labels
This endpoint returns a list of labels that you've created. You can optionally filter the results as well as control their sort order and the number of results returned at a time.
By default, all labels are returned, 25 at a time, starting with the most recently created ones. You can combine multiple filter options to narrow-down the results. For example, if you only want to get your UPS labels for your east coast warehouse you could query by both warehouse_id
and carrier_id
shipengine.list_labels({}, context)
Input
- input
object
- label_status
string
(values: processing, completed, error, voided): Only return labels that are currently in the specified status - service_code
string
: Only return labels for a specific carrier service - carrier_id
string
: Only return labels for a specific carrier account - tracking_number
string
: Only return labels with a specific tracking number - batch_id
string
: Only return labels that were created in a specific batch - rate_id
string
: Rate ID - shipment_id
string
: Shipment ID - warehouse_id
string
: Only return labels that originate from a specific warehouse - created_at_start
string
: Only return labels that were created on or after a specific date/time - created_at_end
string
: Only return labels that were created on or before a specific date/time - page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - page_size
integer
: The number of results to return per response. - sort_dir
string
: Controls the sort order of the query. - sort_by
string
(values: modified_at, created_at): Controls which field the query is sorted by.
- label_status
Output
- output list_labels_response_body
create_label
Purchase and print a label for shipment
shipengine.create_label({
"body": {}
}, context)
Input
- input
object
- body required create_label_request_body
Output
- output create_label_response_body
get_label_by_external_shipment_id
Find a label by using the external shipment id that was used during label creation
shipengine.get_label_by_external_shipment_id({
"external_shipment_id": ""
}, context)
Input
- input
object
- label_download_type
string
(values: url, inline): There are two different ways to download a label: - external_shipment_id required
string
- label_download_type
Output
create_label_from_rate
When retrieving rates for shipments using the /rates
endpoint, the returned information contains a rate_id
property that can be used
to generate a label without having to refill in the shipment information repeatedly.
shipengine.create_label_from_rate({
"body": {},
"rate_id": ""
}, context)
Input
- input
object
- body required create_label_from_rate_request_body
- rate_id required
string
: Rate ID
Output
create_label_from_shipment
Purchase a label using a shipment ID that has already been created with the desired address and package info.
shipengine.create_label_from_shipment({
"body": {},
"shipment_id": ""
}, context)
Input
- input
object
- body required create_label_from_shipment_request_body
- shipment_id required
string
: Shipment ID
Output
get_label_by_id
Retrieve information for individual labels.
shipengine.get_label_by_id({
"label_id": ""
}, context)
Input
- input
object
- label_download_type
string
(values: url, inline): There are two different ways to download a label: - label_id required
string
: Label ID
- label_download_type
Output
create_return_label
Create a return label
shipengine.create_return_label({
"body": {},
"label_id": ""
}, context)
Input
- input
object
- body required create_return_label_request_body
- label_id required
string
: Label ID
Output
get_tracking_log_from_label
Retrieve the label's tracking information
shipengine.get_tracking_log_from_label({
"label_id": ""
}, context)
Input
- input
object
- label_id required
string
: Label ID
- label_id required
Output
void_label
Void a label by ID to get a refund.
shipengine.void_label({
"label_id": ""
}, context)
Input
- input
object
- label_id required
string
: Label ID
- label_id required
Output
- output void_label_response_body
list_manifests
Similar to querying shipments, we allow you to query manifests since there will likely be a large number over a long period of time.
shipengine.list_manifests({}, context)
Input
- input
object
- warehouse_id
string
: Warehouse ID - ship_date_start
string
: ship date start range - ship_date_end
string
: ship date end range - created_at_start
string
: Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) - created_at_end
string
: Used to create a filter for when a resource was created, (ex. A shipment that was created before a certain time) - carrier_id
string
: Carrier ID - page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - page_size
integer
: The number of results to return per response. - label_ids
array
: Array of label ids
- warehouse_id
Output
- output list_manifests_response_body
create_manifest
Each ShipEngine manifest is created for a specific warehouse, so you'll need to provide the warehouse_id rather than the ship_from address. You can create a warehouse for each location that you want to create manifests for.
shipengine.create_manifest({
"body": null
}, context)
Input
- input
object
- body required create_manifest_request_body
Output
get_manifest_by_id
Get Manifest By Id
shipengine.get_manifest_by_id({
"manifest_id": ""
}, context)
Input
- input
object
- manifest_id required
string
: The Manifest Id
- manifest_id required
Output
list_package_types
List the custom package types associated with the account
shipengine.list_package_types(null, context)
Input
This action has no parameters
Output
create_package_type
Create a custom package type to better assist in getting accurate rate estimates
shipengine.create_package_type({
"body": {
"name": "",
"package_code": null
}
}, context)
Input
- input
object
- body required create_package_type_request_body
Output
delete_package_type
Delete a custom package using the ID
shipengine.delete_package_type({
"package_id": ""
}, context)
Input
- input
object
- package_id required
string
: Package ID
- package_id required
Output
- output empty_response_body
get_package_type_by_id
Get Custom Package Type by ID
shipengine.get_package_type_by_id({
"package_id": ""
}, context)
Input
- input
object
- package_id required
string
: Package ID
- package_id required
Output
update_package_type
Update the custom package type object by ID
shipengine.update_package_type({
"body": {
"name": "",
"package_code": null
},
"package_id": ""
}, context)
Input
- input
object
- body required update_package_type_request_body
- package_id required
string
: Package ID
Output
- output empty_response_body
calculate_rates
It's not uncommon that you want to give your customer the choice between whether they want to ship the fastest, cheapest, or the most trusted route. Most companies don't solely ship things using a single shipping option; so we provide functionality to show you all your options!
shipengine.calculate_rates({
"body": {}
}, context)
Input
- input
object
- body required calculate_rates_request_body
Output
compare_bulk_rates
Get Bulk Shipment Rates
shipengine.compare_bulk_rates({
"body": {}
}, context)
Input
- input
object
- body required compare_bulk_rates_request_body
Output
estimate_rates
Get Rate Estimates
shipengine.estimate_rates({
"body": {}
}, context)
Input
- input
object
- body required estimate_rates_request_body
Output
- output estimate_rates_response_body
get_rate_by_id
Retrieve a previously queried rate by its ID
shipengine.get_rate_by_id({
"rate_id": ""
}, context)
Input
- input
object
- rate_id required
string
: Rate ID
- rate_id required
Output
- output get_rate_by_id_response_body
list_shipments
Get list of Shipments
shipengine.list_shipments({}, context)
Input
- input
object
- shipment_status
string
(values: pending, processing, label_purchased, cancelled): The possible shipment status values - batch_id
string
: Batch ID - tag
string
: Search for shipments based on the custom tag added to the shipment object - created_at_start
string
: Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) - created_at_end
string
: Used to create a filter for when a resource was created, (ex. A shipment that was created before a certain time) - modified_at_start
string
: Used to create a filter for when a resource was modified (ex. A shipment that was modified after a certain time) - modified_at_end
string
: Used to create a filter for when a resource was modified (ex. A shipment that was modified before a certain time) - page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - page_size
integer
: The number of results to return per response. - sales_order_id
string
: Sales Order ID - sort_dir
string
: Controls the sort order of the query. - sort_by
string
(values: modified_at, created_at): The possible shipments sort by values
- shipment_status
Output
- output list_shipments_response_body
create_shipments
Create one or multiple shipments.
shipengine.create_shipments({
"body": {
"shipments": []
}
}, context)
Input
- input
object
- body required create_shipments_request_body
Output
get_shipment_by_external_id
Query Shipments created using your own custom ID convention using this endpint
shipengine.get_shipment_by_external_id({
"external_shipment_id": ""
}, context)
Input
- input
object
- external_shipment_id required
string
- external_shipment_id required
Output
parse_shipment
The shipment-recognition API makes it easy for you to extract shipping data from unstructured text, including people's names, addresses, package weights and dimensions, insurance and delivery requirements, and more.
Data often enters your system as unstructured text (for example: emails, SMS messages, support tickets, or other documents). ShipEngine's shipment-recognition API helps you extract meaningful, structured data from this unstructured text. The parsed shipment data is returned in the same structure that's used for other ShipEngine APIs, so you can easily use the parsed data to create a shipping label.
Note: Shipment recognition is currently supported for the United States, Canada, Australia, New Zealand, the United Kingdom, and Ireland.
shipengine.parse_shipment({
"body": {
"text": ""
}
}, context)
Input
- input
object
- body required parse_shipment_request_body
Output
- output parse_shipment_response_body
get_shipment_by_id
Get an individual shipment based on its ID
shipengine.get_shipment_by_id({
"shipment_id": ""
}, context)
Input
- input
object
- shipment_id required
string
: Shipment ID
- shipment_id required
Output
update_shipment
Update a shipment object based on its ID
shipengine.update_shipment({
"body": {},
"shipment_id": ""
}, context)
Input
- input
object
- body required update_shipment_request_body
- shipment_id required
string
: Shipment ID
Output
cancel_shipments
Mark a shipment cancelled, if it is no longer needed or being used by your organized. Any label associated with the shipment needs to be voided first
An example use case would be if a batch label creation job is going to run at a set time and only queries pending
shipments. Marking a shipment as cancelled
would remove it from this process
shipengine.cancel_shipments({
"shipment_id": ""
}, context)
Input
- input
object
- shipment_id required
string
: Shipment ID
- shipment_id required
Output
- output empty_response_body
list_shipment_errors
If there are no errors associated with this shipment then the API will return a 404 Not Found response to indicate that no errors are associated with the request
shipengine.list_shipment_errors({
"shipment_id": ""
}, context)
Input
- input
object
- page
integer
: Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned. - pagesize
integer
- shipment_id required
string
: Shipment ID
- page
Output
list_shipment_rates
Get Rates for the shipment information associated with the shipment ID
shipengine.list_shipment_rates({
"shipment_id": ""
}, context)
Input
- input
object
- created_at_start
string
: Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) - shipment_id required
string
: Shipment ID
- created_at_start
Output
untag_shipment
Remove an existing tag from the Shipment object
shipengine.untag_shipment({
"shipment_id": "",
"tag_name": ""
}, context)
Input
- input
object
- shipment_id required
string
: Shipment ID - tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer.
- shipment_id required
Output
- output empty_response_body
tag_shipment
Add a tag to the shipment object
shipengine.tag_shipment({
"shipment_id": "",
"tag_name": ""
}, context)
Input
- input
object
- shipment_id required
string
: Shipment ID - tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer.
- shipment_id required
Output
- output tag_shipment_response_body
list_tags
Get a list of all tags associated with an account.
shipengine.list_tags(null, context)
Input
This action has no parameters
Output
- output list_tags_response_body
delete_tag
Delete a tag that is no longer needed
shipengine.delete_tag({
"tag_name": ""
}, context)
Input
- input
object
- tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer.
- tag_name required
Output
- output empty_response_body
create_tag
Create a new Tag for customizing how you track your shipments
shipengine.create_tag({
"tag_name": ""
}, context)
Input
- input
object
- tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer.
- tag_name required
Output
- output create_tag_response_body
rename_tag
Change a tag name while still keeping the relevant shipments attached to it
shipengine.rename_tag({
"tag_name": "",
"new_tag_name": ""
}, context)
Input
- input
object
- tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer. - new_tag_name required
string
: Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a customer.
- tag_name required
Output
- output empty_response_body
get_tracking_log
Retrieve package tracking information
shipengine.get_tracking_log({}, context)
Input
- input
object
- carrier_code
string
: Carrier code used to retrieve tracking information - tracking_number
string
: The tracking number associated with a shipment
- carrier_code
Output
start_tracking
Allows you to subscribe to tracking updates for a package. You specify the carrier_code and tracking_number of the package, and receive notifications via webhooks whenever the shipping status changes.
shipengine.start_tracking({}, context)
Input
- input
object
- carrier_code
string
: Carrier code used to retrieve tracking information - tracking_number
string
: The tracking number associated with a shipment
- carrier_code
Output
- output empty_response_body
stop_tracking
Unsubscribe from tracking updates for a package.
shipengine.stop_tracking({}, context)
Input
- input
object
- carrier_code
string
: Carrier code used to retrieve tracking information - tracking_number
string
: The tracking number associated with a shipment
- carrier_code
Output
- output empty_response_body
list_warehouses
Retrieve a list of warehouses associated with this account.
shipengine.list_warehouses(null, context)
Input
This action has no parameters
Output
create_warehouse
Create a warehouse location that you can use to create shipping items by simply passing in the generated warehouse id. If the return address is not supplied in the request body then it is assumed that the origin address is the return address as well
shipengine.create_warehouse({
"body": {}
}, context)
Input
- input
object
- body required create_warehouse_request_body
Output
delete_warehouse
Delete a warehouse by ID
shipengine.delete_warehouse({
"warehouse_id": ""
}, context)
Input
- input
object
- warehouse_id required
string
: Warehouse ID
- warehouse_id required
Output
- output empty_response_body
get_warehouse_by_id
Retrieve warehouse data based on the warehouse ID
shipengine.get_warehouse_by_id({
"warehouse_id": ""
}, context)
Input
- input
object
- warehouse_id required
string
: Warehouse ID
- warehouse_id required
Output
update_warehouse
Update Warehouse object information
shipengine.update_warehouse({
"body": {},
"warehouse_id": ""
}, context)
Input
- input
object
- body required update_warehouse_request_body
- warehouse_id required
string
: Warehouse ID
Output
- output empty_response_body
Definitions
add_funds_to_carrier_request_body
- add_funds_to_carrier_request_body
object
: An add funds to carrier request body- amount required
number
: The monetary amount, in the specified currency. - currency required
- amount required
add_funds_to_carrier_response_body
- add_funds_to_carrier_response_body
object
: The current balance of the requested carrier account- balance required: The current balance of the account
- amount required
number
: The monetary amount, in the specified currency. - currency required
- amount required
- balance required: The current balance of the account
add_funds_to_insurance_request_body
- add_funds_to_insurance_request_body
object
: An add funds to insurance request body- amount required
number
: The monetary amount, in the specified currency. - currency required
- amount required
add_funds_to_insurance_response_body
- add_funds_to_insurance_response_body
object
: Add funds to insurance response body- amount required
number
: The monetary amount, in the specified currency. - currency required
- amount required
add_to_batch_request_body
- add_to_batch_request_body
object
: An add to batch request body- rate_ids
array
: Array of Rate IDs to be modifed on the batch- items: The Rate ID to be modified on the batch
- shipment_ids
array
: The Shipment Ids to be modified on the batch- items: The Shipment ID to be modified on the batch
- rate_ids
address
- address
object
: Any residential or business mailing address, anywhere in the world.- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
address_residential_indicator
- address_residential_indicator
string
(values: unknown, yes, no): Indicates whether an address is residential.
address_to_validate
- address_to_validate
object
: Any residential or business mailing address, anywhere in the world.- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
address_validating_shipment
- address_validating_shipment
object
: An address validating shipment- validate_address
string
- tags
array
: Arbitrary tags associated with this shipment. Tags can be used to categorize shipments, and shipments can be queried by their tags.- items
- name required
string
: The tag name.
- name required
- items
- advanced_options: Advanced shipment options. These are entirely optional.
- bill_to_account
string
: This field is used to bill shipping costs to a third party. This field must be used in conjunction with thebill_to_country_code
,bill_to_party
, andbill_to_postal_code
fields. - bill_to_country_code: The two-letter ISO 3166-1 country code of the third-party that is responsible for shipping costs.
- bill_to_party: Indicates whether to bill shipping costs to the recipient or to a third-party. When billing to a third-party, the
bill_to_account
,bill_to_country_code
, andbill_to_postal_code
fields must also be set. - bill_to_postal_code
string
: The postal code of the third-party that is responsible for shipping costs. - collect_on_delivery collect_on_delivery
- contains_alcohol
boolean
: Indicates that the shipment contains alcohol. - custom_field1
string
: An arbitrary field that can be used to store information about the shipment. - custom_field2
string
: An arbitrary field that can be used to store information about the shipment. - custom_field3
string
: An arbitrary field that can be used to store information about the shipment. - delivered_duty_paid
boolean
: Indicates that the shipper is paying the international delivery duties for this shipment. This option is supported by UPS, FedEx, and DHL Express. - dry_ice
boolean
: Indicates if the shipment contain dry ice - dry_ice_weight: The weight of the dry ice in the shipment
- unit required
- value required
number
: The weight, in the specified unit
- freight_class
string
: The National Motor Freight Traffic Association freight class, such as "77.5", "110", or "250". - non_machinable
boolean
: Indicates that the package cannot be processed automatically because it is too large or irregularly shaped. This is primarily for USPS shipments. See Section 1.2 of the USPS parcel standards for details. - saturday_delivery
boolean
: Enables Saturday delivery, if supported by the carrier. - use_ups_ground_freight_pricing
boolean
: Whether to use UPS Ground Freight pricing. If enabled, then afreight_class
must also be specified.
- bill_to_account
- carrier_id: The carrier account that is billed for the shipping charges
- confirmation
string
: The type of delivery confirmation that is required for this shipment. - created_at: The date and time that the shipment was created in ShipEngine.
- customs: Customs information. This is usually only needed for international shipments.
- contents required
string
: The type of contents in this shipment. This may impact import duties or customs treatment. - customs_items
array
: Customs declarations for each item in the shipment.- items customs_item
- non_delivery required
string
: Indicates what to do if a package is unable to be delivered.
- contents required
- external_order_id
string
: ID that the Order Source assigned - external_shipment_id
string
: You can optionally use this field to store your own identifier for this shipment. - insurance_provider
string
: The insurance provider to use for any insured packages in the shipment. - items
array
: Describe the packages included in this shipment as related to potential metadata that was imported from- items
- asin
string
: Amazon Standard Identification Number - external_order_id
string
: external order id - external_order_item_id
string
: external order item id - name
string
: item name - order_source_code
- quantity
integer
: The quantity of this item included in the shipment - sales_order_id
string
: sales order id - sales_order_item_id
string
: sales order item id - sku
string
: Item Stock Keeping Unit
- asin
- items
- modified_at: The date and time that the shipment was created or last modified.
- order_source_code
- packages
array
: The packages in the shipment.- items
- dimensions: The package dimensions
- height required
number
: The length of the package, in the specified unit - length required
number
: The length of the package, in the specified unit - unit required
string
- width required
number
: The width of the package, in the specified unit
- height required
- external_package_id
string
: An external package id. - insured_value
object
: The insured value of the package. Requires theinsurance_provider
field of the shipment to be set.- amount required
number
: The monetary amount, in the specified currency. - currency required
- amount required
- label_messages
- reference1 required
string
: The first line of the custom label message. Some carriers may prefix this line with something like "REF", "Reference", "Trx Ref No.", etc. - reference2 required
string
: The second line of the custom label message. Some carriers may prefix this line with something like "INV", "Reference 2", "Trx Ref No.", etc. - reference3 required
string
: The third line of the custom label message. Some carriers may prefix this line with something like "PO", "Reference 3", etc.
- reference1 required
- package_code: The package type, such as
thick_envelope
,small_flat_rate_box
,large_package
, etc. The codepackage
indicates a custom or unknown package type. - tracking_number: The tracking number for the package. The format depends on the carrier.
- weight required: The package weight
- unit required
- value required
number
: The weight, in the specified unit
- dimensions: The package dimensions
- items
- return_to: The return address for this shipment. Defaults to the
ship_from
address.- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
- service_code: The carrier service used to ship the package, such as
fedex_ground
,usps_first_class_mail
,flat_rate_envelope
, etc. - ship_date: The date that the shipment was (or will be) shippped. ShipEngine will take the day of week into consideration. For example, if the carrier does not operate on Sundays, then a package that would have shipped on Sunday will ship on Monday instead.
- ship_from: The shipment's origin address. If you frequently ship from the same location, consider creating a warehouse. Then you can simply specify the
warehouse_id
rather than the complete address each time.- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
- ship_to: The recipient's mailing address
- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
- shipment_id: A string that uniquely identifies the shipment
- shipment_status
string
: The current status of the shipment - total_weight: The combined weight of all packages in the shipment
- unit required
- value required
number
: The weight, in the specified unit
- warehouse_id: The warehouse that the shipment is being shipped from. Either
warehouse_id
orship_from
must be specified.
- validate_address
address_validation_code
- address_validation_code
string
(values: a1000, a1001, a1002, a1003, a1004, a1005, a1006, a1007, a1008, r1000, r1001, r1002, r1003): The error codes that can be returned by the address validation API
address_validation_detail_code
- address_validation_detail_code
string
(values: unsupported_country, non_supported_country, minimum_postal_code_verification_failed, street_does_not_match_unique_street_name, multiple_directionals, multiple_matches, suite_not_valid, suite_missing, incompatible_paired_labels, invalid_house_number, missing_house_number, invalid_box_number, invalid_charge_event, missing_box_number, missing_cmra_or_private_mail_box_number, suite_has_no_secondaries, postal_code_changed_or_added, state_province_changed_or_added, city_locality_changed_or_added, urbanization_changed, street_name_spelling_changed_or_added, street_name_type_changed_or_added, street_direction_changed_or_added, suite_type_changed_or_added, suite_unit_number_changed_or_added, double_dependent_locality_changed_or_added, subadministrative_area_changed_or_added, subnational_area_changed_or_added, po_box_changed_or_added, premise_type_changed_or_added, house_number_changed, organization_changed_or_added, partially_verified_to_state_level, partially_verified_to_city_level, partially_verified_to_street_level, partially_verified_to_premise_level, verified_to_state_level, verified_to_city_level, verified_to_street_level, verified_to_premise_level, verified_to_suite_level, coded_to_street_lavel, coded_to_neighborhood_level, coded_to_community_level, coded_to_state_level, coded_to_rooftop_level, coded_to_rooftop_interpolation_level, name_max_length_exceeded, phone_max_length_exceeded, company_name_max_length_exceeded, line1_min_max_length, line2_max_length_exceeded, line3_max_length_exceeded, city_locality_max_length_exceeded, state_province_max_length_exceeded, invalid_postal_code, country_invalid_length, address_not_found): The detailed error codes that can be returned by the address validation API
address_validation_message_type
- address_validation_message_type
string
(values: error, warning, info): The different types of messages that can be returned by the address validation API
address_validation_result
- address_validation_result
object
: An address validation result- matched_address required: The matched address found by the Shipengine API
- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
- messages required
array
: The list of messages that were generated during the address validation request.- items response_message
- original_address required: The original address that was sent for validation
- address_line1
string
: The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines. - address_line2
string
: The second line of the street address. For some addresses, this line may not be needed. - address_line3
string
: The third line of the street address. For some addresses, this line may not be needed. - address_residential_indicator
string
: Indicates whether this is a residential address. - city_locality
string
: The name of the city or locality - company_name
string
: If this is a business address, then the company name should be specified here. - country_code: The two-letter ISO 3166-1 country code
- name
string
: The name of a contact person at this address. This field may be set instead of - or in addition to - thecompany_name
field. - phone
string
: The phone number of a contact person at this address. The format of this phone number varies depending on the country. - postal_code
- state_province
string
: The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.
- address_line1
- status required
- matched_address required: The matched address found by the Shipengine API
address_validation_status
- address_validation_status
string
(values: unverified, verified, warning, error): The possible address validation status values
advanced_shipment_options
- advanced_shipment_options
object
: Advanced shipment options- bill_to_account
string
: This field is used to bill shipping costs to a third party. This field must be used in conjunction with thebill_to_country_code
,bill_to_party
, andbill_to_postal_code
fields. - bill_to_country_code: The two-letter ISO 3166-1 country code of the third-party that is responsible for shipping costs.
- bill_to_party: Indicates whether to bill shipping costs to the recipient or to a third-party. When billing to a third-party, the
bill_to_account
,bill_to_country_code
, andbill_to_postal_code
fields must also be set. - bill_to_postal_code
string
: The postal code of the third-party that is responsible for shipping costs. - collect_on_delivery collect_on_delivery
- contains_alcohol
boolean
: Indicates that the shipment contains alcohol. - custom_field1
string
: An arbitrary field that can be used to store information about the shipment. - custom_field2
string
: An arbitrary field that can be used to store information about the shipment. - custom_field3
string
: An arbitrary field that can be used to store information about the shipment. - delivered_duty_paid
boolean
: Indicates that the shipper is paying the international delivery duties for this shipment. This option is supported by UPS, FedEx, and DHL Express. - dry_ice
boolean
: Indicates if the shipment contain dry ice - dry_ice_weight: The weight of the dry ice in the shipment
- unit required
- value required
number
: The weight, in the specified unit
- freight_class
string
: The National Motor Freight Traffic Association freight class, such as "77.5", "110", or "250". - non_machinable
boolean
: Indicates that the package cannot be processed automatically because it is too large or irregularly shaped. This is primarily for USPS shipments. See Section 1.2 of the USPS parcel standards for details. - saturday_delivery
boolean
: Enables Saturday delivery, if supported by the carrier. - use_ups_ground_freight_pricing
boolean
: Whether to use UPS Ground Freight pricing. If enabled, then afreight_class
must also be specified.
- bill_to_account
ancillary_service_endorsement
- ancillary_service_endorsement
string
(values: none, return_service_requested, forwarding_service_requested, address_service_requested, change_service_requested, leave_if_no_response): Ancillary service endorsements are used by mailers to request an addressee's new address and to provide the carrier with instructions on how to handle packages that are undeliverable as addressed.
batch
- batch
object
: Batches are an advanced feature of ShipEngine designed for users who need to generate hundreds or- batch_errors_url required: Link to batch errors endpoint
- href: The URL of the linked resource, if any
- type
string
: The type of resource, or the type of relationship to the parent resource
- batch_id required: A string that uniquely identifies the batch
- batch_labels_url required: Link to batch labels query
- href: The URL of the linked resource, if any
- type
string
: The type of resource, or the type of relationship to the parent resource
- batch_notes required
string
: Custom notes you can add for each created batch - batch_shipments_url required: The batch shipments endpoint
- href: The URL of the linked resource, if any
- type
string
: The type of resource, or the type of relationship to the parent resource
- completed required
integer
: The number of labels generated in the batch - count required
integer
: The total of errors, warnings, and completed properties - created_at required: The date and time the batch was created in ShipEngine
- errors required
integer
: The number of
- batch_errors_url required: Link to batch errors endpoint
5 years ago