This repository was archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
This repository was archived by the owner on Jun 7, 2024. It is now read-only.
Rate returns nothing when creating multi-pieces parcel #48
Copy link
Copy link
Open
Description
There is no rate return when creating multi-pieces parcel. Here is an example provided from its document.
APIResource resource = new APIResource(token);
Hashtable toAddressTable = new Hashtable();
toAddressTable.Add("name", "Mr. Hippo");
toAddressTable.Add("company", "Shippo");
toAddressTable.Add("street1", "215 Clayton St.");
toAddressTable.Add("city", "San Francisco");
toAddressTable.Add("state", "CA");
toAddressTable.Add("zip", "94117");
toAddressTable.Add("country", "US");
toAddressTable.Add("phone", "+1 555 341 9393");
toAddressTable.Add("email", "support@goshipppo.com");
Hashtable fromAddressTable = new Hashtable();
fromAddressTable.Add("name", "Ms Hippo");
fromAddressTable.Add("company", "San Diego Zoo");
fromAddressTable.Add("street1", "2920 Zoo Drive");
fromAddressTable.Add("city", "San Diego");
fromAddressTable.Add("state", "CA");
fromAddressTable.Add("zip", "92101");
fromAddressTable.Add("country", "US");
fromAddressTable.Add("email", "hippo@goshipppo.com");
fromAddressTable.Add("phone", "+1 619 231 1515");
fromAddressTable.Add("metadata", "Customer ID 123456");
List<Hashtable> parcelsList = new List<Hashtable>();
Hashtable parcelTable = new Hashtable();
parcelTable.Add("length", "5");
parcelTable.Add("width", "5");
parcelTable.Add("height", "5");
parcelTable.Add("distance_unit", "in");
parcelTable.Add("weight", "2");
parcelTable.Add("mass_unit", "lb");
Hashtable parcelTableTwo = new Hashtable();
parcelTableTwo.Add("length", "1");
parcelTableTwo.Add("width", "1");
parcelTableTwo.Add("height", "1");
parcelTableTwo.Add("distance_unit", "in");
parcelTableTwo.Add("weight", "2");
parcelTableTwo.Add("mass_unit", "lb");
parcelsList.Add(parcelTable);
parcelsList.Add(parcelTableTwo);
Hashtable shipmentTable = new Hashtable();
shipmentTable.Add("address_to", toAddressTable);
shipmentTable.Add("address_from", fromAddressTable);
shipmentTable.Add("parcels", parcelsList);
shipmentTable.Add("async", false);
Shipment shipment = resource.CreateShipment(shipmentTable);
Response.Write(shipment.Rates.Count().ToString()); // **output 0**
Metadata
Metadata
Assignees
Labels
No labels