Skip to main content

Class: GiftCardViewsService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:54

Extends​

  • BaseService

Constructors​

Constructor​

new GiftCardViewsService(client): GiftCardViewsService

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

Parameters​

client​

TanqoryClient

Returns​

GiftCardViewsService

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​

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<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:104

Create a new gift card view

Parameters​

storeId​

string

data​

CreateGiftCardViewInput

Returns​

Promise<GiftCardView>

Example​

const view = await tanqory.giftCardViews.create('store_123', {
name: 'Active Cards',
filters: {
tabFilter: 'active',
search: '',
advancedFilters: {}
},
columns: ['code', 'customer', 'balance', 'status'],
isPinned: true
})

delete()​

delete(viewId, storeId): Promise<boolean>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:148

Delete a gift card view

Parameters​

viewId​

string

storeId​

string

Returns​

Promise<boolean>

Example​

await tanqory.giftCardViews.delete('view_123', 'store_123')

duplicate()​

duplicate(viewId, storeId): Promise<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:161

Duplicate an existing gift card view

Parameters​

viewId​

string

storeId​

string

Returns​

Promise<GiftCardView>

Example​

const duplicated = await tanqory.giftCardViews.duplicate('view_123', 'store_123')

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


getDefault()​

getDefault(storeId): Promise<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:217

Get the default view for a store

Parameters​

storeId​

string

Returns​

Promise<GiftCardView>

Example​

const defaultView = await tanqory.giftCardViews.getDefault('store_123')

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


getPinned()​

getPinned(storeId): Promise<GiftCardView[]>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:230

Get all pinned views for a store

Parameters​

storeId​

string

Returns​

Promise<GiftCardView[]>

Example​

const pinnedViews = await tanqory.giftCardViews.getPinned('store_123')

list()​

list(storeId): Promise<GiftCardView[]>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:63

List all gift card views for a store

Parameters​

storeId​

string

Returns​

Promise<GiftCardView[]>

Example​

const views = await tanqory.giftCardViews.list('store_123')

reorder()​

reorder(storeId, viewIds): Promise<GiftCardView[]>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:200

Reorder gift card views

Parameters​

storeId​

string

viewIds​

string[]

Returns​

Promise<GiftCardView[]>

Example​

const views = await tanqory.giftCardViews.reorder('store_123', [
'view_1',
'view_2',
'view_3'
])

retrieve()​

retrieve(viewId, storeId): Promise<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:79

Get a single gift card view by ID

Parameters​

viewId​

string

storeId​

string

Returns​

Promise<GiftCardView>

Example​

const view = await tanqory.giftCardViews.retrieve('view_123', 'store_123')

togglePin()​

togglePin(viewId, storeId): Promise<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:180

Toggle pin status of a gift card view

Parameters​

viewId​

string

storeId​

string

Returns​

Promise<GiftCardView>

Example​

const view = await tanqory.giftCardViews.togglePin('view_123', 'store_123')

update()​

update(viewId, storeId, data): Promise<GiftCardView>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/gift-card-views.ts:127

Update an existing gift card view

Parameters​

viewId​

string

storeId​

string

data​

UpdateGiftCardViewInput

Returns​

Promise<GiftCardView>

Example​

const updated = await tanqory.giftCardViews.update('view_123', 'store_123', {
name: 'Updated View Name',
isPinned: false
})