{"files":{"SKILL.md":"---\nname: logistics-api\ndescription: \"Logistics API skill. Use when working with Logistics for shipment, shipping_quote. Covers 6 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Logistics API\nAPI version: v1_beta.0.0\n\n## Auth\nOAuth2\n\n## Base URL\nhttps://api.ebay.com/sell/logistics/v1_beta\n\n## Setup\n1. Configure auth: OAuth2\n2. GET /shipment/{shipmentId}/download_label_file -- this method returns the shipping label file that was generated for the shipmentid value specified in the request. call createfromshippingquote to generate a shipment id.note: the logistics api only supports usps shipping rates and labels.use the accept http header to specify the format of the returned file. the default file format is a pdf file.\n3. POST /shipment/{shipmentId}/cancel -- create first cancel\n\n## Endpoints\n6 endpoints across 2 groups. See references/api-spec.lap for full details.\n\n### Shipment\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /shipment/{shipmentId}/cancel | This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement.  Note that you cannot cancel a shipment if you have used the associated shipping label. |\n| POST | /shipment/create_from_shipping_quote | This method creates a shipment based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates.Note: The Logistics API only supports USPS shipping rates and labels.When you create a shipment, eBay generates a shipping label that you can download and use to ship your package.In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the shipping quote.In addition to a configurable return-to location and other details about the shipment, the response to this method includes:The shipping carrier and service to be used for the package shipmentA list of selected shipping options, if anyThe shipment tracking numberThe total shipping cost (the sum cost of the base shipping service and any added options)When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadURL field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package.Important! \">Important! Sellers must set up their payment method before they can use this method to create a shipment and the associated shipping label.Set up a billing agreementPrior to using this method to create a shipment, sellers must first set up their billing agreement. Failure to do so will return Error 90030 Payment could not be completed.The preferred method for sellers to set up their billing agreement is to go to Set up billing agreement and follow the on-screen directions.Alternatively, sellers can do the following:Go to https://www.ebay.com/ship/single/{order_id}, where {order_id} is that of the order for which the label is being printed.When prompted, select PayPal.Verify that Save PayPal for future purchases is selected.Click Set up Payments which will open PayPal in a pop-up window.Log in using PayPal credentials, and then follow the on-screen prompts to set up the billing agreement.Once the agreement has been set up, sellers can leave this page as there is no need to actually print a label. |\n| GET | /shipment/{shipmentId}/download_label_file | This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID.Note: The Logistics API only supports USPS shipping rates and labels.Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. |\n| GET | /shipment/{shipmentId} | This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. |\n\n### Shipping_quote\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /shipping_quote | The createShippingQuote method returns a shipping quote  that contains a list of live \"rates.\"  Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are \"live,\" and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire.  Also, depending on the services required, rates can also include pickup and delivery windows.Note: The Logistics API only supports USPS shipping rates and labels.Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions)  Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices.  The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call createFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. |\n| GET | /shipping_quote/{shippingQuoteId} | This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value.  A \"shipping quote\" pertains to a single specific package and contains a set of shipping \"rates\" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size.  Call createShippingQuote to create a shippingQuoteId. |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Create a cancel?\" -> POST /shipment/{shipmentId}/cancel\n- \"Create a create_from_shipping_quote?\" -> POST /shipment/create_from_shipping_quote\n- \"List all download_label_file?\" -> GET /shipment/{shipmentId}/download_label_file\n- \"Get shipment details?\" -> GET /shipment/{shipmentId}\n- \"Create a shipping_quote?\" -> POST /shipping_quote\n- \"Get shipping_quote details?\" -> GET /shipping_quote/{shippingQuoteId}\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Logistics API\n@base https://api.ebay.com/sell/logistics/v1_beta\n@version v1_beta.0.0\n@auth OAuth2\n@endpoints 6\n@toc shipment(4), shipping_quote(2)\n\n@group shipment\n@endpoint POST /shipment/{shipmentId}/cancel\n@desc This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement.  Note that you cannot cancel a shipment if you have used the associated shipping label.\n@required {shipmentId: str # This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled.The shipmentId value is generated and returned by the createFromShippingQuote method.}\n@returns(200) {cancellation: map{cancellationRequestedDate: str, cancellationStatus: str}, creationDate: str, labelCustomMessage: str, labelDownloadUrl: str, labelSize: str, orders: [map], packageSpecification: map{dimensions: map{height: str, length: str, unit: str, width: str}, weight: map{unit: str, value: str}}, rate: map{additionalOptions: [map], baseShippingCost: map{currency: str, value: str}, destinationTimeZone: str, maxEstimatedDeliveryDate: str, minEstimatedDeliveryDate: str, pickupNetworks: [str], pickupSlotId: str, pickupType: str, rateId: str, shippingCarrierCode: str, shippingCarrierName: str, shippingQuoteId: str, shippingServiceCode: str, shippingServiceName: str, totalShippingCost: map{currency: str, value: str}}, returnTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipFrom: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipmentId: str, shipmentTrackingNumber: str, shipTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}} # Success\n@errors {400: Bad Request, 404: Not Found, 409: Conflict, 500: Internal Server Error}\n\n@endpoint POST /shipment/create_from_shipping_quote\n@desc This method creates a shipment based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates.Note: The Logistics API only supports USPS shipping rates and labels.When you create a shipment, eBay generates a shipping label that you can download and use to ship your package.In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the shipping quote.In addition to a configurable return-to location and other details about the shipment, the response to this method includes:The shipping carrier and service to be used for the package shipmentA list of selected shipping options, if anyThe shipment tracking numberThe total shipping cost (the sum cost of the base shipping service and any added options)When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadURL field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package.Important! \">Important! Sellers must set up their payment method before they can use this method to create a shipment and the associated shipping label.Set up a billing agreementPrior to using this method to create a shipment, sellers must first set up their billing agreement. Failure to do so will return Error 90030 Payment could not be completed.The preferred method for sellers to set up their billing agreement is to go to Set up billing agreement and follow the on-screen directions.Alternatively, sellers can do the following:Go to https://www.ebay.com/ship/single/{order_id}, where {order_id} is that of the order for which the label is being printed.When prompted, select PayPal.Verify that Save PayPal for future purchases is selected.Click Set up Payments which will open PayPal in a pop-up window.Log in using PayPal credentials, and then follow the on-screen prompts to set up the billing agreement.Once the agreement has been set up, sellers can leave this page as there is no need to actually print a label.\n@required {Content-Type: str # This header indicates the format of the request body provided by the client. Its value should be set to application/json.  For more information, refer to HTTP request headers., X-EBAY-C-MARKETPLACE-ID: str # This header parameter specifies the eBay marketplace for the shipment being created.For a list of valid values, refer to the section Marketplace ID Values in the Using eBay RESTful APIs guide.}\n@optional {additionalOptions: [map{additionalCost: map, optionType: str}] # Supply a list of one or more shipping options that the seller wants to purchase for this shipment.  The baseShippingCost field that's associated with the selected shipping rate is the cost of the base service offered in the rate. In addition to the base service, sellers can add additional shipping services to the base service. Shipping options include things such as shipping insurance or a recipient's signature upon delivery. The cost of any added services is summed with the base shipping cost to determine the final cost for the shipment. All options added to the shipment must be chosen from the set of shipping options offered with the selected rate., labelCustomMessage: str # Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels., labelSize: str # The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used.  Currently, the only valid value is: 4\"x6\", rateId: str # The unique eBay-assigned identifier of the shipping rate that the seller selected for the shipment. This value is generated by using the createShippingQuote method and is returned in the rates.rateId field., returnTo: map{companyName: str, contactAddress: map, fullName: str, primaryPhone: map} # This complex type contains contact information for an individual buyer or seller., shippingQuoteId: str # The unique eBay-assigned identifier of the shipping quote that was generated by the createShippingQuote method.}\n@returns(201) {cancellation: map{cancellationRequestedDate: str, cancellationStatus: str}, creationDate: str, labelCustomMessage: str, labelDownloadUrl: str, labelSize: str, orders: [map], packageSpecification: map{dimensions: map{height: str, length: str, unit: str, width: str}, weight: map{unit: str, value: str}}, rate: map{additionalOptions: [map], baseShippingCost: map{currency: str, value: str}, destinationTimeZone: str, maxEstimatedDeliveryDate: str, minEstimatedDeliveryDate: str, pickupNetworks: [str], pickupSlotId: str, pickupType: str, rateId: str, shippingCarrierCode: str, shippingCarrierName: str, shippingQuoteId: str, shippingServiceCode: str, shippingServiceName: str, totalShippingCost: map{currency: str, value: str}}, returnTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipFrom: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipmentId: str, shipmentTrackingNumber: str, shipTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}} # Created\n@errors {400: Bad Request, 409: Conflict, 500: Internal Server Error}\n\n@endpoint GET /shipment/{shipmentId}/download_label_file\n@desc This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID.Note: The Logistics API only supports USPS shipping rates and labels.Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file.\n@required {shipmentId: str # This path parameter specifies the unique eBay-assigned identifier of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by the createFromShippingQuote method., Accept: str # This header specifies the format of the returned file. For this method, the value of the header should be Accept: application/pdf.}\n@returns(200) Success\n@errors {400: Bad Request, 404: Not Found, 500: Internal Server Error}\n\n@endpoint GET /shipment/{shipmentId}\n@desc This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID.\n@required {shipmentId: str # This path parameter specifies the unique eBay-assigned identifier of the shipment you want to retrieve.The shipmentId value is generated and returned by the createFromShippingQuote method.}\n@returns(200) {cancellation: map{cancellationRequestedDate: str, cancellationStatus: str}, creationDate: str, labelCustomMessage: str, labelDownloadUrl: str, labelSize: str, orders: [map], packageSpecification: map{dimensions: map{height: str, length: str, unit: str, width: str}, weight: map{unit: str, value: str}}, rate: map{additionalOptions: [map], baseShippingCost: map{currency: str, value: str}, destinationTimeZone: str, maxEstimatedDeliveryDate: str, minEstimatedDeliveryDate: str, pickupNetworks: [str], pickupSlotId: str, pickupType: str, rateId: str, shippingCarrierCode: str, shippingCarrierName: str, shippingQuoteId: str, shippingServiceCode: str, shippingServiceName: str, totalShippingCost: map{currency: str, value: str}}, returnTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipFrom: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shipmentId: str, shipmentTrackingNumber: str, shipTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}} # Success\n@errors {400: Bad Request, 404: Not Found, 500: Internal Server Error}\n\n@endgroup\n\n@group shipping_quote\n@endpoint POST /shipping_quote\n@desc The createShippingQuote method returns a shipping quote  that contains a list of live \"rates.\"  Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are \"live,\" and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire.  Also, depending on the services required, rates can also include pickup and delivery windows.Note: The Logistics API only supports USPS shipping rates and labels.Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions)  Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices.  The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call createFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package.\n@required {X-EBAY-C-MARKETPLACE-ID: str # This header parameter specifies the eBay marketplace for the shipping quote that is being created.For a list of valid values, refer to the section Marketplace ID Values in the Using eBay RESTful APIs guide., Content-Type: str # This header indicates the format of the request body provided by the client. Its value should be set to application/json.  For more information, refer to HTTP request headers.}\n@optional {orders: [map{channel: str, orderId: str}] # In this array, the seller specifies one or more orders that will be shipped in the shipping package. A shipping package can contain any number of line items from one or more orders, providing they all ship in the same package.  Maximum list size: 10, packageSpecification: map{dimensions: map, weight: map} # This complex type specifies the dimensions and weight of a package., shipFrom: map{companyName: str, contactAddress: map, fullName: str, primaryPhone: map} # This complex type contains contact information for an individual buyer or seller., shipTo: map{companyName: str, contactAddress: map, fullName: str, primaryPhone: map} # This complex type contains contact information for an individual buyer or seller.}\n@returns(201) {creationDate: str, expirationDate: str, orders: [map], packageSpecification: map{dimensions: map{height: str, length: str, unit: str, width: str}, weight: map{unit: str, value: str}}, rates: [map], shipFrom: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shippingQuoteId: str, shipTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, warnings: [map]} # Created\n@errors {400: Bad Request, 409: Conflict, 500: Internal Server Error}\n\n@endpoint GET /shipping_quote/{shippingQuoteId}\n@desc This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value.  A \"shipping quote\" pertains to a single specific package and contains a set of shipping \"rates\" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size.  Call createShippingQuote to create a shippingQuoteId.\n@required {shippingQuoteId: str # This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve.The shippingQuoteId value is generated and returned by the createShippingQuote method.}\n@returns(200) {creationDate: str, expirationDate: str, orders: [map], packageSpecification: map{dimensions: map{height: str, length: str, unit: str, width: str}, weight: map{unit: str, value: str}}, rates: [map], shipFrom: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, shippingQuoteId: str, shipTo: map{companyName: str, contactAddress: map{addressLine1: str, addressLine2: str, city: str, countryCode: str, county: str, postalCode: str, stateOrProvince: str}, fullName: str, primaryPhone: map{phoneNumber: str}}, warnings: [map]} # Success\n@errors {400: Bad Request, 404: Not Found, 500: Internal Server Error}\n\n@endgroup\n\n@end\n"}}