· 6 years ago · Jul 07, 2019, 12:50 PM
1@ebay = Ebay::Api.new :auth_token => @seller.ebay_token
2item = Ebay::Types::Item.new( :primary_category => Ebay::Types::Category.new(:category_id => @ebayTemplate.categoryID),
3:title => @ebayTemplate.name,
4:description => @ebayTemplate.description,
5:location => @ebayTemplate.location,
6:start_price => Money.new((@ebayTemplate.startPrice*100).to_d, @ebayTemplate.currency),
7:quantity => 1,
8:listing_duration => @ebayTemplate.listingDuration,
9:country => @ebayTemplate.country,
10:currency => @ebayTemplate.currency,
11:payment_methods => ['VisaMC', 'PayPal'],
12:paypal_email_address => '********@gmail.com',
13:dispatch_time_max => 3,
14:lookup_attributes => [Ebay::Types::LookupAttribute.new( :name => "Condition", :value => "New")],
15# :attribute_sets => [
16# Ebay::Types::AttributeSet.new(
17# :attribute_set_id => 2919,
18# :attributes => [
19# Ebay::Types::Attribute.new(
20# :attribute_id => 10244,
21# :values => [ Ebay::Types::Val.new(:value_id => 10425) ]
22# )
23# ]
24# )
25# ],
26:shipping_details => Ebay::Types::ShippingDetails.new(
27:shipping_service_options => [
28# ShippingServiceOptions.new(
29# :shipping_service_priority => 2, # Display priority in the listing
30# :shipping_service => 'UPSNextDay',
31# :shipping_service_cost => Money.new(1000, 'USD'),
32# :shipping_surcharge => Money.new(299, 'USD')
33# ),
34Ebay::Types::ShippingServiceOptions.new(
35:shipping_service_priority => 1, # Display priority in the listing
36:shipping_service => @ebayTemplate.shipSvc,
37:shipping_service_cost => Money.new((@ebayTemplate.shipSvcCost*100).to_d, @ebayTemplate.currency),
38:shipping_surcharge => Money.new((@ebayTemplate.shipSurcharge*100).to_d, @ebayTemplate.currency)
39)
40],
41:international_shipping_service_options => [
42Ebay::Types::InternationalShippingServiceOptions.new(
43:shipping_service => 'USPSPriorityMailInternational',
44:shipping_service_cost => Money.new((@ebayTemplate.shipSvcCost*100).to_d, @ebayTemplate.currency),
45:shipping_service_priority => 2,
46:ship_to_location => @ebayTemplate.shipToLocation
47)
48]
49
50),
51:return_policy => Ebay::Types::ReturnPolicy.new (
52:description => 'this product for suckers only!',
53:returns_accepted_option => 'ReturnsAccepted'
54)
55#:condition_id => 1000
56)
57
58@response = @ebay.add_item(:item => item)
59
60# added to allow ConditionID to be pushed into XML
61numeric_node :condition_id, 'ConditionID', :optional => true
62
63:condition_id => 1500,