Skip to content

Set Shipping Address

Set or update the shipping address for the checkout process.

Endpoint

POST /api/shop/checkout/shipping-address

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

Either use saved address ID or provide new address:

Option 1: Use Saved Address

json
{
  "addressId": 1
}

Option 2: New Address

json
{
  "firstName": "John",
  "lastName": "Doe",
  "email": "[email protected]",
  "address": "123 Main St",
  "city": "New York",
  "state": "NY",
  "country": "US",
  "postcode": "10001",
  "phone": "1234567890"
}

Response Fields (200 OK)

FieldTypeDescription
shippingAddressobjectConfirmed shipping address
cartTotaldecimalUpdated cart total
messagestringSuccess message

Shipping Address Fields

FieldTypeDescription
idintegerAddress ID
firstNamestringFirst name
lastNamestringLast name
emailstringEmail
addressstringStreet address
citystringCity
statestringState/Province
countrystringCountry code
postcodestringPostal code
phonestringPhone number

Use Cases

  • Set shipping destination
  • Calculate shipping costs
  • Validate address
  • Proceed to shipping method selection
  • Update address during checkout

Effects

  • Shipping methods are recalculated
  • Shipping cost may change
  • Cart total is updated
  • Address is locked for shipping

Released under the MIT License.