ShippingTemplate
Overview
Represents a template used to set a listing's shipping information. Please note that it's not possible to create calculated shipping templates via the API. However, you can associate calculated shipping profiles created from Shop Manager with listings using the API.
ShippingTemplate, ShippingTemplateEntry, and ShippingInfo
The diagram below is an ERD of the relevant portion of the database related to Listings. Each Listing has a User, and each User can have 0 or more ShippingTemplates. We are enforcing that a user create at least one ShippingTemplate before creating a listing. When that listing is created, the ShippingTemplate gets copied into the ShippingInfo table and is associated to that listing. You can then edit the ShippingInfo directly for a listing, or update your ShippingTemplate and update the listing with it.
- A ShippingTemplate has a title and is owned by a user.
- ShippingInfo is a set of records that define shipping information for a specific listing. They are created from a ShippingTemplate.
- ShippingTemplateEntries are a set of rows that correspond to this template.
- They hold an origin country, and a destination, as well as the primary and secondary cost.
- There is only one origin per template, so this is changed on the ShippingTemplate resource instead of the ShippingTemplateEntry.
- You can pass a destination id or a region id when creating a ShippingTemplateEntry, but not both—if you leave them both blank then the destination is assumed to be "everywhere".
- If you create a ShippingTemplateEntry with a region, this implies several destinations and will insert a row for each destination within that region.
- If you delete a ShippingTemplateEntry that is a region, it will delete all corresponding destinations for that region.
- You can update a ShippingTemplateEntry, but because a region defines many rows, and different regions may have a different number of rows, you cannot update the region. You must first delete an entry corresponding to that region, and then add an entry with the new region.
Fields
Field |
Visibility Level |
Permission Scope |
Type |
Description |
shipping_template_id
|
private |
listings_r
|
int |
The numeric ID of this shipping template.
|
title
|
private |
listings_r
|
string |
The name of this shipping template.
|
user_id
|
private |
listings_r
|
int |
The numeric ID of the user who owns this shipping template.
|
min_processing_days
|
private |
listings_r
|
int |
The minimum number of days for processing the listing.
|
max_processing_days
|
private |
listings_r
|
int |
The maximum number of days for processing the listing.
|
processing_days_display_label
|
private |
listings_r
|
string |
Translated display label for processing days.
|
origin_country_id
|
private |
listings_r
|
int |
The numeric ID of the country from which the listing ships.
|
origin_postal_code
|
private |
listings_r
|
string |
The postal code string (not necessarily a number) for the location from which the listing ships.
|
Associations
Association |
Visibility Level |
Permission Scope |
Type |
Description |
Entries |
private |
listings_r
|
array(ShippingTemplateEntry)
|
An array of shipping info entries that belong to this template.
|
Upgrades |
private |
listings_r
|
array(ShippingUpgrade)
|
An array of shipping upgrades for this shipping template.
|
Methods
findAllUserShippingProfiles
Method Name |
findAllUserShippingProfiles |
Synopsis |
Retrieves a set of ShippingTemplate objects associated to a User.
|
HTTP Method |
GET |
URI |
/users/:user_id/shipping/templates |
Parameters |
|
Requires OAuth |
Y |
Permission Scope |
listings_r
|