### Get Carrier Settings Response Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a successful response body when retrieving carrier settings. It includes fields like nickname, whether to hide the account number, and if it's the primary account. ```json { "nickname": "string", "should_hide_account_number_on_archive_doc": true, "is_primary_account": true } ``` -------------------------------- ### Connect a Carrier Account (Stamps.com Example) Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Connect a new carrier account by providing its specific credentials. The required fields vary by carrier; this example shows connecting a Stamps.com account with username and password. ```bash curl -s -X POST https://api.shipengine.com/v1/connections/carriers/stamps_com \ -H "API-Key: __YOUR_API_KEY_HERE__" \ -H "Content-Type: application/json" \ -d '{ "nickname": "My Stamps Account", "username": "my-stamps-user", "password": "s3cr3t" }' ``` -------------------------------- ### Get Batch By External ID Request Parameter Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This example shows the format for the `external_batch_id` path parameter when retrieving batch information. ```text 13553d7f-3c87-4771-bae1-c49bacef11cb ``` -------------------------------- ### Validate Address Request Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This example demonstrates a request to validate an address using all known fields. It expects a 'verified' status in response. ```json { "name": "Mickey and Minnie Mouse", "phone": "714-781-4565", "company_name": "The Walt Disney Company", "address_line1": "500 South Buena Vista Street", "city_locality": "Burbank", "state_province": "CA", "postal_code": 91521, "country_code": "US" } ``` -------------------------------- ### Shipment Request Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a request body for creating a shipment with ShipEngine. It includes details about collect on delivery, packages, insurance, and more. ```APIDOC ## Request Body for Shipment Creation ### Description This endpoint allows you to create a new shipment with various options. ### Parameters #### Request Body - **collect_on_delivery** (object) - Optional - Details for collect on delivery. - **payment_type** (string) - Required - The type of payment. - **payment_amount** (object) - Required - The amount to be collected. - **currency** (string) - Required - The currency of the payment amount. - **amount** (number) - Required - The payment amount. - **third_party_consignee** (boolean) - Optional - Whether the consignee is a third party. - **dangerous_goods** (boolean) - Optional - Whether the shipment contains dangerous goods. - **dangerous_goods_contact** (object) - Optional - Contact information for dangerous goods. - **name** (string) - Required - The name of the contact. - **phone** (string) - Required - The phone number of the contact. - **windsor_framework_details** (object) - Optional - Details for the Windsor framework. - **movement_indicator** (string) - Required - The movement indicator. - **not_at_risk** (boolean) - Required - Indicates if the shipment is not at risk. - **license_number** (integer) - Optional - The license number for the shipment. - **invoice_number** (string) - Optional - The invoice number for the shipment. - **certificate_number** (integer) - Optional - The certificate number for the shipment. - **fragile** (boolean) - Optional - Whether the shipment is fragile. - **delivery_as_addressed** (boolean) - Optional - Whether to deliver as addressed. - **return_after_first_attempt** (boolean) - Optional - Whether to return after the first delivery attempt. - **regulated_content_type** (string) - Optional - The type of regulated content. - **insurance_provider** (string) - Optional - The insurance provider. - **order_source_code** (string) - Optional - The source code of the order. - **packages** (array) - Required - An array of package details. - **package_id** (string) - Required - The unique identifier for the package. - **package_code** (string) - Required - The code for the package type. - **package_name** (string) - Optional - The name of the package. - **weight** (object) - Required - The weight of the package. - **value** (number) - Required - The weight value. - **unit** (string) - Required - The unit of weight (e.g., pound, kilogram). - **dimensions** (object) - Required - The dimensions of the package. - **unit** (string) - Required - The unit of measurement for dimensions (e.g., inch, centimeter). - **length** (number) - Required - The length of the package. - **width** (number) - Required - The width of the package. - **height** (number) - Required - The height of the package. - **insured_value** (object) - Optional - The insured value of the package. - **currency** (string) - Required - The currency of the insured value. - **amount** (number) - Required - The insured amount. - **label_messages** (object) - Optional - Custom messages for the label. - **reference1** (string) - Optional - Reference message 1. - **reference2** (string) - Optional - Reference message 2. - **reference3** (string) - Optional - Reference message 3. - **external_package_id** (string) - Optional - An external identifier for the package. - **content_description** (string) - Optional - A description of the package contents. - **products** (array) - Optional - An array of product details within the package. - **comparison_rate_type** (string) - Optional - The type of comparison rate. ### Request Example ```json { "collect_on_delivery": { "payment_type": "any", "payment_amount": { "currency": "string", "amount": 0 } }, "third_party_consignee": false, "dangerous_goods": false, "dangerous_goods_contact": { "name": "string", "phone": "string" }, "windsor_framework_details": { "movement_indicator": "c2c", "not_at_risk": true }, "license_number": 514785, "invoice_number": "IOC56888", "certificate_number": 784515, "fragile": false, "delivery-as-addressed": false, "return-after-first-attempt": false, "regulated_content_type": "day_old_poultry", "insurance_provider": "none", "order_source_code": "amazon_ca", "packages": [ { "package_id": "se-28529731", "package_code": "small_flat_rate_box", "package_name": "string", "weight": { "value": 0, "unit": "pound" }, "dimensions": { "unit": "inch", "length": 0, "width": 0, "height": 0 }, "insured_value": { "currency": "string", "amount": 0 }, "label_messages": { "reference1": null, "reference2": null, "reference3": null }, "external_package_id": "string", "content_description": "Hand knitted wool socks", "products": [] } ], "comparison_rate_type": "retail" } ``` ``` -------------------------------- ### Create Batch Request Body Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of the JSON payload required to create a new batch of shipments. It includes optional fields for external batch identification and notes. ```json { "external_batch_id": "se-28529731", "batch_notes": "This is my batch", "shipment_ids": [ "se-28529731" ], "rate_ids": [ "se-28529731" ] } ``` -------------------------------- ### Get Rate By ID Path Parameter Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This example demonstrates the `rate_id` path parameter required for the 'Get Rate By ID' endpoint. The ID must be a string between 1 and 25 characters, following the 'se-[alphanumeric]' pattern. ```http GET /v1/rates/{rate_id} HTTP/1.1 Host: api.shipengine.com Authorization: Basic YOUR_API_KEY Example: se-28529731 ``` -------------------------------- ### Mark.js Options Configuration Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Demonstrates setting various options for the Mark.js library, such as case sensitivity, custom elements, and callbacks. ```javascript instance.mark("example", { element: "span", className: "highlight", exclude: [ "p.ignore", "div.exclude-me" ], caseSensitive: false, ignoreJoiners: true, ignorePunctuation: ["!", "?", "."], wildcards: "disabled", each: function(mark) { // callback for each mark console.log("Marked: ", mark); }, noMatch: function(nonExistent) { // callback if no match is found console.log("No match found for: ", nonExistent); }, filter: function(textNode, term, markType, count) { // callback to filter marks return true; }, done: function(totalMarks) { // callback when marking is done console.log("Total marks: ", totalMarks); }, debug: true, log: window.console }); ``` -------------------------------- ### Get Batch By ID Request Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a request to retrieve details of a specific batch using its ID. The response will contain batch information or an error. ```http GET /v1/batches/{batch_id} HTTP/1.1 Host: api.shipengine.com Authorization: Bearer YOUR_API_KEY ``` -------------------------------- ### Initialize Mark.js Library Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Initializes the Mark.js library for text highlighting. This is the main entry point for using the library's functionalities. ```javascript var mark = require("mark.js"); var instance = new mark(document.getElementById("content")); // Use instance.mark(), instance.markRegExp(), instance.markRanges(), instance.unmark() // to mark/unmark text. ``` -------------------------------- ### Initialize Redoc Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Initializes the Redoc application. This function is typically called once to set up the Redoc instance. ```javascript n.d(t,"init",(function(){return Zc})) ``` -------------------------------- ### Start Tracking a Package Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Subscribe to real-time tracking webhook events for a package. This is useful for packages not originally created within ShipEngine. A 204 response indicates success and that events will be pushed to your webhook URL. ```bash curl -s -X POST "https://api.shipengine.com/v1/tracking/start?carrier_code=stamps_com&tracking_number=9405511899223197428490" \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` -------------------------------- ### GET /v1/labels/{label_id}/track — Get Label Tracking Information Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Get the current tracking status and event history for a label purchased through ShipEngine. ```APIDOC ## GET /v1/labels/{label_id}/track — Get Label Tracking Information ### Description Get the current tracking status and event history for a label purchased through ShipEngine. ### Method GET ### Endpoint https://api.shipengine.com/v1/labels/{label_id}/track ### Parameters #### Path Parameters - **label_id** (string) - Required - The ID of the label for which to retrieve tracking information. ### Response #### Success Response (200) ```json { "tracking_number": "string", "status_code": "string", "status_detail_code": "string", "carrier_status_description": "string", "estimated_delivery_date": "string (ISO 8601)", "events": [ { "occurred_at": "string (ISO 8601)", "description": "string", "city_locality": "string", "state_province": "string", "country_code": "string" } ] } ``` ### Response Example ```json { "tracking_number": "9400111899223456781234", "status_code": "IT", "status_detail_code": "IN_TRANSIT", "carrier_status_description": "In Transit to Next Facility", "estimated_delivery_date": "2023-10-18T00:00:00Z", "events": [ { "occurred_at": "2023-10-16T08:32:00Z", "description": "Departed USPS Regional Facility", "city_locality": "Austin", "state_province": "TX", "country_code": "US" } ] } ``` ``` -------------------------------- ### Sample String Generation Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Generates a sample string based on the specified format (e.g., email, date-time, password) and length constraints (minLength, maxLength). Defaults to a generic string if no format is provided. ```javascript function sampleString(e) { var t = e.format || "default"; return (a[t] || i)(0 | e.minLength, e.maxLength) } function o(e, t, n) { var o = (0, r.toRFCDateTime)(new Date, n, !1); if (o.length < e) throw new Error("Using minLength = ".concat(e, ' is incorrect with format ``` ```javascript "date-time"")); if (t && o.length > t) throw new Error("Using maxLength = ".concat(t, ' is incorrect with format ``` ```javascript "date-time"")); return o } function i(e, t) { var n = (0, r.ensureMinLength)("string", e); return t && n.length > t && (n = n.substring(0, t)), n } var a = { email: function() { return "user@example.com" }, password: function(e, t) { var n = "pa$$word"; return e > n.length && (n += "_", n += (0, r.ensureMinLength)("qwerty!@#$%^123456", e - n.length).substring(0, e - n.length)), n }, "date-time": function(e, t) { return o(e, t) }, date: function(e, t) { return o(e, t, !0) }, ipv4: function() { return "192.168.0.1" }, ipv6: function() { return "2001:0db8:85a3:0000:0000:8a2e:0370:7334" }, hostname: function() { return "example.com" }, uri: function() { return "http://example.com" }, default: i } ``` -------------------------------- ### Shipment Response Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a successful response when creating or retrieving shipment details. ```APIDOC ## Shipment Response Example ### Description This is an example of a successful response when creating or retrieving shipment details. ### Response #### Success Response (200) - **shipment_id** (string) - Unique identifier for the shipment. - **carrier_id** (string) - Identifier for the carrier. - **service_code** (string) - The service code for the shipment (e.g., "usps_first_class_mail"). - **shipping_rule_id** (string) - Identifier for the shipping rule applied. - **external_order_id** (string) - An external order identifier. - **items** (array) - List of items included in the shipment. - **tax_identifiers** (array) - Tax information related to the shipment. - **taxable_entity_type** (string) - Type of taxable entity (e.g., "shipper"). - **identifier_type** (string) - Type of tax identifier (e.g., "vat"). - **issuing_authority** (string) - The authority that issued the tax identifier. - **value** (string) - The tax identifier value. - **external_shipment_id** (string) - An external shipment identifier. - **shipment_number** (string) - The carrier-assigned shipment number. - **ship_date** (string) - The date the shipment is scheduled to ship (ISO 8601 format). - **created_at** (string) - The timestamp when the shipment was created (ISO 8601 format). - **modified_at** (string) - The timestamp when the shipment was last modified (ISO 8601 format). - **shipment_status** (string) - The current status of the shipment (e.g., "pending"). - **ship_to** (object) - Information about the recipient of the shipment. - **name** (string) - Recipient's name. - **phone** (string) - Recipient's phone number. - **email** (string) - Recipient's email address. - **company_name** (string) - Recipient's company name. - **address_line1** (string) - First line of the recipient's address. - **address_line2** (string) - Second line of the recipient's address. - **address_line3** (string) - Third line of the recipient's address. - **city_locality** (string) - Recipient's city. - **state_province** (string) - Recipient's state or province. - **postal_code** (string) - Recipient's postal code. - **country_code** (string) - Recipient's country code (ISO 3166-1 alpha-2). - **address_residential_indicator** (string) - Indicates if the address is residential ('yes' or 'no'). - **instructions** (string) - Delivery instructions. - **geolocation** (array) - Geolocation information for the address. - **type** (string) - The type of geolocation (e.g., "what3words"). - **value** (string) - The geolocation value. - **ship_from** (object) - Information about the sender of the shipment. - **name** (string) - Sender's name. - **phone** (string) - Sender's phone number. - **email** (string) - Sender's email address. - **company_name** (string) - Sender's company name. - **address_line1** (string) - First line of the sender's address. - **address_line2** (string) - Second line of the sender's address. - **address_line3** (string) - Third line of the sender's address. - **city_locality** (string) - Sender's city. - **state_province** (string) - Sender's state or province. - **postal_code** (string) - Sender's postal code. - **country_code** (string) - Sender's country code (ISO 3166-1 alpha-2). - **address_residential_indicator** (string) - Indicates if the address is residential ('yes' or 'no'). - **instructions** (string) - Delivery instructions. - **warehouse_id** (string) - Identifier for the warehouse used for the shipment. - **return_to** (object) - Information about the return address. - **name** (string) - Return recipient's name. - **phone** (string) - Return recipient's phone number. - **email** (string) - Return recipient's email address. - **company_name** (string) - Return recipient's company name. - **address_line1** (string) - First line of the return address. - **address_line2** (string) - Second line of the return address. - **address_line3** (string) - Third line of the return address. - **city_locality** (string) - Return recipient's city. - **state_province** (string) - Return recipient's state or province. - **postal_code** (string) - Return recipient's postal code. - **country_code** (string) - Return recipient's country code (ISO 3166-1 alpha-2). - **address_residential_indicator** (string) - Indicates if the address is residential ('yes' or 'no'). - **instructions** (string) - Delivery instructions. - **is_return** (boolean) - Indicates if this shipment is a return. - **confirmation** (string) - Confirmation status of the shipment (e.g., "none"). - **customs** (object) - Customs information for international shipments. - **contents** (string) - Description of the shipment contents (e.g., "merchandise"). - **contents_explanation** (string) - Detailed explanation of the contents. - **non_delivery** (string) - Action to take if the shipment cannot be delivered (e.g., "return_to_sender"). - **terms_of_trade_code** (string) - Incoterms code (e.g., "exw"). - **declaration** (string) - Customs declaration details. - **invoice_additional_details** (object) - Additional details for the customs invoice. - **freight_charge** (object) - Details of freight charges. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of the freight charge. - **insurance_charge** (object) - Details of insurance charges. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of the insurance charge. - **discount** (object) - Details of any discounts applied. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of the discount. - **estimated_import_charges** (object) - Estimated import charges. - **taxes** (object) - Estimated taxes. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of estimated taxes. - **duties** (object) - Estimated duties. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of estimated duties. - **other_charge** (object) - Details of other charges. - **currency** (string) - Currency code (e.g., "USD"). - **amount** (number) - The amount of the other charge. ### Response Example ```json { "shipment_id": "se-28529731", "carrier_id": "se-28529731", "service_code": "usps_first_class_mail", "shipping_rule_id": "se-28529731", "external_order_id": "string", "items": [], "tax_identifiers": [ { "taxable_entity_type": "shipper", "identifier_type": "vat", "issuing_authority": "string", "value": "string" } ], "external_shipment_id": "string", "shipment_number": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "modified_at": "2018-09-23T15:00:00.000Z", "shipment_status": "pending", "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [ { "type": "what3words", "value": "cats.with.thumbs" } ] }, "ship_from": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "warehouse_id": "se-28529731", "return_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "is_return": false, "confirmation": "none", "customs": { "contents": "merchandise", "contents_explanation": "string", "non_delivery": "return_to_sender", "terms_of_trade_code": "exw", "declaration": "string", "invoice_additional_details": { "freight_charge": { "currency": "string", "amount": 0 }, "insurance_charge": { "currency": "string", "amount": 0 }, "discount": { "currency": "string", "amount": 0 }, "estimated_import_charges": { "taxes": { "currency": "string", "amount": 0 }, "duties": { "currency": "string", "amount": 0 } }, "other_charge": { "currency": "string", "amount": 0 } } } } ``` ``` -------------------------------- ### Shipment Response Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a successful response when creating or retrieving shipment information. ```APIDOC ## Response Samples ### Success Response (200) Content type: application/json ```json { "has_errors": false, "shipments": [ { "shipment_id": "se-28529731", "carrier_id": "se-28529731", "service_code": "usps_first_class_mail", "shipping_rule_id": "se-28529731", "external_order_id": "string", "items": [], "tax_identifiers": [ { "taxable_entity_type": "shipper", "identifier_type": "vat", "issuing_authority": "string", "value": "string" } ], "external_shipment_id": "string", "shipment_number": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "modified_at": "2018-09-23T15:00:00.000Z", "shipment_status": "pending", "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [ { "type": "what3words", "value": "cats.with.thumbs" } ] }, "ship_from": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "warehouse_id": "se-28529731", "return_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "is_return": false, "confirmation": "none", "customs": { "contents": "merchandise", "contents_explanation": "string", "non_delivery": "return_to_sender" } } ] } ``` ``` -------------------------------- ### Get Account Settings Response Sample Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is a sample JSON response for retrieving account settings. It includes the default label layout. ```json { "default_label_layout": "4x6" } ``` -------------------------------- ### Shipment Response Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a successful response when creating or retrieving shipment information. ```APIDOC ## Response Example (200 OK) ### Content Type application/json ### Body ```json { "shipments": [ { "shipment_id": "se-28529731", "carrier_id": "se-28529731", "service_code": "usps_first_class_mail", "shipping_rule_id": "se-28529731", "external_order_id": "string", "items": [], "tax_identifiers": [ { "taxable_entity_type": "shipper", "identifier_type": "vat", "issuing_authority": "string", "value": "string" } ], "external_shipment_id": "string", "shipment_number": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "modified_at": "2018-09-23T15:00:00.000Z", "shipment_status": "pending", "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [ { "type": "what3words", "value": "cats.with.thumbs" } ] }, "ship_from": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "warehouse_id": "se-28529731", "return_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string" }, "is_return": false, "confirmation": "none", "customs": { "contents": "merchandise", "contents_explanation": "string", "non_delivery": "return_to_sender", "terms_of_trade_code": "string" } } ] } ``` ``` -------------------------------- ### List Manifests Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Query manifests by warehouse, carrier, or date range. Requires an API key for authentication. ```bash curl -s "https://api.shipengine.com/v1/manifests?warehouse_id=se-55555&carrier_id=se-28529731&ship_date_start=2023-10-01T00:00:00Z" \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` -------------------------------- ### Get Global Context Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html A helper function to get the global context (window, global, or self) based on the environment. ```javascript function f(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:p} ``` -------------------------------- ### Start Tracking a Package Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Subscribes to real-time tracking webhook events for a package. This is useful for packages not originally created within ShipEngine. ```APIDOC ## POST /v1/tracking/start — Start Tracking a Package ### Description Subscribe to real-time tracking webhook events for a package not originally created in ShipEngine. ### Method POST ### Endpoint /v1/tracking/start ### Parameters #### Query Parameters - **carrier_code** (string) - Required - The carrier code for the shipment. - **tracking_number** (string) - Required - The tracking number for the shipment. ### Request Example ```bash curl -s -X POST "https://api.shipengine.com/v1/tracking/start?carrier_code=stamps_com&tracking_number=9405511899223197428490" \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` ### Response #### Success Response (204 No Content) Indicates that tracking events will be pushed to your configured webhook URL. ``` -------------------------------- ### List Scheduled Pickups Query Parameters Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Example of query parameters for listing scheduled pickups. Includes carrier ID, warehouse ID, creation date range, and pagination controls. ```http carrier_id=se-28529731 warehouse_id=se-28529731 created_at_start=2019-03-12T19:24:13.657Z created_at_end=2019-03-12T19:24:13.657Z page=2 page_size=50 ``` -------------------------------- ### Get Carrier Options Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Get a list of the options available for the carrier. This endpoint retrieves all configurable options for a specific carrier. ```APIDOC ## GET /v1/carriers/{carrier_id}/options ### Description Get a list of the options available for the carrier. ### Method GET ### Endpoint /v1/carriers/{carrier_id}/options ### Parameters #### Path Parameters - **carrier_id** (string) - Required - Carrier ID ``` -------------------------------- ### List Webhooks Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Retrieve all currently configured webhooks for the account. ```bash curl -s https://api.shipengine.com/v1/environment/webhooks \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` -------------------------------- ### Get Shipment Rates Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Get available rates for an existing shipment (shortcut to `POST /v1/rates` using a stored shipment). ```APIDOC ## GET /v1/shipments/{shipment_id}/rates — Get Shipment Rates ### Description Get available rates for an existing shipment (shortcut to `POST /v1/rates` using a stored shipment). ### Method GET ### Endpoint /v1/shipments/{shipment_id}/rates ### Parameters #### Path Parameters - **shipment_id** (string) - Required - The unique identifier of the shipment for which to get rates. #### Query Parameters - **created_at_start** (string) - Optional - Filter rates created after this date and time (ISO 8601 format). ### Response #### Success Response (200) - **rate_response** (object) - An object containing rate information. - **rates** (array) - An array of available rate objects. ### Request Example ```bash curl -s "https://api.shipengine.com/v1/shipments/se-1234567/rates?created_at_start=2023-01-01T00:00:00Z" \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` ### Response Example ```json # Response 200 — rate_response object with rates array ``` ``` -------------------------------- ### Get Shipment By ID - GET /v1/shipments/{shipment_id} Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Retrieve the full details of a single shipment by providing its unique `shipment_id`. ```bash curl -s https://api.shipengine.com/v1/shipments/se-1234567 \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` -------------------------------- ### Create Batch Response Sample (200 OK) Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is a sample successful response when creating a batch. It includes details about the created batch, such as its ID, status, and URLs for related resources. ```json { "label_layout": "4x6", "label_format": "pdf", "batch_id": "se-28529731", "batch_number": "string", "external_batch_id": "string", "batch_notes": "Batch for morning shipment", "created_at": "2018-09-23T15:00:00.000Z", "processed_at": "2018-09-23T15:00:00.000Z", "errors": 2, "process_errors": [ { "error_source": "carrier", "error_type": "account_status", "error_code": "auto_fund_not_supported", "message": "Body of request cannot be null.", "carrier_id": "se-28529731", "carrier_code": "dhl_express", "field_name": "shipment.ship_to.phone_number" } ], "warnings": 1, "completed": 1, "forms": 3, "count": 2, "batch_shipments_url": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "batch_labels_url": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "batch_errors_url": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "label_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "pdf": "http://api.shipengine.com/v1/labels/se-28529731", "png": "http://api.shipengine.com/v1/labels/se-28529731", "zpl": "http://api.shipengine.com/v1/labels/se-28529731" }, "form_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "paperless_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "instructions": null, "handoff_code": null }, "status": "open" } ``` -------------------------------- ### Delete Batch By ID Request Example Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html This is an example of a request to delete a batch by its ID. The response indicates success or failure. ```http DELETE /v1/batches/{batch_id} HTTP/1.1 Host: api.shipengine.com Authorization: Bearer YOUR_API_KEY ``` -------------------------------- ### GET /v1/service_points/{carrier_code}/{country_code}/{service_point_id} — Get Service Point By ID Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Retrieve details for a specific service point. ```APIDOC ## GET /v1/service_points/{carrier_code}/{country_code}/{service_point_id} — Get Service Point By ID ### Description Retrieve details for a specific service point. ### Method GET ### Endpoint /v1/service_points/{carrier_code}/{country_code}/{service_point_id} ### Parameters #### Path Parameters - **carrier_code** (string) - Required - The carrier code (e.g., "fedex"). - **country_code** (string) - Required - The two-letter country code (e.g., "US"). - **service_point_id** (string) - Required - The ID of the service point. ### Request Example ```bash curl -s https://api.shipengine.com/v1/service_points/fedex/US/sp-001 \ -H "API-Key: __YOUR_API_KEY_HERE__" ``` ### Response #### Success Response (200) - A single service point object with address, hours, and services. ``` -------------------------------- ### Download File Source: https://context7.com/shipengine/shipengine-openapi/llms.txt Download a previously generated label, manifest, or combined document file. Streams binary PDF content. ```bash curl -s -L \ "https://api.shipengine.com/v1/downloads/10/lZ6/label-97201aba-a2e7-4879.pdf" \ -H "API-Key: __YOUR_API_KEY_HERE__" \ --output label.pdf ``` -------------------------------- ### ShipEngine Carrier Response Sample Source: https://github.com/shipengine/shipengine-openapi/blob/master/docs/index.html Example JSON response for a successful carrier connection or retrieval. Includes details about services, packages, and options. ```json { "carrier_id": "se-28529731", "carrier_code": "dhl_express", "account_number": "account_570827", "requires_funded_amount": true, "balance": 3799.52, "nickname": "ShipEngine Account - Stamps.com", "friendly_name": "Stamps.com", "funding_source_id": "se-28529731", "primary": true, "has_multi_package_supporting_services": true, "allows_returns": true, "supports_label_messages": true, "disabled_by_billing_plan": true, "services": [ { "carrier_id": "se-28529731", "carrier_code": "se-28529731", "service_code": "usps_media_mail", "name": "USPS First Class Mail", "domestic": true, "international": true, "is_multi_package_supported": true, "is_return_supported": true } ], "packages": [ { "package_id": "se-28529731", "package_code": "small_flat_rate_box", "name": "laptop_box", "dimensions": { "unit": "inch", "length": 0, "width": 0, "height": 0 }, "description": "Packaging for laptops" } ], "options": [ { "name": "contains_alcohol", "default_value": false, "description": "string" } ], "send_rates": true, "supports_user_managed_rates": true, "connection_status": "pending_approval" } ```