API overview
Save a customer address
Choose an operation to see its request, response shape, access rules and implementation source.
WriteAuthenticated
POST/api/v1/addresses
Save a customer address
Sanctum session or bearer token. Required bearer ability: addresses.create
Request
| Field | In | Rule |
|---|---|---|
name, line1 | JSON body | Required strings; max 255 characters each. |
city | JSON body | Required string; max 120. |
postal_code | JSON body | Required string; max 20. |
country | JSON body | Required string; exactly 2 characters. |
label | JSON body | Nullable string; max 80. |
company, line2 | JSON body | Nullable strings; max 255 each. |
region | JSON body | Nullable string; max 120. |
phone | JSON body | Nullable string; max 40. |
is_default_billing, is_default_shipping | JSON body | Optional booleans; omitted flags become false, including on PATCH. |
properties | JSON body | Nullable array. Supported aliases and precedence: see the address schema below. |
curl --request POST "https://shop.example.test/api/v1/addresses" \
--header 'Accept: application/json' \
--header "Authorization: Bearer $API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{"name":"Alex Example","line1":"Example Street 1","city":"Brussels","postal_code":"1000","country":"BE"}'Response200
Success: 200
Response shape (notation, not a captured response)
{ data: Address }Common errors
| HTTP status | Meaning |
|---|---|
401 | unauthenticated: missing or invalid authentication. |
403 | unauthorized, insufficient_scope or ip_not_allowed: check account context, required ability and token IP policy. |
422 | validation_error: invalid input or unmet domain requirements. Payment initiation can also return payment_failed. |
429 | rate_limited: back off before retrying, especially writes. |