Skip to content

Set Shipping Address

Save a delivery address that differs from the billing address.

Endpoint

POST /api/shop/checkout-addresses

This is the same endpoint as Set Checkout Address — one call saves both addresses. There is no shipping-only endpoint, so the billing fields are required here too.

How the two addresses relate

useForShippingWhat to sendResult
trueBilling fields onlyThe billing address is copied to the shipping address.
falseBilling fields and the full shipping blockThe two are stored separately.

Omitting the shipping block while useForShipping is false fails the call — the shipping fields are not optional in that mode.

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
AcceptYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer <cartToken> for a guest, or the customer's Bearer token when signed in

Shipping Fields

FieldTypeRequiredDescription
shippingFirstNamestringYesFirst name at the delivery address.
shippingLastNamestringYesLast name.
shippingEmailstringYesContact email for the delivery.
shippingAddressstringYesStreet address.
shippingCitystringYesCity.
shippingStatestringYesState or region code.
shippingCountrystringYesTwo-letter country code.
shippingPostcodestringYesPostal code.
shippingPhoneNumberstringYesContact number for the courier.
shippingCompanyNamestringNoCompany at the delivery address.

The billing fields are listed on Set Checkout Address.

Use Cases

  • Gift orders — bill the buyer, deliver to the recipient.
  • Business deliveries — invoice a head office while shipping to a branch, using shippingCompanyName.

Best Practices

  1. Send both blocks in one call — there is no way to add a shipping address to an already-saved billing address without re-sending it
  2. Set useForShipping explicitly — leaving it out with no shipping block behaves as an incomplete address
  3. Re-read the rates afterwards — shipping cost depends on the destination, so the rate list changes when the shipping address does
  4. Use ISO codesUS, NY, not full names

Released under the MIT License.