Attaching shopper information will let you retrieve shipping options for a cart.
updateCartBuyerIdentity
mutation can be used to attach shipping information to a cart, which will then let you retrieve shipping options and the final cart cost.
deleteCartItems
and our cart price dropped below that threshold, we would see a non-zero shipping price.
If your provided address was invalid, then errors will be returned inside the top-level errors
field on the cart. You can see what this looks like if we pass an invalid postal code inside our input:
CartErrorCode
reference page. Error codes prefixed with BUYER_IDENTITY_
indicate an issue with the provided buyer identity, and if these are not resolved then checkout will fail.
updateCartBuyerIdentity
request:
store
and offer
fields on the AmazonStore
object. If you are ordering from Shopify, then these fields also exist on the ShopifyStore
object with a very similar structure.
The store
field acts as a unique identifier for the store. A single Rye cart can contain cart items from multiple merchants at the same time, and the stores
list lets you see how your cart items are broken up by store. In the case of a multi-store cart, each store will have its own shipping options available. Our example cart only needs to deal with a single store, which makes things slightly easier.
offer
field is available through any API operation that returns a cart, including getCart
. This is helpful if you forgot to request offer
when you first attached buyer identity information.shippingMethods
from a Shopify store, it may be because both of the following conditions are met:updateCartSelectedShippingOptions
mutation can be used to explicitly select your shopper’s preferred shipping method.
Cart
object here; we are not only limited to the id
field. Note that the shippingOptions
input is a list of shipping options; this is to support passing shipping options for multiple stores in a single API call. The store
field inside a shippingOptions
entry must align with the store
value on the corresponding AmazonStore
or ShopifyStore
objects.
BuyerIdentityInput
type are explicitly marked as being required, it is a good idea to provide as many fields as you can as we do run additional validation on these fields beyond what our schema advertises.
The exact set of validation rules applied depends on a variety of factors, but the destination country is the main one. For instance, provinceCode
is a required field when shipping to the USA but can be safely omitted when shipping to an address in the UK. In general, our address validation logic is aligned with local expectations around the formatting of addresses.
There are a few other things to keep in mind here when passing addresses to Rye:
email
you provide here will receive order update emails from Shopify. This can be inconvenient in cases where you are applying a mark up.
phone
value, if provided, must be a valid phone number in E.164 format.provinceCode
value should generally be a valid ISO 3166-2 code without the country code prefix. For instance, AUK
would represent the “Auckland” region of New Zealand. Providing the official code for the region is the most accurate method for specifying the delivery zone.
Auckland
) and our API will attempt to match that name to the correct code automatically.lastName
field is required, as some marketplaces we support ordering from also require this field. In some parts of the world, people do not have last names which can cause problems. Our recommendation in this case is to set lastName
to the name of your company to work around this marketplace limitation.
firstName: "John", lastName: "Rye"
.