Create an address
Creates an address in the address book of the calling account. The address is always assigned to the calling account: user and email are set from the account.
The request is checked against
ADDRESS_PHONE_MIN_LENGTH,ADDRESS_DISTRICT_REQUIRED,IDENTITY_NUMBER_VALIDATOR, and the country-specific rules ofADDRESS_SERIALIZER_FIELDS, and — when enabled in the server configuration — againstCITY_FILTER_ENABLEDandUSER_MAX_ADDRESS.When phone verification for addresses is enabled in
VERIFICATION_TOKEN_CONFandphone_numberdiffers from the account's phone number, a verification token must be sent in theX-Verification-Tokenheader or theverification_tokenfield.An active address with the same content is rejected with
406(address_100_6). A deleted address with the same content is reactivated and returned with its originalpk.With
USER_MAX_ADDRESSconfigured, the request is rejected with406(user_100_3) only when the account already has more active addresses than the limit, so an account can hold one more address than the configured value.primary: trueclears the primary flag on every other address of the account.The operation is rate-limited per account (5 requests per 60 seconds by default, configurable through
THROTTLING_SETTINGS).
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
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.
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.
A label for the address.
HomeThe recipient's first name.
JaneThe recipient's last name.
DoeThe recipient's phone number. Must be at least ADDRESS_PHONE_MIN_LENGTH characters long (11 by default).
05551234567The identifier of an existing country.
1The identifier of an existing city of country.
34The identifier of an existing township of city. null is not accepted.
410The identifier of an existing district of township. Required and not nullable when ADDRESS_DISTRICT_REQUIRED is enabled.
5123The street address.
Example Street No 12 Flat 3The post/zip code.
Delivery instructions.
The company name for corporate invoices.
The tax office for corporate invoices.
The tax number for corporate invoices.
Whether the owner is registered for electronic invoicing.
falseThe national identity number of the recipient, checked according to IDENTITY_NUMBER_VALIDATOR.
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.
The identifier of an existing retail store.
The identifier of the address in an external system.
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.
falseA phone verification token for phone_number. Needed only when phone verification is enabled and phone_number differs from the account's phone number.
A country-specific extra field configured through ADDRESS_SERIALIZER_FIELDS.
The created — or reactivated — address.
A customer address as returned by the address endpoints.
The unique identifier of the address.
42The e-mail address of the owning account.
jane.doe@example.comThe recipient's phone number.
05551234567The recipient's first name.
JaneThe recipient's last name.
DoeThe identifier of the country.
1The identifier of the city.
34The identifier of the township.
410The identifier of the district, or null.
5123The street address.
Example Street No 12 Flat 3The label of the address.
HomeThe post/zip code.
34710Delivery instructions.
Ring the bell twice.The company name for corporate invoices.
The tax office for corporate invoices.
The tax number for corporate invoices.
Whether the owner is registered for electronic invoicing.
falseThe fingerprint of the address content, used to detect duplicates.
3f1c2a9b8e7d6c5b4a39281706f5e4d3The 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.
The identifier of the related retail store, or null.
The identifier of the address in an external system.
The national identity number of the recipient.
The values of the country-specific extra fields, keyed by field name, or null when none is stored.
The identifier of the owning user.
7true when any corporate invoice field (company_name, tax_office, tax_no, e_bill_taxpayer) is set.
falseWhether this is the primary address of the account.
trueThe request contains invalid or missing data — for example a missing required field, a value shorter than its minimum length, a city that does not belong to the country, an identity number rejected by the configured validator, or a missing or invalid phone verification token (reported under verification_token). The response names the field each complaint belongs to; mismatches in the geographic hierarchy are reported under non_field_errors.
Authentication credentials were not provided or are invalid.
The request is well-formed but violates an address rule — an active address with the same content already exists, or the account has exceeded the configured address limit.
The address creation limit of the calling account (or of the caller's IP address, when nested windows are configured) was exceeded. detail carries a human-readable message that states how many seconds to wait, translated into the active language. The example shows the English text.
POST /api/v1/remote/1/addresses/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 207
{
"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": "34710",
"primary": true
}{
"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?

