Skip to content

Instantly share code, notes, and snippets.

@eastlondoner
Created January 22, 2025 15:53
Show Gist options
  • Save eastlondoner/195f5a2e151816dc580ce59ec112c653 to your computer and use it in GitHub Desktop.
Save eastlondoner/195f5a2e151816dc580ce59ec112c653 to your computer and use it in GitHub Desktop.
EBay shipping uk
To create a valid eBay UK listing using the Trading API, the `<ShippingDetails>` XML element is essential. It specifies shipping-related information for the item, including domestic and international shipping options, costs, and policies. Below is an example of a valid `<ShippingDetails>` XML structure for a listing on eBay UK:
```xml
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>UK_RoyalMailFirstClassStandard</ShippingService>
<ShippingServiceCost currencyID="GBP">3.99</ShippingServiceCost>
<FreeShipping>false</FreeShipping>
</ShippingServiceOptions>
<InternationalShippingServiceOption>
<ShippingService>UK_RoyalMailAirmailInternational</ShippingService>
<ShippingServiceCost currencyID="GBP">9.99</ShippingServiceCost>
<ShipToLocation>Europe</ShipToLocation>
</InternationalShippingServiceOption>
<SellerExcludeShipToLocationsPreference>true</SellerExcludeShipToLocationsPreference>
<DispatchTimeMax>3</DispatchTimeMax>
</ShippingDetails>
```
### Key Elements in `<ShippingDetails>`:
1. **`<ShippingType>`**:
- Specifies the shipping model.
- Common values include `Flat` (fixed cost), `Calculated` (based on item weight/dimensions), or `Freight`.
2. **`<ShippingServiceOptions>`**:
- Defines domestic shipping services.
- Includes:
- `<ShippingServicePriority>`: Priority of the service (lower numbers indicate higher priority).
- `<ShippingService>`: The specific shipping service (e.g., `UK_RoyalMailFirstClassStandard`).
- `<ShippingServiceCost>`: Cost of the service in GBP.
- `<FreeShipping>`: Indicates whether the service is free.
3. **`<InternationalShippingServiceOption>`**:
- Defines international shipping services.
- Includes:
- `<ShipToLocation>`: Specifies regions or countries to ship to (e.g., `Europe`, `Worldwide`).
4. **`<SellerExcludeShipToLocationsPreference>`**:
- When set to `true`, excludes buyers from certain locations specified in your seller preferences.
5. **`<DispatchTimeMax>`**:
- Maximum number of business days to dispatch the item after receiving payment.
### Notes for eBay UK Listings:
- Use valid shipping services for the UK site, such as `UK_RoyalMailFirstClassStandard` or `UK_RoyalMailAirmailInternational`. Invalid services will result in errors[4].
- Ensure that `<ShipToLocation>` values are valid for the UK site. For example, avoid unsupported locations like `BR` (Brazil) or `RU` (Russia)[3].
- The `<DispatchTimeMax>` element is important for setting buyer expectations regarding delivery timelines.
This XML structure should be included within your `<Item>` element when making an API call to add a listing via `AddItem` or `AddFixedPriceItem`.
Sources
[1] eBay::API::XML::DataType::ShippingDetailsType - MetaCPAN https://metacpan.org/pod/eBay::API::XML::DataType::ShippingDetailsType
[2] eBay::API::XML::DataType::ShippingLocationDetailsType - MetaCPAN https://metacpan.org/pod/eBay::API::XML::DataType::ShippingLocationDetailsType
[3] eBay API throws Invalid ShipToLocation error when adding new listing https://stackoverflow.com/questions/26817755/ebay-api-throws-invalid-shiptolocation-error-when-adding-new-listing
[4] XML eBay Trading API - addItem with multiple shipping options https://stackoverflow.com/questions/18410701/xml-ebay-trading-api-additem-with-multiple-shipping-options
[5] Configuring Your Store's Settings with the eBay Trading API - SitePoint https://www.sitepoint.com/configuring-stores-settings-ebay-trading-api/
[6] Setting up your postage options - eBay https://www.ebay.co.uk/help/selling/posting-items/setting-postage-options?id=4089
[7] Trading API - eBay Developers - YUMPU https://www.yumpu.com/en/document/view/6321452/trading-api-ebay-developers
[8] eBay/trading-api-java-sdk - GitHub https://github.com/eBay/trading-api-java-sdk
[9] Setting Up eBay Listings - GarageSale Help https://manual.iwascoding.com/gs8/en/Listings_Section-Setting_Up_eBay_Listings.html
[10] EBAY API + Python Tutorial - YouTube https://www.youtube.com/watch?v=Ma_eLdobmlM
[11] Listing inventory in bulk on eBay - Avasam https://www.avasam.com/listing-inventory-in-bulk-on-ebay/
[12] Unanswered 'ebay-api' Questions - Page 7 - Stack Overflow https://stackoverflow.com/questions/tagged/ebay-api?tab=unanswered&page=7
[13] trading-api-java-sdk/samples/README.md at main · eBay ... - GitHub https://github.com/eBay/trading-api-java-sdk/blob/main/samples/README.md
[14] eBay::API::XML::DataType::ItemType - MetaCPAN https://metacpan.org/pod/eBay::API::XML::DataType::ItemType
[15] ebaysdk-python/ebaysdk/trading/__init__.py at master - GitHub https://github.com/timotheus/ebaysdk-python/blob/master/ebaysdk/trading/__init__.py
[16] Bulk listing tools - eBay https://www.ebay.co.uk/splashui/captcha?ap=1&appName=orch&ru=https%3A%2F%2Fwww.ebay.co.uk%2Fhelp%2Fselling%2Flistings%2Flisting-tips%2Fbulk-listing-tool%3Fid%3D4160&iid=492de087-4b7a-450c-a6ac-516fd36f4954&iim=gMTg1LjL&iia=ltE4MS4xMi&iiz=qbaMjAuNzQ%2AQDC
[17] Introducing eBay's Trading API - Setting Up - SitePoint https://www.sitepoint.com/introducing-ebays-trading-api-setting/
[18] API Fehler seit 01.10.2015 - eBay Deutschland Community https://community.ebay.de/t5/Archiv-Mitglieder-helfen/API-Fehler-seit-01-10-2015/qaq-p/2804821
[19] Seller Hub Reports - eBay https://www.ebay.co.uk/help/selling/selling-tools/seller-hub-reports?id=4096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment