eBay API - addItem ShipToLocation save only last value -


this first contact ebay api , have problem @ beginning. coding in python , trying call additem, cant define international shipping options.

i send item domestic 2.50gbp, , international asia, japan, australia 20gbp , europe, europeanunion, germany 10gbp. , have no idea how declare it...

what tried far?

 "shippingdetails": {              "globalshipping": "true",              "shippingtype": "flat",              "shippingserviceoptions": {                  "shippingservice": "uk_othercourier",                  "shippingservicecost": "2.50",              },              "internationalshippingserviceoption": {                  "shippingservice": "uk_royalmailairmailinternational",                  "shippingservicecost": "10",                  "shiptolocation": "europe",                  "shiptolocation": "europeanunion",                  "shiptolocation": "de"              }          } 

but when run code listing has domestic shipping 2.50gbp , shipping germany 10gbp (only last shiptolocation saved). how set shipping regions costs?

in python dictionary not allow give duplicate value.

you have write shiptolocation 3 times in single dict, due reason system have consider last one.

you can using following method.

"shippingdetails": {              "globalshipping": "true",              "shippingtype": "flat",              "shippingserviceoptions": {                  "shippingservice": "uk_othercourier",                  "shippingservicecost": "2.50",              },              "internationalshippingserviceoption": {                  "shippingservice": "uk_royalmailairmailinternational",                  "shippingservicecost": "10",                  "shiptolocation": ["europe","europeanunion","de"]              }          } 

you should write shiptolocation value in list.

now when convert dict_to_xml python library automatic manage in xml tag.

following 1 of best library converting dict_to_xml , xml_to_dict.

https://github.com/shopify/pyactiveresource/tree/master/pyactiveresource


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -