For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update an address

Fully updates an address. All required fields must be sent.

Important: When the new content differs from the current content, the current address is deactivated and the result is saved as a different record with a new pk. When the new content matches an address the account deleted earlier, that address is reactivated and returned; when it matches another active address of the account, that address is returned. Use the pk from the response for later requests.

  • The same field rules as on creation apply (ADDRESS_PHONE_MIN_LENGTH, ADDRESS_DISTRICT_REQUIRED, IDENTITY_NUMBER_VALIDATOR, ADDRESS_SERIALIZER_FIELDS, and CITY_FILTER_ENABLED when enabled).

  • When phone verification for addresses is enabled in VERIFICATION_TOKEN_CONF and phone_number differs from the account's phone number, a verification token is required.

  • USER_MAX_ADDRESS is not checked and the operation is not rate-limited.

put
/addresses/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the address. Only addresses of the calling account can be addressed; any other identifier returns 404.

Header parameters
X-Verification-TokenstringOptional

The phone verification token for phone_number. Needed only when phone verification for addresses is enabled and phone_number differs from the account's phone number.

Body

The body of a create or full update request.

The address is always assigned to the calling account: email and user are set from the account. Additional fields may be required, or extra fields accepted, according to the country-specific rules configured in ADDRESS_SERIALIZER_FIELDS; extra fields are sent as top-level string properties. When phone verification is enabled, verification_token may be sent here instead of in the X-Verification-Token header.

titlestring · min: 2 · max: 128Required

A label for the address.

Example: Home
first_namestring · min: 2 · max: 30Required

The recipient's first name.

Example: Jane
last_namestring · min: 2 · max: 30Required

The recipient's last name.

Example: Doe
phone_numberstringRequired

The recipient's phone number. Must be at least ADDRESS_PHONE_MIN_LENGTH characters long (11 by default).

Example: 05551234567
countryintegerRequired

The identifier of an existing country.

Example: 1
cityintegerRequired

The identifier of an existing city of country.

Example: 34
townshipintegerRequired

The identifier of an existing township of city. null is not accepted.

Example: 410
districtinteger · nullableOptional

The identifier of an existing district of township. Required and not nullable when ADDRESS_DISTRICT_REQUIRED is enabled.

Example: 5123
linestring · min: 10 · max: 255Required

The street address.

Example: Example Street No 12 Flat 3
postcodestring · max: 64 · nullableOptional

The post/zip code.

notesstring · nullableOptional

Delivery instructions.

company_namestring · max: 255 · nullableOptional

The company name for corporate invoices.

tax_officestring · max: 64 · nullableOptional

The tax office for corporate invoices.

tax_nostring · max: 20 · nullableOptional

The tax number for corporate invoices.

e_bill_taxpayerbooleanOptional

Whether the owner is registered for electronic invoicing.

Default: false
identity_numberstring · nullableOptional

The national identity number of the recipient, checked according to IDENTITY_NUMBER_VALIDATOR.

address_typestring · enumOptional

The kind of address. Only customer addresses are returned by the address endpoints.

  • customer — a delivery or billing address of a customer (default).
  • retail_store — the address of a retail store.
  • pickup_location — the address of a pickup point.
  • checkout_provider — an address supplied by an external checkout provider.
Possible values:
retail_storeinteger · nullableOptional

The identifier of an existing retail store.

remote_idstring · max: 1024 · nullableOptional

The identifier of the address in an external system.

primarybooleanOptional

true makes this the primary address and clears the flag on every other address of the account. On update, false removes the flag and omitting the field keeps it.

Default: false
verification_tokenstringOptional

A phone verification token for phone_number. Needed only when phone verification is enabled and phone_number differs from the account's phone number.

Other propertiesstringOptional

A country-specific extra field configured through ADDRESS_SERIALIZER_FIELDS.

Responses
200

The updated address. Its pk differs from the requested one when the content changed.

application/json

A customer address as returned by the address endpoints.

pkintegerRead-onlyOptional

The unique identifier of the address.

Example: 42
emailstring · emailOptional

The e-mail address of the owning account.

Example: jane.doe@example.com
phone_numberstringOptional

The recipient's phone number.

Example: 05551234567
first_namestringOptional

The recipient's first name.

Example: Jane
last_namestringOptional

The recipient's last name.

Example: Doe
countryintegerOptional

The identifier of the country.

Example: 1
cityintegerOptional

The identifier of the city.

Example: 34
townshipintegerOptional

The identifier of the township.

Example: 410
districtinteger · nullableOptional

The identifier of the district, or null.

Example: 5123
linestringOptional

The street address.

Example: Example Street No 12 Flat 3
titlestringOptional

The label of the address.

Example: Home
postcodestring · nullableOptional

The post/zip code.

Example: 34710
notesstring · nullableOptional

Delivery instructions.

Example: Ring the bell twice.
company_namestring · nullableOptional

The company name for corporate invoices.

tax_officestring · nullableOptional

The tax office for corporate invoices.

tax_nostring · nullableOptional

The tax number for corporate invoices.

e_bill_taxpayerbooleanOptional

Whether the owner is registered for electronic invoicing.

Example: false
hash_datastringRead-onlyOptional

The fingerprint of the address content, used to detect duplicates.

Example: 3f1c2a9b8e7d6c5b4a39281706f5e4d3
address_typestring · enumOptional

The kind of address. Only customer addresses are returned by the address endpoints.

  • customer — a delivery or billing address of a customer (default).
  • retail_store — the address of a retail store.
  • pickup_location — the address of a pickup point.
  • checkout_provider — an address supplied by an external checkout provider.
Possible values:
retail_storeinteger · nullableOptional

The identifier of the related retail store, or null.

remote_idstring · nullableOptional

The identifier of the address in an external system.

identity_numberstring · nullableOptional

The national identity number of the recipient.

extra_fieldobject · nullableRead-onlyOptional

The values of the country-specific extra fields, keyed by field name, or null when none is stored.

userinteger · nullableOptional

The identifier of the owning user.

Example: 7
is_corporatebooleanRead-onlyOptional

true when any corporate invoice field (company_name, tax_office, tax_no, e_bill_taxpayer) is set.

Example: false
primarybooleanOptional

Whether this is the primary address of the account.

Example: true
put/addresses/{id}/
PUT /api/v1/remote/1/addresses/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 441

{
  "title": "Home",
  "first_name": "Jane",
  "last_name": "Doe",
  "phone_number": "05551234567",
  "country": 1,
  "city": 34,
  "township": 410,
  "district": 5123,
  "line": "Example Street No 12 Flat 3",
  "postcode": null,
  "notes": null,
  "company_name": null,
  "tax_office": null,
  "tax_no": null,
  "e_bill_taxpayer": false,
  "identity_number": null,
  "address_type": "customer",
  "retail_store": null,
  "remote_id": null,
  "primary": false,
  "verification_token": "text",
  "ANY_ADDITIONAL_PROPERTY": "text"
}
{
  "pk": 42,
  "email": "jane.doe@example.com",
  "phone_number": "05551234567",
  "first_name": "Jane",
  "last_name": "Doe",
  "country": 1,
  "city": 34,
  "township": 410,
  "district": 5123,
  "line": "Example Street No 12 Flat 3",
  "title": "Home",
  "postcode": "34710",
  "notes": "Ring the bell twice.",
  "company_name": null,
  "tax_office": null,
  "tax_no": null,
  "e_bill_taxpayer": false,
  "hash_data": "3f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "address_type": "customer",
  "retail_store": null,
  "remote_id": null,
  "identity_number": null,
  "extra_field": null,
  "user": 7,
  "is_corporate": false,
  "primary": true
}

Last updated

Was this helpful?