Download OpenAPI specification:Download
The Stamps.com/Endicia REST API (SERA) is the quickest and most convenient way to build a custom carrier-integrated shipping solution. If you run into any problems or have any questions along the way, contact the Stamps.com developer support team at [email protected]. Include your username, if you know it, and as much detail as possible to assist us in helping you. The fastest way for us to be able to help is by sending us a copy of the API request and response in question.
On July 9, 2023, USPS is introducing a new ground-based package service: USPS Ground Advantage. This service replaces USPS First-Class Package Service, Parcel Select Ground, and Retail Ground. First-Class Mail Letters and Large Envelopes/Flats will continue to be available.
Description of Change | Endpoints and Methods Impacted |
---|---|
usps_ground_advantage added to service_type enumeration for the new USPS Ground Advantage Service |
POST /v1/rates POST /v1/labels |
USPS is replacing the First-Class Package Service, Parcel Select Ground, and Retail Ground services with USPS Ground Advantage. Ground Advantage delivers packages within the Continental United States in 2-5 business days with free included tracking and $100 of USPS insurance for packages between 0 and 70 lbs.
USPS Ground Advantage is available as service_type usps_ground_advantage
. For our customers' and partners' convenience, we will temporarily map requests for discontinued USPS package services to the new USPS Ground Advantage service. For example, after July 9, 2023, a POST /v1/labels
request for service_type usps_first_class_mail
and packaging_type package
will return a USPS Ground Advantage label instead of a First-Class Package Service label.
Integrators are encouraged to call for USPS Ground Advantage directly with the service_type usps_ground_advantage
. In the future we will communicate a date when this update will become mandatory.
SERA is a REST (REpresentational State Transfer) API, which means that it follows certain HTTP conventions for things like URLs, methods, headers, and status codes. If you’d like more information, click here.
The staging environment allows you to develop SERA integrations without using real funds to create test labels. There are no service or transaction fees charged for staging accounts and labels. Labels created in the staging environment cannot be used to ship and must be destroyed if printed. Access to the staging environment is available once you register for a Stamps.com developer account.
Note that shipping rates in the staging environment may vary from production and should not be relied on. Other services in staging, such as tracking and pickups, do not reflect any real-world data.
The production environment allows you to take your SERA integration live and rate-shop across multiple carriers, create real shipping labels, schedule pickups, track in-transit shipments, and more.
Staging: https://signin.testing.stampsendicia.com
Production: https://signin.stampsendicia.com
Staging: https://api.testing.stampsendicia.com/sera
Production: https://api.stampsendicia.com/sera
All Endpoint URLs given in this document are relative to the specific environment host you are connecting to. For example, to add funds to an account in the staging environment, POST the request to https://api.testing.stampsendicia.com/sera/v1/balance/add-funds. To do the same in the production environment, POST the request to https://api.stampsendicia.com/sera/v1/balance/add-funds.
All SERA requests must be made over HTTPS using TLS v1.2+. Calls made over plain-text HTTP or with an obsolete TLS version will fail.
Because the internet is not a guaranteed service, sometimes network messages (like REST API requests and responses) get lost in transit and are not received. If this happens, it’s usually impossible to know if the request was received and processed successfully, or if not, should be sent again and possibly duplicated. To guard against cases like this, be sure to include a unique Idempotency-key
value in the request header when calling any SERA endpoint with the POST method.
Whenever any request does not get a response within a reasonable timeout period, simply send it again with the same Idempotency-key
value. If SERA already processed a request within the past 24 hours with the same Idempotency-key, it will replay the same response without duplicating the transaction. If the key is new, SERA will process the request as normal.
Idempotency-key
s must be a randomly-generated version-4 UUID. Most programming languages support generating random UUIDs out-of-the-box. If an invalid Idempotency-key
is included with an request, an error will be returned.
Every SERA endpoint contains a version number in the URL. For example, to add funds to an account, call POST /v1/balance/add-funds
. New versions are created to avoid impacting existing integrations when backwards-incompatible changes are introduced to SERA. Integrators are not required to upgrade versions to maintain existing functionality but may be required to upgrade to gain access to new features as they’re introduced.
In order to access SERA, integrations must call the API with a valid access token. Access tokens can be generated with a valid authorization code from a user's login event or with an refresh token from an earlier login. The endpoints below detail how to login to receive an authorization code and how to turn that code into a valid set of access and refresh tokens.
Security Scheme Type | OAuth2 |
---|---|
authorizationCode OAuth Flow | Authorization URL: https://signin.stampsendicia.com/authorize Token URL: https://signin.stampsendicia.com/oauth/token Refresh URL: https://signin.stampsendicia.com/oauth/token |
Security Scheme Type | OAuth2 |
---|---|
authorizationCode OAuth Flow | Authorization URL: https://signin.testing.stampsendicia.com/authorize Refresh URL: https://signin.testing.stampsendicia.com/oauth/token |
Integrators call this endpoint with a valid authorization code
or refresh_token
and use the access_token
from the response to access SERA.
grant_type required | string Value: "authorization_code" Grant TypeMust set to |
client_id required | string Client ID |
client_secret | string Client Secret |
code | string Authorization Code |
redirect_uri | string Redirect URI |
{- "grant_type": "refresh_token",
- "client_id": "string",
- "client_secret": "string",
- "refresh_token": "string"
}
{- "access_token": "string",
- "refresh_token": "string",
- "id_token": "string",
- "token_type": "string",
- "expires_in": "string"
}
SERA labels and services are paid for with an account balance. Funds are added to the account balance from the account’s default payment method, while transaction amounts for labels and services are deducted from the account balance. While most customers utilize credit cards to fund their accounts balances, we do offer alternative payment methods such as ACH on request.
Most labels are deducted from the account balance at time of print. We also offer Pay-On-Use services (e.g. USPS Returns) that deduct from the account balance when the label is shipped instead of when it is created. New accounts are limited to a maximum balance of $500 which can be adjusted by contacting our customer care team.
This endpoint will return account information associated with the active user account.
{- "account": {
- "customer_id": 0,
- "user_id": 0,
- "account_id": 0,
- "corporation_id": 0,
- "account_status": "admin_hold",
- "gmt_offset_minutes": "string",
- "daylight_savings_time": true,
- "meter_details": {
- "meter_number": 0,
- "meter_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "meter_provider": "string"
}, - "terms": {
- "gp": true,
- "ar": true,
- "sl": true,
- "dx": true,
- "fx": true,
- "ups": true,
- "cp": true,
- "pg": true
}, - "customer_details": {
- "username": "string",
- "verification_phone_number": "string",
- "verification_phone_extension": "string",
- "address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "creation_date": "2019-08-24",
- "per_print_limit": 0,
- "max_image_count": 0
}, - "capabilities": [
- "auto_pickup_usps"
], - "plan_details": {
- "plan_id": "string",
- "pending_plan_id": "string",
- "cost_code_limit": 0,
- "max_users": 0
}, - "globalpost": {
- "first_mile_carrier": "none"
}, - "pay_on_use_details": {
- "outstanding_label_balance": 0,
- "max_outstanding_label_balance": 0
}, - "configured_carriers": [
- {
- "carrier": "usps",
- "customer_owned_account": true
}
], - "date_advance": {
- "max_date_advance_envelope": 0,
- "max_date_advance_mailing_label": 0,
- "max_date_advance_shipping_label": 0
}, - "internal_account_details": {
- "usps_rep": true,
- "merchant": "stamps",
- "endicia_ported_user": true,
- "balance_id": "string",
- "rateset_type": "string",
- "rateset_id": "string",
- "internal_capabilities": [
- "purchase_usps_insurance"
], - "rate_token": "string",
- "customer_data": "string",
- "resubmit": {
- "status": "not_in_resubmission",
- "cookie": "string"
}
}
}
}
The current account balance can be checked by calling this endpoint with no request body. The response will contain the account’s current balance.
{- "amount_available": 0,
- "max_balance_amount_allowed": 0,
- "currency": "usd"
}
To add funds to the account balance, call this endpoint with the amount you wish to add in the request body. A successful response will contain the current balance on the account.
In the SERA production environment, adding funds to the account balance will charge the account’s default payment method. In contrast, funds added in the SERA staging environment will not cost anything; staging account balances are funded with "play money."
amount | number Amount |
currency | string Default: "usd" Currency |
{- "amount": 0,
- "currency": "usd"
}
{- "amount_available": 0,
- "max_balance_amount_allowed": 0,
- "currency": "usd"
}
There are several account management operations that are available to Stamps.com/Endicia users. Rather than duplicate that functionality in the form of API access, creating an additional burden on integrators to create the interface for it, SERA allows the integrator to obtain the URL of Stamps.com/Endicia-hosted web pages to perform these operations. Call this endpoint with a specific url_type
query parameter to receive the URL of the hosted page.
The URLs returned from this endpoint are specific to the user and session, allowing the web interface to display information tailored for the user without requiring the user to re-authenticate. The URL is only valid for one request, so the URL should be immediately navigated to in a browser and not stored by the integration.
URLs to the following Stamps.com web pages are available through this web method: Home, Account Settings, Edit Cost Codes, Online Reports, and Help.
Through special arrangement, the Stamps.com/Endicia-hosted pages may be co-branded for the integrator. When this is done, an optional query parameter, application_context
, may be included to customize the appearance and behavior of the hosted web page.
url_type required | string Enum: "home_page" "account_settings_page" "edit_cost_codes_page" "online_reports_page" "help_page" "online_reporting_history" "online_reporting_refund" "online_reporting_pickup" "online_reporting_scan" "online_reporting_claim" "store_change_plan" "web_client_home" "reports_balances" "reports_expenses" "reports_prints" "store_buy_postage" "store_meters" "store_users" "store_payment_methods" "store_corp_contact_info" "store_meter_users" "store_meter_settings" "store_meter_address" "store_shipping_addresses" "store_refer_a_friend" "store_account_credit" "store_reorder" "store_my_profile" "store_password" "store_comm_preferences" "store_netstamps_labels" "store_shipping_labels" "store_mailing_labels" "store_scales_and_printers" "store_free_usps_supplies" "store_bubble_mailers" "store_shipping_supplies" "store_scales" "store_avery_net_stamps_labels" "store_avery_mailing_labels" "store_meter_contact_info" "store_edit_meter_address" "store_home" "store_account" "store_cost_code" "store_history" "store_faq" "store_customer_home" "store_get_account_info_json" "store_set_account_info_json" "store_user_categories" "store_category" "store_update_payment_method_resubmit" "store_default_payment_methods" "store_sign_out" "custom_ship_notify_email" "help_center_home" "must_change_password" "contacts" "web_client_preferences" "web_client_default" "store_auto_buy" "set_terms_general" "upload_image" "endicia_login" "phone_verification" "carrier_setup_dhl_express" "carrier_setup_ups" "carrier_management" "store_order_history" "store_subscriptions" "store_hardware" "store_envelopes" "store_labels" "store_clear_netstamps" "store_original_netstamps" "store_netstamps" "store_sign_in" "add_payment" "carrier_setup_fedex" "parcelguard" "branded_tracking" "rate_advisor" "parcelguard_claim" "parcelguard_claim_status" URL Type |
application_context | string Application Context |
{
}
Call this endpoint to set security questions for an account that doesn't have them. Call GET /v1/security_questions
to see the full list of available security questions.
security_question1_type required | string |
security_question1_value required | string [ 2 .. 33 ] characters |
security_question2_type required | string |
security_question2_value required | string [ 2 .. 33 ] characters |
{- "security_question1_type": "string",
- "security_question1_value": "string",
- "security_question2_type": "string",
- "security_question2_value": "string"
}
Call this to see the full list of available security questions. To set security questions for an account that does not have them, call PUT /v1/account/security_questions
[- {
- "security_question": "string",
- "security_question_type": "string"
}
]
Rates contains all of a single shipment’s details, from origin and destination addresses to weight, carrier, and service options. Users can search for and compare different rates with calls to this SERA endpoint. In order to create a shipping label, a specific rate should be selected from the numerous available options and combinations.
This endpoint optionally accepts details about the shipment to narrow down the available rates. If available, add information such as the To
and From
addresses (or even just ZIP codes), along with package weight, type, and dimensions to the request body to receive a list of rates filtered for those attributes.
When searching for a specific rate, try to include as much information as possible in the initial request to receive a list of available rates more closely filtered to what is needed. If looking for a broad list of rates (for example, to populate a selection dialog), omit specific package information to receive an unfiltered list of available rates.
Using the response, it is up to the user or integration’s logic to select the desired rate. Once selected, the integration can use those rate details when creating a label. Rates will vary by carrier_code
and service_code
(such as "usps_priority_mail" for USPS Priority Mail) and may be further customized with any available advanced_options
(such as Signature Confirmation or Insurance).
While testing, feel free to modify the example request to reflect various specific shipment details. Also, be sure to update the ship_date
to a date that is not in the past or an error will be returned.
carriers | string Enum: "usps" "globalpost" "ups" "fedex" "dhl_express" "canada_post" |
object (address) | |
object (address) | |
service_type | string Enum: "usps_first_class_mail" "usps_ground_advantage" "usps_priority_mail" "usps_priority_mail_express" "usps_parcel_select" "usps_media_mail" "usps_first_class_mail_international" "usps_priority_mail_international" "usps_priority_mail_express_international" "usps_pay_on_use_return" "globalpost_first_class_smartsaver" "globalpost_parcel_select_smartsaver" "globalpost_economy_international" "globalpost_economy_international_smartsaver" "globalpost_standard_international" "globalpost_standard_international_smartsaver" "globalpost_plus" "globalpost_plus_smartsaver" "globalpost_first_class_international" "globalpost_first_class_international_smartsaver" "globalpost_priority_mail_international" "globalpost_priority_mail__international_smartsaver" "globalpost_priority_mail_express_international" "globalpost_ priority_mail_express_international_smartsaver" "ups_next_day_air_early" "ups_next_day_air" "ups_next_day_air_saver" "ups_2nd_day_air_am" "ups_2nd_day_air" "ups_3_day_select" "ups_ground" "ups_standard" "ups_worldwide_express" "ups_worldwide_express_plus" "ups_worldwide_expedited" "ups_worldwide_saver" "fedex_first_overnight" "fedex_priority_overnight" "fedex_standard_overnight" "fedex_2day_am" "fedex_2day" "fedex_express_saver" "fedex_ground" "fedex_home_delivery" "fedex_international_first" "fedex_international_priority" "fedex_international_economy" "fedex_international_ground" "dhl_express_worldwide" "canada_post_regular_parcel" "canada_post_xpresspost" "canada_post_priority" "canada_post_expedited_parcel" "canada_post_small_packet_air_usa" "canada_post_tracked_packet_usa" "canada_post_expedited_parcel_usa" "canada_post_xpresspost_usa" "canada_post_priority_worldwide_usa" "canada_post_small_packet_international_surface" "canada_post_small_packet_international_air" "canada_post_international_parcel_surface" "canada_post_international_parcel_air" "canada_post_tracked_packet_international" "canada_post_xpresspost_international" "canada_post_priority_worldwide_international" Service Type |
object (package) Package | |
delivery_confirmation_type | string Enum: "none" "tracking" "signature" "adult_signature" "direct_signature" "delivery_confirmation_mailed" Delivery Confirmation Type |
object Insurance | |
object (customs) Customs Form | |
ship_date | string Ship Date |
is_return_label | boolean Is Return Label |
object (advanced_options) |
{- "from_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "to_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "service_type": "usps_first_class_mail",
- "package": {
- "packaging_type": "large_envelope",
- "weight": 0,
- "weight_unit": "ounce",
- "length": 0,
- "width": 0,
- "height": 0,
- "dimension_unit": "inch"
}, - "delivery_confirmation_type": "none",
- "insurance": {
- "insurance_provider": "stamps_com",
- "insured_value": {
- "amount": 0,
- "currency": "usd"
}
}, - "customs": {
- "contents_type": "gift",
- "contents_description": "string",
- "non_delivery_option": "treat_as_abandoned",
- "sender_info": {
- "license_number": "string",
- "certificate_number": "string",
- "invoice_number": "string",
- "internal_transaction_number": "string",
- "passport_number": "string",
- "passport_issue_date": "string",
- "passport_expiration_date": "string"
}, - "recipient_info": {
- "tax_id": "string"
}, - "customs_items": [
- {
- "item_description": "string",
- "quantity": 0,
- "unit_value": {
- "amount": 0,
- "currency": "usd"
}, - "item_weight": 0,
- "weight_unit": "ounce",
- "harmonized_tariff_code": "string",
- "country_of_origin": "string",
- "sku": "string"
}
]
}, - "ship_date": "string",
- "is_return_label": true,
- "advanced_options": {
- "non_machinable": true,
- "saturday_delivery": true,
- "delivered_duty_paid": true,
- "hold_for_pickup": true,
- "certified_mail": true,
- "return_receipt": true,
- "return_receipt_electronic": true,
- "collect_on_delivery": {
- "amount": 0,
- "currency": "usd"
}, - "registered_mail": {
- "amount": 0,
- "currency": "usd"
}, - "sunday_delivery": true,
- "holiday_delivery": true,
- "restricted_delivery": true,
- "notice_of_non_delivery": true,
- "special_handling": {
- "special_contents_type": "hazardous_materials",
- "fragile": true
}, - "no_label": {
- "is_drop_off": true,
- "is_prepackaged": true
}, - "is_pay_on_use": true,
- "return_options": {
- "outbound_label_id": "string"
}
}
}
[- {
- "carrier": "usps",
- "service_type": "usps_first_class_mail",
- "packaging_type": "large_envelope",
- "estimated_delivery_days": "string",
- "estimated_delivery_date": "string",
- "is_guaranteed_service": true,
- "trackable": "yes",
- "is_return_label": true,
- "is_customs_required": true,
- "shipment_cost": {
- "total_amount": 0,
- "currency": "usd",
- "cost_details": [
- {
- "fee_code": "string",
- "fee_type": "service",
- "amount": 0
}
]
}
}
]
Once a specific rate is selected as described in View Shipping Rates, include the rate details in a request to this endpoint to purchase the shipping label.
For most labels, the rate amount will be deducted from the account balance when the label is created with this step. Be sure to have sufficient account balance for this before requesting the label or an error will be generated.
object (address) | |
object (address) | |
object (address) | |
service_type | string Enum: "usps_first_class_mail" "usps_ground_advantage" "usps_priority_mail" "usps_priority_mail_express" "usps_parcel_select" "usps_media_mail" "usps_first_class_mail_international" "usps_priority_mail_international" "usps_priority_mail_express_international" "usps_pay_on_use_return" "globalpost_first_class_smartsaver" "globalpost_parcel_select_smartsaver" "globalpost_economy_international" "globalpost_economy_international_smartsaver" "globalpost_standard_international" "globalpost_standard_international_smartsaver" "globalpost_plus" "globalpost_plus_smartsaver" "globalpost_first_class_international" "globalpost_first_class_international_smartsaver" "globalpost_priority_mail_international" "globalpost_priority_mail__international_smartsaver" "globalpost_priority_mail_express_international" "globalpost_ priority_mail_express_international_smartsaver" "ups_next_day_air_early" "ups_next_day_air" "ups_next_day_air_saver" "ups_2nd_day_air_am" "ups_2nd_day_air" "ups_3_day_select" "ups_ground" "ups_standard" "ups_worldwide_express" "ups_worldwide_express_plus" "ups_worldwide_expedited" "ups_worldwide_saver" "fedex_first_overnight" "fedex_priority_overnight" "fedex_standard_overnight" "fedex_2day_am" "fedex_2day" "fedex_express_saver" "fedex_ground" "fedex_home_delivery" "fedex_international_first" "fedex_international_priority" "fedex_international_economy" "fedex_international_ground" "dhl_express_worldwide" "canada_post_regular_parcel" "canada_post_xpresspost" "canada_post_priority" "canada_post_expedited_parcel" "canada_post_small_packet_air_usa" "canada_post_tracked_packet_usa" "canada_post_expedited_parcel_usa" "canada_post_xpresspost_usa" "canada_post_priority_worldwide_usa" "canada_post_small_packet_international_surface" "canada_post_small_packet_international_air" "canada_post_international_parcel_surface" "canada_post_international_parcel_air" "canada_post_tracked_packet_international" "canada_post_xpresspost_international" "canada_post_priority_worldwide_international" Service Type |
object (package) Package | |
delivery_confirmation_type | string Enum: "none" "tracking" "signature" "adult_signature" "direct_signature" "delivery_confirmation_mailed" Delivery Confirmation Type |
object | |
object (customs) Customs Form | |
ship_date | string Ship Date |
is_return_label | boolean Is Return Label |
object (advanced_options) | |
object (label_options) Label Options | |
object Email Label | |
object | |
object | |
is_test_label | boolean Default: false Is Test Label |
{- "from_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "return_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "to_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}, - "service_type": "usps_first_class_mail",
- "package": {
- "packaging_type": "large_envelope",
- "weight": 0,
- "weight_unit": "ounce",
- "length": 0,
- "width": 0,
- "height": 0,
- "dimension_unit": "inch"
}, - "delivery_confirmation_type": "none",
- "insurance": {
- "insurance_provider": "stamps_com",
- "insured_value": {
- "amount": 0,
- "currency": "usd"
}
}, - "customs": {
- "contents_type": "gift",
- "contents_description": "string",
- "non_delivery_option": "treat_as_abandoned",
- "sender_info": {
- "license_number": "string",
- "certificate_number": "string",
- "invoice_number": "string",
- "internal_transaction_number": "string",
- "passport_number": "string",
- "passport_issue_date": "string",
- "passport_expiration_date": "string"
}, - "recipient_info": {
- "tax_id": "string"
}, - "customs_items": [
- {
- "item_description": "string",
- "quantity": 0,
- "unit_value": {
- "amount": 0,
- "currency": "usd"
}, - "item_weight": 0,
- "weight_unit": "ounce",
- "harmonized_tariff_code": "string",
- "country_of_origin": "string",
- "sku": "string"
}
]
}, - "ship_date": "string",
- "is_return_label": true,
- "advanced_options": {
- "non_machinable": true,
- "saturday_delivery": true,
- "delivered_duty_paid": true,
- "hold_for_pickup": true,
- "certified_mail": true,
- "return_receipt": true,
- "return_receipt_electronic": true,
- "collect_on_delivery": {
- "amount": 0,
- "currency": "usd"
}, - "registered_mail": {
- "amount": 0,
- "currency": "usd"
}, - "sunday_delivery": true,
- "holiday_delivery": true,
- "restricted_delivery": true,
- "notice_of_non_delivery": true,
- "special_handling": {
- "special_contents_type": "hazardous_materials",
- "fragile": true
}, - "no_label": {
- "is_drop_off": true,
- "is_prepackaged": true
}, - "is_pay_on_use": true,
- "return_options": {
- "outbound_label_id": "string"
}
}, - "label_options": {
- "label_size": "4x6",
- "label_format": "png",
- "label_logo_image_id": 0,
- "label_output_type": "url"
}, - "email_label": {
- "email": "string",
- "email_notes": "string",
- "bcc_email": "string"
}, - "references": {
- "printed_message1": "string",
- "printed_message2": "string",
- "printed_message3": "string",
- "cost_code_id": 0,
- "reference1": "string",
- "reference2": "string",
- "reference3": "string",
- "reference4": "string"
}, - "order_details": {
- "order_source": "string",
- "order_number": "string",
- "items_ordered": [
- {
- "item_name": "string",
- "quantity": 0,
- "image_url": "string",
- "item_options": [
- {
- "attribute": "string",
- "value": "string"
}
]
}
]
}, - "is_test_label": false
}
{- "label_id": "string",
- "tracking_number": "string",
- "carrier": "usps",
- "service_type": "usps_first_class_mail",
- "packaging_type": "large_envelope",
- "estimated_delivery_days": "string",
- "estimated_delivery_date": "string",
- "is_guaranteed_service": true,
- "trackable": "yes",
- "is_return_label": true,
- "is_gap": true,
- "is_smartsaver": true,
- "is_etoe": true,
- "shipment_cost": {
- "total_amount": 0,
- "currency": "usd",
- "cost_details": [
- {
- "fee_code": "string",
- "fee_type": "service",
- "amount": 0
}
]
}, - "account_balance": {
- "amount_available": 0,
- "max_balance_amount_allowed": 0,
- "currency": "usd"
}, - "labels": [
- {
- "href": "string"
}
], - "forms": [
- {
- "href": "string"
}
]
}
Users must void unused prepaid labels to request a refund. The carrier may need to verify the label was not used in order to authorize a refund. As a result, it may take 2–3 weeks to approve a refund request once submitted.
To request a refund, call this endpoint with a valid label_id
(as returned in the original label's response) in the URL to identify the label to cancel. Pay-On-Use labels are not eligible to be voided.
label_id required | string |
To help improve package deliverability, it is best practice to fully validate all addresses used while shipping. While it’s not required that users ship to fully-validated addresses, it is required that users ship to addresses with at least partial validation: a validated city, state, and postal code are required when shipping domestically.
Occasionally, if SERA cannot automatically validate an address while creating a shipping label, the integration may need to explicitly request address validation. To do this, submit the address to this endpoint.
In the response, SERA will return the address validation status along with any applicable candidate addresses. The user or application should review the candidate addresses and select one for use in shipping if it is correct.
company_name | string Company Name |
name | string Full Name |
address_line1 | string Address Line 1 |
address_line2 | string Address Line 2 |
address_line3 | string Address Line 3 |
city | string City |
state_province | string State/Province |
postal_code | string Postal/ZIP Code |
country_code | string = 2 characters Country Code |
phone | string Phone Number |
string Email Address | |
residential_indicator | string Residential Indicator |
formatted_address | string Formatted Address |
[- {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string",
- "formatted_address": "string"
}
]
[- {
- "original_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string",
- "formatted_address": "string"
}, - "matched_address": {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string",
- "formatted_address": "string"
}, - "candidate_addresses": [
- {
- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string",
- "formatted_address": "string"
}
], - "is_po_box": true,
- "is_apo_fpo": true,
- "validation_results": {
- "result_code": "string",
- "result_description": "string",
- "result_details": [
- {
- "detail_code": "string",
- "detail_description": "string"
}
]
}
}
]
Call this endpoint with an existing label_id
to request the label image or data of a previously-created label. This will allow for an application to implement reprint functionality. Users are allowed to specify new label options to make non-material modifications to the reprinted label.
Note users are only allowed to reprint labels originally printed from their user account.
label_id required | string Label ID |
label_size | string Enum: "4x6" "letter" Label Size |
label_format | string Enum: "png" "pdf" "zpl" "zpl_ascii" Label Format |
label_output_type | string Enum: "url" "base64" Label Output Type |
{- "labels": [
- {
- "href": "string"
}
], - "forms": [
- {
- "href": "string"
}
]
}
Depending on the carrier, a printed manifest (also called a SCAN form for USPS) may be needed when shipping multiple packages at once. Users can generate a manifest one of two ways:
from_address
and ship_date
. SERA will collect any matching prints to generate a manifest for.label_ids
to generate a manifest for.The response will contain URLs for printable manifests in the requested format.
object (address) | |
carrier | string Enum: "usps" "globalpost" "ups" "fedex" "dhl_express" "canada_post" Carrier |
ship_date | string Ship Date to create a manifest for |
object (manifest_label_options) |
{- "label_ids": [
- "string"
], - "label_options": {
- "label_format": "png",
- "print_instructions": true
}
}
{- "manifest_id": "string",
- "carrier": "usps",
- "ship_date": "string",
- "number_of_items_in_manifest": 0,
- "labels": [
- {
- "href": "string"
}
]
}
Carrier pickups can be scheduled by calling this endpoint with a carrier_code
and a preferred pickup time.
The response will contain pickup_window
information along with information about the pickup request.
object (address) | |
carrier | string Enum: "usps" "globalpost" "ups" "fedex" "dhl_express" "canada_post" Carrier |
object Pickup Window | |
pickup_instructions | string Pickup Instructions |
{- "label_ids": [
- "string"
], - "pickup_window": {
- "start_at": "2019-08-24T14:15:22Z",
- "end_at": "2019-08-24T14:15:22Z"
}, - "pickup_instructions": "Knock on door"
}
{- "pickup_id": "string",
- "carrier": "usps",
- "pickup_window": {
- "start_at": "string",
- "end_at": "string"
}, - "number_of_items_in_pickup": 0,
- "estimated_cost": {
- "amount": 0,
- "currency": "usd"
}
}
After shipping a package, most integrators also need to periodically check on the status of a package. This endpoint retrieves and returns standardized tracking events for a given shipment. Include a valid carrier_code
and tracking_number
in the request’s query string to select the appropriate shipment.
The response will consist of the shipment’s current status and a full array of tracking_event
s with timestamps for each event. Because SERA standardizes carrier tracking for our supported carriers, integrators do not need to do any extra work to retrieve or interpret tracking status information on a carrier-by-carrier basis.
carrier | string |
tracking_number | string |
{- "tracking_number": "string",
- "carrier_name": "string",
- "status_code": "accepted",
- "carrier_status_description": "string",
- "estimated_delivery_date": "string",
- "destination": {
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "string"
}, - "tracking_events": [
- {
- "occurred_at": "string",
- "event_description": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "string",
- "signed_by": "string",
- "carrier_status_code": "string"
}
]
}
Depending on the carrier and types of packages, a container label may be needed when shipping multiple packages at once in a container. Users can generate a container label two ways:
from_address
and ship_date
. SERA will collect any matching prints to generate a container label for.label_ids
to generate a container label for.object (address) | |
object (address) | |
ship_date | string |
object (container_label_options) | |
number_of_container_labels | number |
{- "label_ids": "string",
- "label_options": {
- "label_format": "png"
}, - "number_of_container_labels": 0
}
{- "container_label_id": "string",
- "tracking_numbers": [
- "string"
], - "carrier": "usps",
- "ship_date": "string",
- "number_of_items_in_container_labels": 0,
- "number_of_container_labels": 0,
- "labels": [
- {
- "href": "string"
}
]
}
As carrier service availability may vary based on user accounts, integrations may call this endpoint to receive a JSON object detailing the specific services and service limitations to present to users.
ship_date | string <date> An optional query parameter to customize the response to the services and rules available on a specific date |
{- "shipping_options": [
- {
- "carrier": "string",
- "services": [
- {
- "service_type": "string",
- "service_name": "string",
- "packaging_options": [
- {
- "packaging_type": "string",
- "packaging_name": "string",
- "content_options": [
- {
- "shipment_contents": "string",
- "rules_and_options": [
- { }
]
}
]
}
]
}
]
}
]
}
Call this endpoint to connect your existing carrier account to SERA.
carrier required | string |
user_owned_account required | boolean Default: true |
username required | string |
password required | string |
{- "user_owned_account": true,
- "username": "string",
- "password": "string"
}
company_name | string Company Name |
name | string Full Name |
address_line1 | string Address Line 1 |
address_line2 | string Address Line 2 |
address_line3 | string Address Line 3 |
city | string City |
state_province | string State/Province |
postal_code | string Postal/ZIP Code |
country_code | string = 2 characters Country Code |
phone | string Phone Number |
string Email Address | |
residential_indicator | string Residential Indicator |
{- "company_name": "string",
- "name": "string",
- "address_line1": "string",
- "address_line2": "string",
- "address_line3": "string",
- "city": "string",
- "state_province": "string",
- "postal_code": "string",
- "country_code": "st",
- "phone": "string",
- "email": "string",
- "residential_indicator": "string"
}
packaging_type | string Default: "package" Enum: "large_envelope" "package" "usps_small_flat_rate_box" "usps_medium_flat_rate_box" "usps_large_flat_rate_box" "usps_flat_rate_envelope" "usps_padded_flat_rate_envelope" "usps_legal_flat_rate_envelope" "usps_regional_rate_box_a" "usps_regional_rate_box_b" "ups_letter" "ups_pak" "ups_tube" "ups_express_box_small" "ups_express_box_medium" "ups_express_box_large" "ups_10kg_box" "ups_25kg_box" "fedex_envelope" "fedex_pak" "fedex_tube" "fedex_one_rate_envelope" "fedex_one_rate_pak" "fedex_one_rate_tube" "fedex_one_rate_small_box" "fedex_one_rate_medium_box" "fedex_one_rate_large_box" "fedex_one_rate_extra_large_box" "fedex_10kg_box" "fedex_25kg_box" "express_envelope" "canada_post_envelope" "canada_post_pak" Packaging Type |
weight | number Weight |
weight_unit | string Default: "ounce" Enum: "ounce" "pound" "gram" "kilogram" Weight Unit |
length | number Length |
width | number Width |
height | number Height |
dimension_unit | string Default: "inch" Enum: "inch" "centimeter" Dimension Unit |
{- "packaging_type": "large_envelope",
- "weight": 0,
- "weight_unit": "ounce",
- "length": 0,
- "width": 0,
- "height": 0,
- "dimension_unit": "inch"
}
label_size | string Default: "4x6" Enum: "4x6" "letter" Label Size |
label_format | string Default: "pdf" Enum: "png" "pdf" "zpl" "zpl_ascii" Label Format |
label_logo_image_id | integer |
label_output_type | string Default: "url" Enum: "url" "base64" Label Output Type |
{- "label_size": "4x6",
- "label_format": "png",
- "label_logo_image_id": 0,
- "label_output_type": "url"
}
non_machinable | boolean Non-Machinable |
saturday_delivery | boolean Saturday Delivery |
delivered_duty_paid | boolean Delivered Duty Paid |
hold_for_pickup | boolean Hold for Pickup |
certified_mail | boolean Certified Mail |
return_receipt | boolean Return Receipt (Physical) |
return_receipt_electronic | boolean Return Receipt (Electronic) |
object Collect on Delivery (COD) | |
object Registered Mail | |
sunday_delivery | boolean Sunday Delivery |
holiday_delivery | boolean Holiday Delivery |
restricted_delivery | boolean Restricted Delivery |
notice_of_non_delivery | boolean Notice of Non-Delivery |
object Special Handling | |
object No Label | |
is_pay_on_use | boolean Is Pay-On-Use |
object Return Options |
{- "non_machinable": true,
- "saturday_delivery": true,
- "delivered_duty_paid": true,
- "hold_for_pickup": true,
- "certified_mail": true,
- "return_receipt": true,
- "return_receipt_electronic": true,
- "collect_on_delivery": {
- "amount": 0,
- "currency": "usd"
}, - "registered_mail": {
- "amount": 0,
- "currency": "usd"
}, - "sunday_delivery": true,
- "holiday_delivery": true,
- "restricted_delivery": true,
- "notice_of_non_delivery": true,
- "special_handling": {
- "special_contents_type": "hazardous_materials",
- "fragile": true
}, - "no_label": {
- "is_drop_off": true,
- "is_prepackaged": true
}, - "is_pay_on_use": true,
- "return_options": {
- "outbound_label_id": "string"
}
}
contents_type | string Enum: "gift" "merchandise" "returned_goods" "documents" "sample" "other" Contents Type |
contents_description | string Contents Description |
non_delivery_option | string Enum: "treat_as_abandoned" "return_to_sender" Non-Delivery Option |
object Customs Sender Information | |
object Customs Recipient Information | |
Array of objects Customs Items Array |
{- "contents_type": "gift",
- "contents_description": "string",
- "non_delivery_option": "treat_as_abandoned",
- "sender_info": {
- "license_number": "string",
- "certificate_number": "string",
- "invoice_number": "string",
- "internal_transaction_number": "string",
- "passport_number": "string",
- "passport_issue_date": "string",
- "passport_expiration_date": "string"
}, - "recipient_info": {
- "tax_id": "string"
}, - "customs_items": [
- {
- "item_description": "string",
- "quantity": 0,
- "unit_value": {
- "amount": 0,
- "currency": "usd"
}, - "item_weight": 0,
- "weight_unit": "ounce",
- "harmonized_tariff_code": "string",
- "country_of_origin": "string",
- "sku": "string"
}
]
}
Category | HttpStatusCode | ErrorCode | Error Message Text | Notes |
Generic | 400 | 800000 | (varies) | Model validation error, message will vary depending on which part of the request model was invalid |
Idempotency | 400 | 800001 | Idempotency-Key provided was invalid. | |
Idempotency | 400 | 800002 | Idempotency-Key header not found for enforced idempotent endpoint. | |
Label | 400 | 800010 | The label_id specified is invalid | |
Pickups | 400 | 800100 | Pickups are not supported for the carrier specified. | |
Pickups | 400 | 800101 | The labels specified belong to more than one carrier. | |
Pickups | 400 | 800102 | One or more labels specified cannot be included in a pickup. | |
Pickups | 400 | 800103 | USPS pickups are not allowed on Sundays. | |
Pickups | 400 | 800104 | USPS pickups are not allowed on holidays. | |
Pickups | 400 | 800105 | USPS pickups must be scheduled for the following USPS business day. | |
Pickups | 400 | 800106 | The labels for label_ids submitted must contain the same address and contact information. | |
Manifest | 400 | 800200 | Manifests are not supported for the carrier specified. | |
Generic | 400 | 899999 | (varies) | Unexpected/Unhandled exception |