Skip to main content

Class: SuppliersService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:50

Extends​

  • BaseService

Constructors​

Constructor​

new SuppliersService(client): SuppliersService

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

Parameters​

client​

TanqoryClient

Returns​

SuppliersService

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​

archive()​

archive(storeId, supplierId): Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:120

Archive supplier (soft delete)

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>


archiveSupplier()​

archiveSupplier(storeId, supplierId): Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:179

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>


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


create()​

create(storeId, data): Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:73

Create supplier

Parameters​

storeId​

string

data​
address?​

{ address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }

address.address1​

string

address.address2?​

string

address.city​

string

address.company?​

string

address.country​

string

address.firstName?​

string

address.lastName?​

string

address.phone?​

string

address.postalCode​

string

address.province​

string

company​

string

contactName?​

string

email?​

string

notes?​

string

paymentTerms?​

"NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"

phone?​

string

Returns​

Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>


createSupplier()​

createSupplier(storeId, data): Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:153

Parameters​

storeId​

string

data​
address?​

{ address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }

address.address1​

string

address.address2?​

string

address.city​

string

address.company?​

string

address.country​

string

address.firstName?​

string

address.lastName?​

string

address.phone?​

string

address.postalCode​

string

address.province​

string

company​

string

contactName?​

string

email?​

string

notes?​

string

paymentTerms?​

"NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"

phone?​

string

Returns​

Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>


delete()​

delete(storeId, supplierId): Promise<{ success: boolean; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:97

Delete supplier (hard delete - only if no purchase orders)

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<{ success: boolean; }>


deleteSupplier()​

deleteSupplier(storeId, supplierId): Promise<void>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:167

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<void>


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


getDeletionInfo()​

getDeletionInfo(storeId, supplierId): Promise<APIResponse<SupplierDeletionInfo>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:107

Get supplier deletion info (for UI warnings)

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<APIResponse<SupplierDeletionInfo>>


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


getSupplier()​

getSupplier(storeId, supplierId): Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:148

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>


getSupplierDeletionInfo()​

getSupplierDeletionInfo(storeId, supplierId): Promise<SupplierDeletionInfo>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:171

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<SupplierDeletionInfo>


list()​

list(storeId, options?): Promise<ListSuppliersResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:54

List suppliers

Parameters​

storeId​

string

options?​

ListSuppliersOptions

Returns​

Promise<ListSuppliersResponse>


listSuppliers()​

listSuppliers(storeId, options?): Promise<ListSuppliersResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:141

Parameters​

storeId​

string

options?​

ListSuppliersOptions

Returns​

Promise<ListSuppliersResponse>


retrieve()​

retrieve(storeId, supplierId): Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:63

Get supplier by ID

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>


unarchive()​

unarchive(storeId, supplierId): Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:130

Unarchive supplier (restore)

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>


unarchiveSupplier()​

unarchiveSupplier(storeId, supplierId): Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:184

Parameters​

storeId​

string

supplierId​

string

Returns​

Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>


update()​

update(storeId, supplierId, data): Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:82

Update supplier

Parameters​

storeId​

string

supplierId​

string

data​

Partial<UpdateSupplierInput>

Returns​

Promise<APIResponse<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>>


updateSupplier()​

updateSupplier(storeId, supplierId, data): Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/suppliers.ts:158

Parameters​

storeId​

string

supplierId​

string

data​

Partial<UpdateSupplierInput>

Returns​

Promise<{ address?: { address1: string; address2?: string; city: string; company?: string; country: string; firstName?: string; lastName?: string; phone?: string; postalCode: string; province: string; }; archivedAt?: Date; company: string; contactName?: string; createdAt: Date; currency: string; email?: string; id: string; isArchived?: boolean; notes?: string; paymentTerms?: "NONE" | "CASH_ON_DELIVERY" | "PAYMENT_ON_RECEIPT" | "NET_7" | "NET_15" | "NET_30" | "NET_45" | "NET_60" | "NET_90"; phone?: string; storeId: string; totalOrders: number; totalSpent: { amount: number; currency: string; }; updatedAt: Date; }>