Errors Guide
This guide explains how to identify and handle errors returned by the EasyPost API, including HTTP status codes, error response structures, and common error codes.
- Review the Getting Started Guide for an introduction to the EasyPost API.
- Become familiar with EasyPost API operations and Client Libraries.
- Understand basic HTTP status codes and error handling.
EasyPost communicates errors using standard HTTP status codes and returns a JSON response with additional details about the error.
- 400 Bad Request: The request was not processed due to a client error.
- 401 Unauthorized: Authentication is required and has failed.
- 402 Payment Required: There is a lack of billing information or insufficient funds.
- 403 Forbidden: The request was valid, but the server is refusing to respond to it.
- 404 Not Found: The requested resource could not be found.
- 405 Method Not Allowed: The request method is not supported for the requested resource.
- 422 Unprocessable Entity: The request was well-formed, but the server was unable to process the provided data.
- 429 Too Many Requests: The user has sent too many requests in a given amount of time.
- 500 Internal Server Error: An unexpected error occurred on the server.
- 503 Service Unavailable: The server is currently unable to handle the request due to temporary overloading or maintenance.
The EasyPost API returns error details in a structured JSON response. Error responses can include the following fields:
code: A machine-readable string that identifies the error.message: A human-readable description of the error.errors: An array containing additional error details. Items can be structured objects or strings, depending on the error.
EasyPost Client Libraries encapsulate API errors and raise exceptions for client errors, server errors, and exceptional conditions such as network failures. Handle exceptions appropriately based on the application’s requirements.
API errors can return the errors field in one of two formats:
- Array of objects: Each item contains structured error details, such as a
messagefield. - Array of strings: Each item contains the error message directly as a string.
Check the type of each item in the errors array before accessing its value. When an item is an object, access the error message using a field such
as error.errors[0][“message”]. When an item is a string, access the value directly using error.errors[0].
For production error handling, account for both formats rather than assuming a single response shape.
1curl -X POST https://api.easypost.com/v2/shipments \
2 -u "$EASYPOST_API_KEY": \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "shipment": {}
6 }'1{
2 "error": {
3 "code": "ADDRESS.VERIFY.FAILURE",
4 "message": "Address not found",
5 "errors": [
6 {
7 "field": "address",
8 "message": "Address not found",
9 "suggestion": null
10 },
11 {
12 "field": "street1",
13 "message": "House number is missing",
14 "suggestion": null
15 }
16 ]
17 }
18}Code | Description |
|---|---|
| INTERNAL_SERVER_ERROR | An internal server error occurred. Retry the request. Contact support@easypost.com if the error continues. |
| NOT_ACCEPTABLE | The requested response format is not supported by the resource. |
| NOT_FOUND | The requested resource was not found. |
| FORBIDDEN | Access to the requested resource is forbidden. |
| PAYMENT_REQUIRED | The account has insufficient funds. Review the account billing settings. |
| UNAUTHORIZED | Authentication failed or the provided credentials do not permit access to the resource. |
| BAD_REQUEST | The request is malformed or contains invalid data. |
| PAYMENT_GATEWAY.ERROR | The payment processor could not complete the request. Retry the request or contact support@easypost.com if the error continues. |
| MODE.UNAUTHORIZED | A production API key is required to access this resource. |
| MODE.CONFLICT | The API key mode does not match the requested resource or parameter mode. |
| DATE.PARSE.FAILURE | One or more dates are incorrectly formatted and could not be parsed. |
| PARAMETER.FORBIDDEN | The request contains one or more parameters that are not permitted. |
| PARAMETER.REQUIRED | A required parameter is missing. |
Code | Description |
|---|---|
| ADDRESS.PARAMETERS.INVALID_CHARACTER | One or more address parameters contain an invalid character. |
| ADDRESS.PARAMETERS.INVALID | One or more parameters required to create the Address are missing or invalid. |
| ADDRESS.COUNTRY.INVALID | The 'country' parameter must contain a two-character ISO country code. |
| ADDRESS.VERIFICATION.NOT_FOUND | The address could not be found. |
| ADDRESS.VERIFICATION.FAILURE | The address could not be verified. |
| ADDRESS.VERIFICATION.INVALID | One or more requested verification types are invalid. |
| ADDRESS.VERIFY.FAILURE | The address could not be verified. |
| ADDRESS.VERIFY.UNAVAILABLE | Address verification is temporarily unavailable. Retry the request. |
| ADDRESS.VERIFY.CARRIER_INVALID | The address could not be verified using the specified carrier. |
| ADDRESS.VERIFY.UPSTREAM_UNAVAILABLE | Address verification is unavailable because an upstream service did not respond. Retry the request. |
| ADDRESS.VERIFY.ONLY_US | USPS address verification supports US addresses only. |
| ADDRESS.VERIFY.INTL_NOT_ENABLED | International address verification is not enabled for the account. Contact EasyPost Support to request access. |
| ADDRESS.VERIFY.MISSING_STREET | A street address is required for address verification. |
| ADDRESS.VERIFY.MISSING_CITY_STATE_ZIP | A city and state or a ZIP code is required for address verification. |
Code | Description |
|---|---|
| E.COUNTRY.UNSUPPORTED | The country is not supported in the current mode. Use production mode. |
| E.ENGINE.UNAVAILABLE | No address verification engine is currently available for this country. Retry the request later. |
| E.QUERY.UNANSWERABLE | Insufficient address data is available for this country to complete the verification. Retry the request later. |
| E.ADDRESS.NOT_FOUND | The address could not be found. |
| E.SECONDARY_INFORMATION.INVALID | The secondary address information, such as an apartment or suite number, is invalid. This error may also appear on a successful verification. |
| E.SECONDARY_INFORMATION.MISSING | Secondary address information, such as an apartment or suite number, is required. This error may also appear on a successful verification. |
| E.HOUSE_NUMBER.MISSING | The house number is missing. |
| E.HOUSE_NUMBER.INVALID | The house number is invalid. |
| E.STREET.MISSING | The street is missing. |
| E.STREET.INVALID | The street is invalid. |
| E.BOX_NUMBER.MISSING | The box number is missing. |
| E.BOX_NUMBER.INVALID | The box number is invalid. |
| E.ADDRESS.INVALID | The city, state, or ZIP code is invalid. |
| E.ZIP.NOT_FOUND | The ZIP code could not be found. |
| E.ZIP.INVALID | The ZIP code is invalid. |
| E.ZIP.PLUS4.NOT_FOUND | The ZIP+4 code could not be found. |
| E.ADDRESS.MULTIPLE | Multiple addresses were found for the provided ZIP code. |
| E.ADDRESS.INSUFFICIENT | The address information is incomplete or incorrect. |
| E.ADDRESS.DUAL | The address contains conflicting street and PO Box information. |
| E.STREET.MAGNET | Multiple possible street matches were found for the address. |
| E.CITY_STATE.INVALID | The city and state combination could not be verified. |
| E.STATE.INVALID | The state is invalid. |
| E.ADDRESS.DELIVERY.INVALID | The delivery address is invalid. |
| E.TIMED_OUT | The address verification request timed out. |
| E.TIME_ZONE.UNAVAILABLE | The time zone service is currently unavailable. |
| E.PO_BOX.INTERNATIONAL | International PO Box addresses cannot be verified. This error may also appear on a successful verification. |
Code | Description |
|---|---|
| BATCH.FILE_FORMAT.INVALID | The 'file_format' parameter is invalid. |
| BATCH.SHIPMENT.TOO_LARGE | The Batch contains too many Shipments. For best performance, keep each Batch under 1,000 Shipments. |
| BATCH.SHIPMENT.MISSING | At least one Shipment is required to perform this operation. |
| BATCH.SHIPMENTS.REQUIRED | The 'shipments' parameter is required. |
| BATCH.STATE.CREATING | The Batch cannot be modified while it is being created. |
| BATCH.STATE.CREATION_FAILED | One or more Shipments in the Batch could not be created. |
| BATCH.STATE.ALREADY_PURCHASED | The Batch has already been purchased or a purchase is in progress. Retry if the current purchase fails. |
| BATCH.STATE.NOT_PURCHASED | One or more Shipments in the Batch do not have purchased postage. |
| BATCH.PARAMS.INVALID | One or more parameters provided for the Batch are invalid. |
Code | Description |
|---|---|
| BANK_ACCOUNT.CHARGE.FAILURE | The bank account charge could not be created. |
| BANK_ACCOUNT.VERIFY.FAILURE | The bank account could not be verified. |
| CREDIT_CARD.CHARGE.FAILURE | The credit card charge could not be created. |
| CREDIT_CARD.INVALID | The card could not be connected to the payment processor. Retry the request. |
Code | Description |
|---|---|
| CARRIER_ACCOUNT.REGISTRATION.FAILED | The UPS Access License Request could not be completed. |
| CARRIER_ACCOUNT.PARAMETERS.INVALID | The top-level 'carrier_account' parameter is required. |
| CARRIER_ACCOUNT.INVALID | The CarrierAccount contains invalid data and could not be saved. |
| CARRIER_ACCOUNT.TYPE.EXISTS | A CarrierAccount of the specified type already exists. |
| CARRIER_ACCOUNT.TYPE.UNKNOWN | The specified CarrierAccount type is not recognized. |
Code | Description |
|---|---|
| DHLGM.RATE_TABLE.NOT_FOUND | The DHL eCommerce rate table was not found. |
| DHLGM.SCAN_FORM.GENERATION_FAILED | The DHL eCommerce closeout could not be generated. Retry the request or contact support@easypost.com if the error continues. |
| DHLGM.RETURN.AUTHORIZATION_NUMBER_REQUIRED | A return authorization number is required in the Shipment 'print_custom_1' option. |
| DHLGM.LABEL.FAILURE | The DHL eCommerce shipping label could not be generated. Retry the request or contact support@easypost.com if the error continues. |
| DHLGM.NO_INTERNATIONAL | DHL eCommerce does not support international Shipments for this service. |
| DHLGM.NO_ALCOHOL | DHL eCommerce does not permit alcohol shipments. |
| DHLGM.GIRTH_MAX | The Parcel exceeds the maximum permitted girth of 84. |
| DHLGM.LETTER_NOT_SUPPORTED | DHL eCommerce does not support domestic letter mail. Use an eligible USPS service instead. |
| DHLGM.ACCESS_TOKEN.GENERATION_FAILED | The DHL eCommerce access token could not be generated. Retry the request or contact support@easypost.com if the error continues. |
Code | Description |
|---|---|
| CONTAINER.TYPE.INVALID | The specified container 'type' is not supported. |
| CONTAINER.DIMENSION.REQUIRED | When one container dimension is provided, 'length', 'width', and 'height' are all required. |
| CONTAINER.NAME.REQUIRED | The container 'name' parameter is required. |
| PARCEL.PREDEFINED_PACKAGE.INVALID | The specified predefined package is not valid for the Parcel. |
| PARCEL.PARAMETERS.INVALID | One or more parameters required to create the Parcel are missing or invalid. Enter weight in ounces (oz) and dimensions in inches (in), using no more than one decimal place. |
| ITEM.WEIGHT.REQUIRED | The item 'weight' parameter is required. Enter weight in ounces (oz), using no more than one decimal place. |
| ITEM.HEIGHT.REQUIRED | The item 'height' parameter is required. Enter dimensions in inches (in), using no more than one decimal place. |
| ITEM.WIDTH.REQUIRED | The item 'width' parameter is required. Enter dimensions in inches (in), using no more than one decimal place. |
| ITEM.LENGTH.REQUIRED | The item 'length' parameter is required. Enter dimensions in inches (in), using no more than one decimal place. |
| ITEM.VALUE.REQUIRED | The item 'value' parameter is required and must be greater than zero. |
| ITEM.NAME.REQUIRED | The item 'name' parameter is required. |
Code | Description |
|---|---|
| CUSTOMS_INFO.PARAMETERS.INVALID | One or more parameters required to create the CustomsInfo are missing or invalid. |
| CUSTOMS_ITEM.ORIGIN_COUNTRY.REQUIRED | The origin country is required for each customs item. |
| CUSTOMS_ITEM.CURRENCY.ONE_CURRENCY_SUPPORTED | All customs items in a CustomsInfo object must use the same currency. The currency defaults to USD when not provided. |
| CUSTOMS_ITEM.PARAMETERS.INVALID | One or more parameters required to create the CustomsItem are missing or invalid. |
Code | Description |
|---|---|
| DOCUMENT.COMMERCIAL_INVOICE.FAILURE | The commercial invoice could not be generated for the Shipment. |
| DOCUMENT.CONVERSION.FAILURE | The document could not be converted. |
| IMAGE.CONVERSION.FAILURE | The image could not be converted. Retry the request or contact support@easypost.com if the error continues. |
| IMAGE.WIDTH.INVALID | The image width must be a multiple of eight. |
Code | Description |
|---|---|
| INSURANCE.PARAMETERS.INVALID | One or more parameters required to create the Insurance object are invalid. |
| INSURANCE.CREATE.FAILURE | The Insurance object could not be created using the provided data. |
| INSURANCE.PURCHASE.NOT_ALLOWED | The account is not permitted to purchase insurance. |
| INSURANCE.PURCHASE.FAILED | Insurance could not be purchased. Retry the request or contact support@easypost.com if the error continues. |
| INSURANCE.AMOUNT.BELOW_MINIMUM | The insurance 'amount' must be greater than zero. |
| INSURANCE.AMOUNT.REQUIRED | The insurance 'amount' parameter is required. |
| INSURANCE.AMOUNT.ABOVE_MAXIMUM | The insurance amount exceeds the maximum permitted value. |
Code | Description |
|---|---|
| ORDER.SHIPMENTS.REQUIRED | The 'shipments' parameter is required when 'containers' and 'items' are not provided. |
| ORDER.FROM_ADDRESS.REQUIRED | The 'from_address' parameter is required. |
| ORDER.TO_ADDRESS.REQUIRED | The 'to_address' parameter is required. |
| ORDER.OPTIONS.INVALID | One or more Order options are invalid. |
| ORDER.PARAMS.REQUIRED | At least one parameter is required to create an Order. |
| ORDER.INVALID | The request does not contain enough information to create the Order. |
| ORDER.RATE.UNAVAILABLE | The requested rate is not available for one or more Shipments in the Order. |
| ORDER.SERVICE.REQUIRED | The 'service' parameter is required. |
| ORDER.CARRIER.REQUIRED | The 'carrier' parameter is required. |
| ORDER.LABEL_DATE.INVALID | The 'label_date' option must be a valid ISO 8601 string or timestamp. |
| ORDER.CARRIER_ACCOUNTS.CONFLICT | Provide the applicable CarrierAccount IDs in the 'carrier_accounts' array. |
Code | Description |
|---|---|
| PICKUP.MIN_DATETIME.REQUIRED | The 'min_datetime' parameter is required. |
| PICKUP.MAX_DATETIME.REQUIRED | The 'max_datetime' parameter is required. |
| PICKUP.IS_ACCOUNT_ADDRESS.REQUIRED | The 'is_account_address' parameter is required. |
| PICKUP.ADDRESS.INVALID | The pickup Address requires valid 'street1', 'city', 'state', 'zip', 'phone', and 'name' or 'company' values. |
| PICKUP.ADDRESS.REQUIRED | The pickup 'address' parameter is required. |
| PICKUP.REQUEST.INVALID | A Batch and Shipment cannot both be supplied in the same pickup request. |
| PICKUP.REQUEST.INVALID | A Shipment or a Batch containing Shipments is required to create a Pickup. |
| PICKUP.REQUEST.INVALID | Pickup rates could not be retrieved for the request. |
| PICKUP.BATCH.INVALID | The provided Batch does not contain any Shipments. |
| PICKUP.BATCH.REQUIRED | A Batch containing at least one Shipment is required. |
| PICKUP.SHIPMENT_SERVICE.INVALID | One or more Shipments in the Batch use a service that is not valid for the Pickup. |
| PICKUP.BATCH_CARRIER.INCONSISTENT | All Shipments in the Batch must use the same carrier. |
| PICKUP.STATUS.INVALID | The Pickup cannot be modified while it is in its current status. |
| PICKUP.BUY.FAILED | The Pickup could not be scheduled. |
| PICKUP.BUY.NO_MATCHING_RATES | No pickup rates match the request. |
| PICKUP.SERVICE.REQUIRED | The pickup 'service' parameter is required. |
| PICKUP.CARRIER.REQUIRED | The pickup 'carrier' parameter is required. |
| PICKUP.SHIPMENT_COUNTRY.INVALID | One or more Shipments in the Batch have an invalid 'to_address.country' value. |
| PICKUP.BUY.FORBIDDEN | USPS Pickups cannot be purchased in test mode. |
| PICKUP.CANCEL.FAILED | The Pickup could not be cancelled. |
Code | Description |
|---|---|
| REFUND.NO_RESPONSE | The carrier did not respond to the refund request. Retry the request or contact support@easypost.com if the error continues. |
| REFUND.FAILURE | The postage refund could not be completed. |
| REFUND.TRACKING_CODES.INVALID | The 'tracking_codes' parameter is missing or invalid. |
| REFUND.TRACKING_CODE.NOT_FOUND | The tracking code was not found in the account's purchased Shipment history. |
Code | Description |
|---|---|
| SCAN_FORM.FAILURE | The ScanForm could not be generated. Retry the request or contact support@easypost.com if the error continues. |
| SCAN_FORM.BATCH.MULTIPLE_CARRIERS | All Shipments in the Batch must be purchased from the same carrier. |
| SCAN_FORM.BATCH.NOT_PURCHASED | All Shipments in the Batch must be purchased before creating a ScanForm. |
| SCAN_FORM.SHIPMENTS.INVALID | All USPS Shipments in the ScanForm must use the same 'from_address'. |
| SCAN_FORM.SHIPMENTS.REQUIRED | A valid list of Shipments is required. |
| SCAN_FORM.CREATE.CARRIER_NOT_SUPPORTED | The carrier used to purchase the Shipments does not support ScanForms. |
| SCAN_FORM.CREATE.FAILURE | The ScanForm could not be created. |
Code | Description |
|---|---|
| SHIPMENT.PURCHASE.FAILURE | The Shipment could not be purchased. Retry the request or contact support@easypost.com if the error continues. |
| SHIPMENT.OPTIONS.INVALID | One or more Shipment options are invalid. |
| SHIPMENT.INVALID_PARAMS | One or more parameters provided for the Shipment are invalid. |
| SHIPMENT.INVALID | The request does not contain enough information to create the Shipment. |
| SHIPMENT.POSTAGE.INVALID_FORMAT | The requested 'file_format' value is invalid. |
| SHIPMENT.POSTAGE.FORMAT_UNAVAILABLE | The label cannot be converted to the requested image format. |
| SHIPMENT.POSTAGE.REQUIRED | Purchased postage is required to complete this operation. |
| SHIPMENT.POSTAGE.EXISTS | Postage has already been purchased for the Shipment. |
| SHIPMENT.POSTAGE.NO_RESPONSE | The carrier did not respond to the Shipment purchase request. Retry the request or contact support@easypost.com if the error continues. |
| SHIPMENT.POSTAGE.FAILURE | The shipping label could not be generated. Retry the request or contact support@easypost.com if the error continues. |
| SHIPMENT.REFUND.UNAVAILABLE | The Shipment refund is unavailable. If the Shipment is part of an Order, refund the first Shipment in the Order. |
| SHIPMENT.REFUND.FAILURE | The Shipment refund could not be completed. Retry the request or contact support@easypost.com if the error continues. |
| SHIPMENT.CUSTOMS_INFO.DESCRIPTION_REQUIRED | Each CustomsItem must include a description. |
| SHIPMENT.CUSTOMS_INFO.REQUIRED | The 'customs_info' parameter is required for international Shipments and Shipments to US military addresses or US territories. |
| SHIPMENT.POSTAGE.TIMED_OUT | The carrier timed out while processing the Shipment purchase request. Retry the request or contact support@easypost.com if the error continues. |
| SHIPMENT.RATE.CARRIER_ACCOUNT_INVALID | The selected Rate belongs to an inactive or inaccessible CarrierAccount. Create a new Shipment or retrieve new Rates. |
| SHIPMENT.CARRIER_ACCOUNTS.CONFLICT | Provide the applicable CarrierAccount IDs in the 'carrier_accounts' array. |
| SHIPMENT.TRACKING_CODE.INVALID_CARRIER | The specified carrier is not supported for creating a Shipment from a tracking code. |
| SHIPMENT.INSURANCE.ALREADY_PURCHASED | Insurance has already been purchased for the Shipment. |
| SHIPMENT.MISSING_RATE | A valid Rate associated with the Shipment is required to purchase the Shipment. |
| SHIPMENT.MISSING_INFORMATION | A valid 'to_address', 'from_address', and 'parcel' are required to purchase the Shipment. |
| SHIPMENT.PURCHASE.IN_PROGRESS | A purchase is already in progress for the Shipment. |
| SHIPMENT.RATES.UNAVAILABLE | The Shipment does not contain enough information to retrieve Rates. |
| SHIPMENT.RATE.STAMP_UNAVAILABLE | The selected carrier and service combination does not support stamp labels. |
| SHIPMENT.RATE.BARCODE_UNAVAILABLE | The selected carrier and service combination does not support barcode labels. |
| SHIPMENT.POSTAGE.ASCII | ASCII label format is not available for production Shipments. |
| SHIPMENT_REPORT.DATE_RANGE.INVALID | The Shipment Report date range is invalid. |
| SHIPMENT_REPORT.ALREADY_IN_PROGRESS | A Shipment Report with the same parameters is already being generated. |
| SHIPMENT_REPORT.DATE_RANGE.TOO_LONG | The Shipment Report date range cannot exceed 31 days. |
Code | Description |
|---|---|
| TRACKER.RETRIEVE.ERROR | The Tracker could not be retrieved. Retry the request. |
| TRACKER.RUN.ERROR | The Tracker could not be processed. Retry the request. |
| TRACKER.CREATE.ERROR | The Tracker could not be created. Retry the request. |
| TRACKER.NOT_FOUND | The requested Tracker was not found. |
| TRACKER.INVALID_TEST_CODE | Test mode accepts only EasyPost test tracking codes from 'EZ1000000001' through 'EZ7000000007'. |
| TRACKER.NO_CARRIER_ACCOUNT | The account does not have the required CarrierAccount for the specified carrier. |
| TRACKER.INVALID_PARAMS | One or more Tracker parameters are invalid. |
| TRACKER.UNSUPPORTED_CARRIER | The specified carrier is not supported or was entered incorrectly. |
| TRACKER.CARRIER_CODE_MISMATCH | The tracking code does not belong to the specified carrier. |
| TRACKER.MULTIPLE_CARRIERS_FOR_CODE | The tracking code may belong to multiple carriers. Specify the carrier when creating the Tracker. |
| TRACKER.NO_CARRIER_FOR_CODE | The tracking code does not match a supported carrier format. |
Code | Description |
|---|---|
| USER.UNAUTHORIZED | The authenticated user does not have permission to access the resource. |
| USER.INVALID | The User contains invalid data and could not be saved. |
| USER.PARENT.INVALID | A child account cannot be added beneath another child account. |
| USER.CHARGE.NOT_ALLOWED | One-time charges are not enabled for the account. Contact support@easypost.com to request approval. |
Code | Description |
|---|---|
| WEBHOOK.EVENT.INVALID | The received webhook event type could not be mapped to a handler. |
| WEBHOOK.INVALID | The Webhook contains invalid data and could not be saved. |
Visit the EasyPost Help Center for FAQs, troubleshooting guidance, and additional support resources.