0

I have integrating Shippo API into my project, I have few queries on Parcel object which we need to send the length, height, weight etc..

1) How should we know the user is given correct values for these fields, if he given wrong values what should happens?

2) If suppose I want to ship a car or a bike, then how can ask for these fields from the user? Is it required to send these fields for all items?

Thanks, Venkat

mootrichard
  • 3,581
  • 13
  • 25
venkat
  • 11
  • 2

1 Answers1

0

1) How should we know the user is given correct values for these fields ,if he given wrong values what should happens?

When creating a Parcel object in Shippo, you would be the one providing the values for the Parcel dimensions (unless you use one of Shippo's templates). So the only way to know that you have correct values is to check against whatever the dimensions of your shipment are.

2)If suppose I want shipment car or bike then how can ask these fields from user? Is it required to send these fields for all items?

When getting the different values for the Parcel object, you simply want to provide what the final dimension of the entire shipment would be that you're giving to your carrier. If its multiple boxes, you'd want to look at tutorials around Multi-Piece Shipments.

You can also see more in the references of the API what values you should be providing when using the Parcels endpoint.

Also, you can usually provide your Parcel dimensions inline with your requests for the parcels field.

mootrichard
  • 3,581
  • 13
  • 25
  • Is it possible to create order without parcel information in shippo ? @moontrichard – Mayank Vadiya Jul 16 '18 at 07:15
  • If you mean create a shipment, then no, you must have parcel information to determine the rates for a given shipment. If you are referring to their Orders API, then you don't actually need the Parcel information until you want to create a shipment. – mootrichard Jul 16 '18 at 22:40
  • How can I display Parcel Templates in my webapp using API? @mootrichard – Mayank Vadiya Jul 17 '18 at 05:55
  • You can use the Parcels endpoint to generate and retrieve a specific parcel you've created and then simply display that as an option to your user. Otherwise you can just have your own arbitrary dimensions and just create the Parcel each time you make a shipment. – mootrichard Aug 01 '18 at 18:39