Ship products directly to an address with the Direct Send send method.
direct_send
).
There are two things to be aware of when using direct send:
mailing_address
field of the recipient object.mailing_address
object to the recipient object. Here’s an example:
variants_num_selectable
is null or zero), you don’t need to specify any variants.
variants_label
tells you the name of the variant. This can be something like Size, Flavor, Color, etc.
variants_num_selectable
tells you how many variants can be selected. This is the expected length of the variants
array that you pass into the cart item. Typically, this is 1, but some products let you select more than one variant, such as a 3-pack of cookies. If this is null or 0
, then you don’t need to specify any variants.
variants
shows you the data for each variant. You’ll use the name
field of the variant when passing variants in the cart item.
variants_num_selectable
equal to 1
, so we must specify one variant in the cart item. Our cart item now looks like this:
variants_num_selectable
equal to 3
, then we must specify three variants in the cart item. Our cart item now looks like this:
variants_num_selectable
is 1
).