Skip to main content

Class: CustomerAddressesService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:16

Extends​

  • BaseService

Constructors​

Constructor​

new CustomerAddressesService(client): CustomerAddressesService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12

Parameters​

client​

TanqoryClient

Returns​

CustomerAddressesService

Inherited from​

BaseService.constructor

Properties​

client​

protected client: TanqoryClient

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10

Inherited from​

BaseService.client

Methods​

addAddress()​

addAddress(customerId, data, storeId?): Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:32

Add a customer address

Adds a new shipping or billing address to a customer's profile.

Parameters​

customerId​

string

Customer ID

data​

Address data

address1​

string

address2?​

string

city​

string

company?​

string

country​

string

firstName​

string

isDefault?​

boolean

lastName​

string

phone?​

string

postalCode​

string

province​

string

storeId?​

string

Store ID (optional, uses current store if not provided)

Returns​

Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Created address


buildQuery()​

protected buildQuery(options?): Record<string, any>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26

Build query parameters

Parameters​

options?​

ListOptions

Returns​

Record<string, any>

Inherited from​

BaseService.buildQuery


deleteAddress()​

deleteAddress(customerId, addressId, storeId?): Promise<{ deleted: true; id: string; object: "customer_address"; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:99

Delete a customer address

Permanently deletes a customer address.

Parameters​

customerId​

string

Customer ID

addressId​

string

Address ID

storeId?​

string

Store ID (optional, uses current store if not provided)

Returns​

Promise<{ deleted: true; id: string; object: "customer_address"; }>

Deletion confirmation


generateIdempotencyKey()​

protected generateIdempotencyKey(prefix): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:19

Generate idempotency key

Parameters​

prefix​

string

Returns​

string

Inherited from​

BaseService.generateIdempotencyKey


getAddresses()​

getAddresses(customerId, storeId?): Promise<{ addresses: object[]; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:55

Get customer addresses

Retrieves all addresses for a customer.

Parameters​

customerId​

string

Customer ID

storeId?​

string

Store ID (optional, uses current store if not provided)

Returns​

Promise<{ addresses: object[]; }>

List of customer addresses


getExportMimeType()​

protected getExportMimeType(format): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:45

Get MIME type for export format

Parameters​

format​

string

Returns​

string

Inherited from​

BaseService.getExportMimeType


setDefaultAddress()​

setDefaultAddress(customerId, addressId, storeId): Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:119

Set a customer address as the default

Parameters​

customerId​

string

Customer ID

addressId​

string

Address ID to set as default

storeId​

string

Store ID

Returns​

Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Updated address


updateAddress()​

updateAddress(customerId, addressId, data, storeId?): Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/customer-addresses.ts:74

Update a customer address

Updates an existing customer address.

Parameters​

customerId​

string

Customer ID

addressId​

string

Address ID

data​

UpdateCustomerAddressRequest

Address update data

storeId?​

string

Store ID (optional, uses current store if not provided)

Returns​

Promise<{ address1: string; address2?: string; city: string; company?: string; country: string; firstName: string; id: string; isDefault: boolean; lastName: string; phone?: string; postalCode: string; province: string; }>

Updated address