Set the default address
On behalf of a member ·
x-on-behalf-of required
Physical card applications without address_id are shipped to this address.
Idempotency: if it is already the default, returns 200 unchanged without an error. No idempotency key is required. The action itself is idempotent, so requiring a key would add unnecessary work (the same criterion as DELETE /v1/withdraw-addresses/{id}).
Clearing the previous default and setting the new default happen in one transaction. There is no intermediate state with two defaults or no default.
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Required |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-on-behalf-of |
string | Required |
Response
200Set as default
404
not_foundRequest
curl -X POST 'https://api.zinfra.vip/v1/shipping-addresses/{id}/default' \
-H 'x-auth-token: Bearer $TOKEN' \
-H 'x-on-behalf-of: $MEMBER_ID'const res = await fetch("https://api.zinfra.vip/v1/shipping-addresses/{id}/default", {
method: "POST",
headers: {
"x-auth-token": "Bearer $TOKEN",
"x-on-behalf-of": "$MEMBER_ID",
},
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();import requests
res = requests.post(
"https://api.zinfra.vip/v1/shipping-addresses/{id}/default",
headers={
"x-auth-token": "Bearer $TOKEN",
"x-on-behalf-of": "$MEMBER_ID",
},
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()req, _ := http.NewRequest("POST", "https://api.zinfra.vip/v1/shipping-addresses/{id}/default",
nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-on-behalf-of", "$MEMBER_ID")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.zinfra.vip/v1/shipping-addresses/{id}/default"))
.header("x-auth-token", "Bearer $TOKEN")
.header("x-on-behalf-of", "$MEMBER_ID")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
// Use String / BigDecimal for amounts, not double.$ch = curl_init('https://api.zinfra.vip/v1/shipping-addresses/{id}/default');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-auth-token: Bearer $TOKEN',
'x-on-behalf-of: $MEMBER_ID',
],
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
// No response example is declared in the specification for this operation.