Weight Object
Weight objects are used throughout ShipEngine Connect, such as for specifying the weight of a package.
Properties
This table lists the properties of a weight object and identifies those properties that are required. The nullable
column indicates which properties may be null when the object is provided as an argument to one of your methods, and the required
column indicates which properties are required when the object is returned from one of your methods
Name | Type | Required? | Nullable? | Description |
---|---|---|---|---|
value | number | ✔ | The weight value for this package. This value may contain decimals. | |
unit | string | ✔ | The unit of measure for this weight. Valid values include the following:
|
Additional Convenience Properties
This table lists some additional convenience properties and methods that are included when a weight object is
passed to one of your methods. None of these will ever be null
.
Name | Type | Description |
---|---|---|
ounces | number | The weight value in ounces. |
grams | number | The weight value in grams. |
toOunces() | method | A method that returns a new weight object in ounces. |
toGrams() | method | A method that returns a new weight object in grams. |