Save an address on a shopper
POST/shoppers/:shopperId/addresses
AddSavedAddress. The addressId derives from the Idempotency-Key, so a replay (even after the idempotency record expired) returns the same address. A shopper holds at most 20 saved addresses; the twenty-first is 422 too-many-addresses (ErrTooManyAddresses). A checkout can then name the address by its id (CheckoutRequest.shipToAddressId) and the address is copied into the order at placement.
Request
Responses
- 201
- 400
- 404
- 409
- 422
Address saved.
Response Headers
Relative URI of the saved address, /shoppers/{shopperId}/addresses/{addressId}.
"true" when the answer is the stored one of an earlier request with the same Idempotency-Key (a stored 2xx or a stored final 4xx answer, replayed with its original status and body); absent on the first execution. A refusal that a retry could pass (a RETRYABLE problem type, see the Idempotency-Key parameter) and a 5xx are never stored.
The request is not valid JSON, has an unknown field contains a NUL character or is larger than 64 KiB (malformed-request; there is no 413), or the Idempotency-Key header is missing (idempotency-key-required) or is not 1 to 128 printable ASCII characters (idempotency-key-invalid).
No shopper with this id (not-found).
The Idempotency-Key was already used with a different request (idempotency-key-reused).
The body breaks a value-object rule (validation-failed) or the twentieth address is already saved (too-many-addresses).