List Customer Addresses

The Payiano list customers addresses endpoint is like a digital address book for businesses. It helps them see all their customers' addresses in one place. This is super helpful for sending out products, creating special offers that target people in certain areas, and making sure customers feel taken care of by offering them deals and news that match where they live. By having easy access to this list, businesses can make sure products reach the right place, create a connection by personalizing their services, and keep customers happy by understanding their needs better.

GET/customer_addresses
Sandbox: https://api.payiano.dev/v1/customer_addresses
Live: https://api.payiano.com/v1/customer_addresses
Security
  • Authorization header with access token is required to access this endpoint: Bearer ACCESS-TOKEN
  • Your access token should be associated to this permission customer_addresses_view
Request
Request body schema:
application/json
Query parameters:
page
Type: integer|null
Default: 1

The page number to be retrieved, for the list of customer address. So, a combination of page=1 and per_page=25 returns the first 25 customer address. A combination of page=2 and per_page=25 returns the next 25 customer address.

per_page
Type: integer|null
Default: 25
Possible values: [1 ... 200]

The maximum number of customer address to return in the response.

includes
Type: array_of_enums|null
Possible values:
[
"customer_address.country" ]

A list of additional customer address relations to return, if available. Feel free to send the relations you would like to return with every item. See Including Resources to better understand how this is working.

Response
200
Response schema:
application/json
Response body:
total_pages
Type: integer

The total number of pages that are available for the customer address search criteria.

current_page
Type: integer

The current pagination page.

per_page
Type: integer

The amount of customer address items return per page.

total_items
Type: integer

The total number of customer address that match the search criteria.

items
Type: array_of_objects

The list of customer address that match the search criteria.

id
Type: ulid
Length: 26

The unique ID assigned to each customer address which is generated by our system using the ULID format. Each ID is precisely 26 characters long, ensuring a unique and consistent identifier for every customer address. This ULID is automatically created by our system and is used to uniquely identify and track each customer address in our database.

country_code
Type: string

Specify the unique two-letter country code ( e.g EG, SA or AE ) corresponding to the country where customer is located. This code is part of the standard international country codes set by the ISO .

type
Type: enum
Possible values:
[
"BILLING_ADDRESS", "SHIPPING_ADDRESS" ]

This attribute is used to differentiates between types of customer addresses, such as billing or shipping address.

is_default
Type: boolean
Default: false

This attribute specifies if the address is the default one selected for the customer for billing or shipping purposes. It comes into play when the user is directed to the checkout page or when an order is being delivered to them.

reference_id
Type: string|null
Max: 50

It's a unique identifier assigned to each customer address. It's primary role is to distinguish one customer address from another, ensuring that each customer address can be individually tracked and managed without any confusion. Please notice that duplicate values are not allowed and it's allowed to use alpha dash only [A-Za-z0-9-_]. The reference_id value is used to Identify Resource when you consume any customer address endpoint with sending identify_by query parameter with value reference_id.

line_one
Type: string|null
Min: 2
Max: 255

This attribute is the primary address line. This is where the first part of the address is written, usually the house number and street name. It's where the mail starts to find where you live or work.

line_two
Type: string|null
Min: 2
Max: 255

An optional secondary address line used for additional information like apartment, suite, or building numbers that help refine the location for delivery services.

city
Type: string|null
Min: 2
Max: 50

This attribute specifies the city in which the address is located. It's essential for routing mail and deliveries within the correct geographical area.

state
Type: string|null
Min: 2
Max: 50

The state or region attribute further narrows down the location, especially in countries with large geographical areas divided into states, provinces, or regions.

zip_code
Type: string|null
Min: 2
Max: 30

Also known as postal code in some regions, this numeric or alphanumeric code is critical for sorting mail and determining delivery routes with precision.

phone_number
Type: string|null
Max: 30

A primary contact number that can be a mobile or cellular number, providing a direct line to the individual or entity associated with the address.

landline_number
Type: string|null
Max: 30

An alternative to the mobile number, this is a fixed-line telephone number associated with the location, useful for contact purposes where mobile signals may be unreliable.

fax_number
Type: string|null
Max: 30

Not used as much these days, but it's a number where you can receive documents sent over a telephone line.

first_name
Type: string|null
Min: 2
Max: 50

The given name of the individual associated with the address, important for personalizing communication and ensuring the correct recipient for mail or services.

last_name
Type: string|null
Min: 2
Max: 50

The family or surname of the individual, completing the personal identification and used in conjunction with the first name for full clarity on the recipient's identity.

is_deleted
Type: boolean
Default: false

This value indicates whether the customer address is deleted or not. This flag can be used to control the customer address's availability in runtime without actual deleting or removing the customer address from records. A true value means the customer address is deleted, while a false value implies that the customer address is not deleted and functioning.

location
Type: object|null

This attribute is used to offer a precise, geographical identification of a place, which is crucial for various applications like mapping, navigation, and location-based services.

lat
Type: decimal
Min: -90
Max: 90

This stands for latitude. It's a way to tell exactly where the address is on the Earth using GPS. It tells you how far north or south the place is.

lng
Type: decimal
Min: -180
Max: 180

This is the longitude. Like latitude, but it tells you how far east or west the place is. Together with latitude, it can pinpoint any location on the globe.

note
Type: string|null
Min: 2
Max: 255

This free-text field allows for additional information or special instructions related to the address or delivery preferences to be included.

customer_id
Type: ulid

This field is the key to associating each address with the correct customer account, enhancing the personalization and accuracy of the transaction process. It's not only enhances transaction precision but also contributes significantly to effective customer relationship management and data analysis.

country
Type: object

This attribute is used to offer a precise, geographical identification of a place, which is crucial for various applications like mapping, navigation, and location-based services.

code
Type: string

It implies the unique two-letter country code ( e.g EG, SA or AE ) corresponding to the country. This code is part of the standard international country codes set by the ISO .

dial_code
Type: string

The international dialing code for the country, such as +1 for the United States, +44 for the United Kingdom or +20 for Egypt. This code is crucial for making international telephone calls and can be used in applications that require user phone number verification.

currency_code
Type: string

This attribute describes the official currency used in the country, typically denoted by its ISO currency code, such as USD for the United States Dollar, EUR for the Euro or EGP for Egyptian Pound.

name
Type: string

The official name of the country in English. This is the commonly recognized name that would be used in international contexts and is essential for any application that references countries by name.

name_ar
Type: string|null

The name of the country in Arabic. This attribute is particularly useful for applications serving Arabic-speaking users, allowing for a localized experience by presenting country names in the native script.

lang
Type: string|null

This attribute represents the primary language spoken in the country. It's typically expressed in ISO 639-1 format, a two-letter code identifying the language, making it easier for applications to adapt content or interfaces according to the user's region.

flag
Type: string|null

A Unicode representation of the country's flag. Unlike an image URL, Unicode flags are character codes that render as the country's flag emoji across compatible digital platforms. This allows for easy integration of flags into text-based content and interfaces without needing external images.

created_at
Type: datetime

The created datetime of the customer address. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

updated_at
Type: datetime

The updated datetime of the customer address. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

deleted_at
Type: datetime|null

The deleted datetime of the customer address. This attribute can be formatted as an ISO 8601 string or a UNIX timestamp in milliseconds, depending on the preferred datetime format specified in the request header (e.g., 2024-08-04T14:22:01Z or 1722572118554). By default, the format is UNIX timestamp in milliseconds.

Response sample:
1
{
2 "per_page": 25, 3 "total_pages": 1, 4 "total_items": 1, 5 "current_page": 1, 6
"items": [
7
{
8 "id": "01ht3tph1szfa5b02qsay22hk1", 9 "country_code": "EG", 10 "type": "BILLING_ADDRESS", 11 "is_default": true, 12 "reference_id": "96bf2bca-61c0-3eba-bc85-bfae3bcfd85f", 13 "line_one": "7th Makram Ebid, Nasr City", 14 "line_two": "Building 174, apartment 12", 15 "city": "Cairo", 16 "state": "Nasr City", 17 "zip_code": "11321", 18 "phone_number": "+201000333000", 19 "landline_number": "6546543213216", 20 "fax_number": "5456464646", 21 "first_name": "Mohsen", 22 "last_name": "Osama", 23 "is_deleted": false, 24
"location": {
25 "lat": 21.32, 26 "lng": 12.63 27 }, 28 "note": null, 29 "customer_id": "01hqjp3f48879znt9v4dysrk2r", 30
"country": {
31 "code": "EG", 32 "dial_code": "+20", 33 "currency_code": "EGP", 34 "name": "Egypt", 35 "name_ar": "مصر", 36 "lang": "AR", 37 "flag": "🇪🇬" 38 }, 39 "created_at": "1722572118554", 40 "updated_at": "1722572118554", 41 "deleted_at": null 42 } 43 ] 44}