curl --request POST \
--url https://api.fabric.inc/v3/customers/{customerId}/customer-address/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"id": {
"op": "IN",
"value": "61df41892bf06d00092d0d8a"
},
"type": {
"op": "IN",
"value": "BILLING"
},
"addressLine1": {
"op": "IN",
"value": "123 Main St."
},
"city": {
"op": "IN",
"value": "Seattle"
},
"region": {
"op": "IN",
"value": "WA"
},
"postalCode": {
"op": "IN",
"value": 98121
},
"county": {
"op": "IN",
"value": "King County"
},
"country": {
"op": "IN",
"value": "US"
},
"latitude": {
"op": "LTE",
"value": 47.6205
},
"longitude": {
"op": "LTE",
"value": -77.0364
},
"createdAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"updatedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"deletedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"additionalAttributes": {
"op": "IN",
"key": "gps",
"value": "beach"
},
"isDeleted": false,
"isDefault": true
},
"sort": "-createdAt",
"offset": 0,
"limit": 10
}
'{
"query": {
"offset": 0,
"limit": 20,
"count": 100
},
"data": [
{
"id": "61604a30fdfacd0009816e44",
"address": {
"type": "BILLING",
"addressLine1": "123 Main St.",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Doe",
"city": "Seattle",
"region": "WA",
"postalCode": 98121,
"county": "King County",
"country": "US",
"latitude": 47.6205,
"longitude": -122.3493
},
"isDeleted": false,
"createdAt": "2023-08-30T23:20:42.822Z",
"updatedAt": "2023-08-30T23:20:42.822Z",
"additionalAttributes": {
"landmark": "Beach"
},
"isDefault": false,
"deletedAt": "2023-08-30T23:20:42.822Z"
}
]
}With this endpoint, you can search for customer’s addresses based on the specified filter conditions. In addition, you can tailor the search results by including or excluding the deleted addresses and the default addresses.
Note:A customer can have a default address for both billing and shipping.
curl --request POST \
--url https://api.fabric.inc/v3/customers/{customerId}/customer-address/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"match": {
"id": {
"op": "IN",
"value": "61df41892bf06d00092d0d8a"
},
"type": {
"op": "IN",
"value": "BILLING"
},
"addressLine1": {
"op": "IN",
"value": "123 Main St."
},
"city": {
"op": "IN",
"value": "Seattle"
},
"region": {
"op": "IN",
"value": "WA"
},
"postalCode": {
"op": "IN",
"value": 98121
},
"county": {
"op": "IN",
"value": "King County"
},
"country": {
"op": "IN",
"value": "US"
},
"latitude": {
"op": "LTE",
"value": 47.6205
},
"longitude": {
"op": "LTE",
"value": -77.0364
},
"createdAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"updatedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"deletedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"additionalAttributes": {
"op": "IN",
"key": "gps",
"value": "beach"
},
"isDeleted": false,
"isDefault": true
},
"sort": "-createdAt",
"offset": 0,
"limit": 10
}
'{
"query": {
"offset": 0,
"limit": 20,
"count": 100
},
"data": [
{
"id": "61604a30fdfacd0009816e44",
"address": {
"type": "BILLING",
"addressLine1": "123 Main St.",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Doe",
"city": "Seattle",
"region": "WA",
"postalCode": 98121,
"county": "King County",
"country": "US",
"latitude": 47.6205,
"longitude": -122.3493
},
"isDeleted": false,
"createdAt": "2023-08-30T23:20:42.822Z",
"updatedAt": "2023-08-30T23:20:42.822Z",
"additionalAttributes": {
"landmark": "Beach"
},
"isDefault": false,
"deletedAt": "2023-08-30T23:20:42.822Z"
}
]
}The access token.
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
"517fa9dfd42d8b00g1o3k312"
A UUID of the request.
A 24-character system-generated ID of the customer. This is returned in the response of the POST /customers endpoint.
"61a558b1b155125f02be7fb1"
A sample request to search for the customer's addresses.
The criteria to search for customer's addresses.
match
Show child attributes
The criteria to search based on the type of address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The type of address.
BILLING, SHIPPING "BILLING"
The criteria to search by the first, second, or third line of the customer's address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The first, second, or third line of the customer's address.
"123 Main St."
The criteria to search for customer's addresses based on the city given in the address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations. - IN - NOT_IN - EQUALS - CONTAINS - NOT_EQUALS
"IN"
The city name.
"Seattle"
The criteria to search for customer's addresses based on the region given in the address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The region name.
"WA"
The criteria to search for customer's addresses based on postalCode given in the address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The postal or ZIP code of the address.
98121
The criteria to search for customer's address based on the county given in the address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations. - IN - NOT_IN - EQUALS - CONTAINS - NOT_EQUALS
"IN"
The county name.
"King County"
The criteria to search for the customer's address based on the country given in the address.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The country code, which can be a full name, ISO 3166-1 alpha-2, or an alpha-3 code.
"US"
The criteria to search for customer's address based on latitude or a range of latitudes given in the address.
Show child attributes
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS, LTE, GTE, GT, LT, RANGE "LTE"
The latitude value in decimal degrees format; negative is degrees West.
47.6205
The starting value of the latitude range. This is used with the endLatitude property. The coordinates are provided in decimal degrees format, with negative values indicating locations to the west.
47.6205
The ending value of the latitude range. This is used with the startLatitude property. The coordinates are provided in decimal degrees format, with negative values indicating locations to the west.
47.6205
{ "op": "LTE", "value": 47.6205 }The criteria to search for customer's address based on longitude or a range of longitude given in the address.
Show child attributes
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS, LTE, GTE, GT, LT, RANGE "LTE"
The longitude value in decimal degrees format; negative is degrees West.
-77.0364
The starting value of the longitude range. This is used with the endLongitude property and formatted to decimal degrees; negative is degrees West.
-77.0364
The ending value of the longitude range. This is used with the startLongitude property and formatted to decimal degrees; negative is degrees West.
-77.0364
{ "op": "LTE", "value": -77.0364 }The criteria to search for customers or their addresses based on a specific creation date or within a creation date range.
Show child attributes
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS, LTE, GTE, GT, LT, RANGE "LTE"
The time of creation, in UTC format.
"2023-08-30T23:20:42.822Z"
The starting value of the creation date range. This is used with the endCreatedAt property.
"2023-08-30T23:20:42.822Z"
The ending value of the creation date range. This is used with the startCreatedAt property.
"2023-08-31T23:20:42.822Z"
{
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
}The criteria to search for customers or their addresses based on a specific date or date range in which the record was updated.
Show child attributes
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS, LTE, GTE, GT, LT, RANGE "LTE"
The time of last update, in UTC format.
"2023-08-30T23:20:42.822Z"
The starting value of the updatedAt date range. This is used with the endUpdatedAt property.
"2023-08-30T23:20:42.822Z"
The ending value of the updatedAt date range. This is used with the startUpdatedAt property.
"2023-08-31T23:20:42.822Z"
{
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
}The criteria to search for customers or their addresses based on a specific deletion date or within a deletion date range.
Show child attributes
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS, LTE, GTE, GT, LT, RANGE "LTE"
The time of deletion, in UTC format.
"2023-08-30T23:20:42.822Z"
The starting value of the deletedAt date range. This is used with the endDeletedAt property.
"2023-08-30T23:20:42.822Z"
The ending value of the deletedAt date range. This is used with the startDeletedAt property.
"2023-08-31T23:20:42.822Z"
{
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
}The criteria to search for customers or their addresses based on additional attributes. The criteria to search by a string value.
Show child attributes
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN, NOT_IN, EQUALS, CONTAINS, NOT_EQUALS "IN"
The key for the additional attribute. This should be the field name given in the additionalAttributes schema.
"gps"
The value of the string.
"beach"
A flag indicating whether the search results should include only deleted addresses. Set to true to include only deleted addresses and false to exclude deleted addresses.
true, false false
A flag indicating whether the search results should include only default addresses. Set to 'true' to include only default addresses and 'false' to exclude default addresses.
true, false true
The criteria to sort results, where - indicates a descending order and + indicates an ascending order. You can sort the following fields - createdAt, updatedAt, type, and country.
"-createdAt"
The number of records to skip before returning records. For example, when offset is 20 and limit's 10, this endpoint returns records from 21 to 30.
0
The maximum number of records in a single page.
10
OK
The list of customer addresses for the customerId.
The pagination criteria.
Show child attributes
The number of records to skip before returning records. For example, when offset is 20 and limit's 10, you get records from 21 to 30. When they're not specified, you get up to 10 records.
0
The maximum number of records per page.
20
The total number of records in the response.
100
addresses of the sent customer
Show child attributes
A 24-character system-generated ID of the address.
"61604a30fdfacd0009816e44"
The address details.
Show child attributes
The address type.
BILLING, SHIPPING "BILLING"
The first line of the address.
"123 Main St."
The second line of the address.
"Suite 100"
The third line of the address.
"Seventh floor"
The fourth line of the address.
"Attention: Pat E. Doe"
The city name in the address.
"Seattle"
The region or state name in the address.
"WA"
The postal or ZIP code of the address.
98121
The administrative division or county within a country or state.
"King County"
The country code, which can be a full name, or an ISO 3166-1 alpha-2 or alpha-3 code.
"US"
The geographical latitude used with longitude to locate the exact address. The coordinates are provided in decimal degrees format, with negative values indicating locations to the west.
47.6205
The geographical longitude used with latitude to locate the exact address. The coordinates are provided in decimal degrees format, with negative values indicating locations to the west.
-122.3493
A flag indicating whether the address is deleted. true indicates the address is deleted and false indicates otherwise.
false
The time when the address was created, in UTC format.
"2023-08-30T23:20:42.822Z"
The time when the address was the last updated, in UTC format.
"2023-08-30T23:20:42.822Z"
A placeholder for additional info, in key-value pairs.
{ "landmark": "Beach" }A flag indicating whether the address is the default one.true indicates the given address is the default address and false indicates otherwise.
false
The time when the address was deleted, in UTC format.
"2023-08-30T23:20:42.822Z"
Was this page helpful?