Set Shipping Address
Set or update the shipping address for the checkout process.
Endpoint
POST /api/shop/checkout/shipping-addressRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Bearer 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)
| Field | Type | Description |
|---|---|---|
shippingAddress | object | Confirmed shipping address |
cartTotal | decimal | Updated cart total |
message | string | Success message |
Shipping Address Fields
| Field | Type | Description |
|---|---|---|
id | integer | Address ID |
firstName | string | First name |
lastName | string | Last name |
email | string | |
address | string | Street address |
city | string | City |
state | string | State/Province |
country | string | Country code |
postcode | string | Postal code |
phone | string | Phone 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

