The CommerceItemRelationship interface, which is implemented by ShippingGroupCommerceItemRelationship and PaymentGroupCommerceItemRelationship objects as described previously, contains a set of numeric methods (get/setQuantity(), get/setAmount(), get/setRange()). Certain method calls are valid depending on the relationship type. If an invalid method is called, the returned value is undefined. The table below summarizes which methods are valid with which relationship types.

Relationship Type

Valid Methods

ShippingQuantity

get/setQuantity(), get/setRange()

ShippingQuantityRemaining

get/setRange()

OrderAmount

get/setAmount()

OrderAmountRemaining

N/A

PaymentAmount

get/setAmount()

PaymentAmountRemaining

N/A

ShippingAmount

get/setAmount()

ShippingAmountRemaining

N/A

TaxAmount

get/setAmount()

TaxAmountRemaining

N/A