curl --request POST \
--url https://{host}/v1/me/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "addresses",
"attributes": {
"kind": "shipping",
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Keizersgracht 1",
"zipcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"default": true
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'addresses',
attributes: {
kind: 'shipping',
name: 'Jeffrey',
lastName: 'Ponsen',
addressLine1: 'Keizersgracht 1',
zipcode: '1015 CJ',
city: 'Amsterdam',
country: 'NL',
default: true
}
}
})
};
fetch('https://{host}/v1/me/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/me/addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'addresses',
'attributes' => [
'kind' => 'shipping',
'name' => 'Jeffrey',
'lastName' => 'Ponsen',
'addressLine1' => 'Keizersgracht 1',
'zipcode' => '1015 CJ',
'city' => 'Amsterdam',
'country' => 'NL',
'default' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/addresses"
payload = { "data": {
"type": "addresses",
"attributes": {
"kind": "shipping",
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Keizersgracht 1",
"zipcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"default": True
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"type": "addresses",
"id": "661",
"attributes": {
"kind": "shipping",
"companyName": null,
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Grote Staat 14",
"addressLine2": null,
"zipcode": "6211 CW",
"city": "Maastricht",
"country": "NL",
"default": true,
"createdAt": "2026-04-02T08:00:00.000000Z",
"updatedAt": "2026-04-02T08:00:00.000000Z"
},
"links": {
"self": "https://api.wristler.eu/v1/me/addresses/661"
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Create address
Scope: account:write
kind is shipping or billing — not type, which JSON:API reserves for the
resource itself. country is an ISO 3166-1 alpha-2 code of any country: whether we
ship there is asked at the checkout, which answers 422 country_not_shipped_to for
one we do not.
Required: kind, name, lastName, addressLine1, zipcode, city and
country. Optional: companyName, addressLine2 and default. Text is up to 255
characters, zipcode up to 32. addressLine1 needs a digit in it (a house number),
as the checkout asks; without one it is 422 with the pointer on addressLine1.
Setting default takes it off whichever address of that kind had it: two
defaults is not a state a checkout can act on.
curl --request POST \
--url https://{host}/v1/me/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "addresses",
"attributes": {
"kind": "shipping",
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Keizersgracht 1",
"zipcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"default": true
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'addresses',
attributes: {
kind: 'shipping',
name: 'Jeffrey',
lastName: 'Ponsen',
addressLine1: 'Keizersgracht 1',
zipcode: '1015 CJ',
city: 'Amsterdam',
country: 'NL',
default: true
}
}
})
};
fetch('https://{host}/v1/me/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/me/addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'addresses',
'attributes' => [
'kind' => 'shipping',
'name' => 'Jeffrey',
'lastName' => 'Ponsen',
'addressLine1' => 'Keizersgracht 1',
'zipcode' => '1015 CJ',
'city' => 'Amsterdam',
'country' => 'NL',
'default' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/addresses"
payload = { "data": {
"type": "addresses",
"attributes": {
"kind": "shipping",
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Keizersgracht 1",
"zipcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"default": True
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"type": "addresses",
"id": "661",
"attributes": {
"kind": "shipping",
"companyName": null,
"name": "Jeffrey",
"lastName": "Ponsen",
"addressLine1": "Grote Staat 14",
"addressLine2": null,
"zipcode": "6211 CW",
"city": "Maastricht",
"country": "NL",
"default": true,
"createdAt": "2026-04-02T08:00:00.000000Z",
"updatedAt": "2026-04-02T08:00:00.000000Z"
},
"links": {
"self": "https://api.wristler.eu/v1/me/addresses/661"
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Authorizations
Headers
Optional. A UUID per logical operation, not per attempt: a retry carrying the same key gets the first attempt's answer back, headers and all, rather than performing the write twice. Honoured for 24 hours.
A refusal is an answer. A 422 is remembered like any other, so sending a
corrected body under the same key answers 422 idempotency_key_reuse rather
than accepting the correction — the point of a key is that one key means one
decision. Use a new key for a new attempt at the request, and keep the old one
only for retrying the same bytes after a timeout.
A 5xx is the exception: nothing was decided, so the key is released and the
same one may be retried.
| Refusal | Status | code |
|---|---|---|
| The same key with a different body | 422 | idempotency_key_reuse |
| The first request with this key is still running | 409 | idempotency_in_progress |
| The key's record vanished between two requests: retry with a new key | 409 | idempotency_conflict |
| A key longer than 191 characters | 400 | idempotency_key_invalid |
A replayed answer carries Idempotent-Replay: true.
191