@deliverart/sdk-js- 发售点
交付艺术JavaScript SDK的销售点(POS)管理套件. 提供销售点的管理方法,它们的用户,菜单版本,时间覆盖,以及槽提供查询.
安装
npm install @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
# or
pnpm add @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
# or
yarn add @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
特征
- 销售点: 使用高级过滤器对销售点进行全面CRUD操作
- POS 用户: 管理与销售点有关的用户
- POS 菜单版本: 为特定销售点检索菜单版本
- POS 时间覆盖: 管理特别开放时间和关闭时间
- 可用时间: 获得统一的槽选项,并带有遗留的交付和取出兼容请求
使用量
销售点
获取销售点
import { GetPointOfSales } from '@deliverart/sdk-js-point-of-sale'
const pointsOfSale = await client.call(
new GetPointOfSales({
query: {
page: 1,
itemsPerPage: 20,
company: 'company-iri',
salesMode: ['delivery', 'pickup'],
},
}),
)
基于位置的搜索
您可以通过地址或地理坐标过滤销售点:
// Filter by address
const nearby = await client.call(
new GetPointOfSales({
query: {
address: '123 Main St, New York, NY',
maxDistance: 5000, // meters
},
}),
)
// Filter by coordinates (latitude|longitude)
const nearbyByCoords = await client.call(
new GetPointOfSales({
query: {
location: '40.7128|-74.0060', // New York coordinates
maxDistance: 5000, // meters
},
}),
)
说明双 address 财务报告和审定财务报表 location 是可选的。 如果两者都不提供,则会跳过基于距离的过滤并返回所有销售点(取决于其他过滤器).
获取公司销售点
import { GetCompanyPointOfSales } from '@deliverart/sdk-js-point-of-sale'
const companyPOS = await client.call(
new GetCompanyPointOfSales('company-id', {
query: {
page: 1,
itemsPerPage: 20,
},
}),
)
获取销售细节
import { GetPointOfSaleDetails } from '@deliverart/sdk-js-point-of-sale'
const pos = await client.call(new GetPointOfSaleDetails('pos-id'))
创建销售点
import { CreatePointOfSale } from '@deliverart/sdk-js-point-of-sale'
const newPOS = await client.call(
new CreatePointOfSale({
name: [
{ locale: 'en', value: 'Downtown Store' },
{ locale: 'it', value: 'Negozio Centro' },
],
company: '/api/companies/123',
address: {
street: '123 Main St',
city: 'New York',
postalCode: '10001',
country: 'US',
},
// ... other fields
}),
)
最新销售点
import { UpdatePointOfSale } from '@deliverart/sdk-js-point-of-sale'
const updated = await client.call(
new UpdatePointOfSale('pos-id', {
name: [{ locale: 'en', value: 'Updated Store Name' }],
}),
)
删除销售点
import { DeletePointOfSale } from '@deliverart/sdk-js-point-of-sale'
await client.call(new DeletePointOfSale('pos-id'))
POS 菜单版本
获取销售菜单版本的点
import { GetPointOfSaleMenuVersions } from '@deliverart/sdk-js-point-of-sale'
const menuVersions = await client.call(
new GetPointOfSaleMenuVersions('pos-id', {
query: {
page: 1,
itemsPerPage: 20,
},
}),
)
获取销售菜单版本的点
import { GetPointOfSaleMenuVersionDetails } from '@deliverart/sdk-js-point-of-sale'
const menuVersion = await client.call(
new GetPointOfSaleMenuVersionDetails('pos-id', 'menu-version-id'),
)
POS 用户
获取销售用户点
import { GetPointOfSaleUsers } from '@deliverart/sdk-js-point-of-sale'
const users = await client.call(
new GetPointOfSaleUsers({
query: {
page: 1,
itemsPerPage: 20,
},
}),
)
从销售点获取销售用户点
import { GetPointOfSaleUsersFromPointOfSale } from '@deliverart/sdk-js-point-of-sale'
const users = await client.call(
new GetPointOfSaleUsersFromPointOfSale('pos-id', {
query: {
page: 1,
itemsPerPage: 20,
},
}),
)
从用户获取销售用户点
import { GetPointOfSaleUsersFromUser } from '@deliverart/sdk-js-point-of-sale'
const associations = await client.call(
new GetPointOfSaleUsersFromUser('user-id', {
query: {
page: 1,
itemsPerPage: 20,
},
}),
)
获取销售点用户细节
import { GetPointOfSaleUserDetails } from '@deliverart/sdk-js-point-of-sale'
const userDetails = await client.call(new GetPointOfSaleUserDetails('pos-user-id'))
更新销售用户点
import { UpdatePointOfSaleUser } from '@deliverart/sdk-js-point-of-sale'
const updated = await client.call(
new UpdatePointOfSaleUser('pos-user-id', {
role: 'manager',
// ... other fields
}),
)
删除销售用户点
import { DeletePointOfSaleUser } from '@deliverart/sdk-js-point-of-sale'
await client.call(new DeletePointOfSaleUser('pos-user-id'))
可用时间
获取销售槽选项
统一请求 GET /point_of_sales/{id}/slot_options。 。 。 .
支持的查询参数 : mode, (中文(简体) ), date, (中文(简体) ), searchFrom, (中文(简体) ), address, (中文(简体) ), location, (中文(简体) ), countableItems, (中文(简体) ), includeInvalid, (中文(简体) ), onlyFree, (中文(简体) ), output。 。 。 .
import { GetPointOfSaleSlotOptions } from '@deliverart/sdk-js-point-of-sale'
const pointSlots = await client.call(
new GetPointOfSaleSlotOptions('pos-id', {
query: {
mode: 'delivery',
date: '2026-03-17',
address: '123 Main St, New York, NY',
countableItems: 2,
includeInvalid: false,
onlyFree: true,
output: 'point',
},
}),
)
import { GetPointOfSaleSlotOptions } from '@deliverart/sdk-js-point-of-sale'
const rangeSlots = await client.call(
new GetPointOfSaleSlotOptions('pos-id', {
query: {
mode: 'collection',
date: '2026-03-17',
searchFrom: '2026-03-17T12:00:00+01:00',
output: 'range',
},
}),
)
答复包括:
modeoutputintervalMinutessearchFromwindows[]startendlabeloptions[]timelabelscheduledAtavailablefreeinvalidReasonrangeStart财务报告和审定财务报表rangeEnd何时output = 'range'compatibleBundle
遗产提供时间
保留这些请求是为了向后兼容. 偏爱 GetPointOfSaleSlotOptions 为了新的融合.
获取可用的发送时间
import { GetAvailablePointOfSaleDeliveryTimes } from '@deliverart/sdk-js-point-of-sale'
const deliveryTimes = await client.call(
new GetAvailablePointOfSaleDeliveryTimes('pos-id', {
query: {
date: '2025-10-18',
},
}),
)
获取可用带程时间
import { GetAvailablePointOfSaleTakeAwayTimes } from '@deliverart/sdk-js-point-of-sale'
const takeAwayTimes = await client.call(
new GetAvailablePointOfSaleTakeAwayTimes('pos-id', {
query: {
date: '2025-10-18',
},
}),
)
POS 时间覆盖
管理特殊的营业时间,关闭时间,以及销售点的时间例外.
import {
GetPointOfTimeOverrides,
GetPointOfTimeOverrideDetails,
CreatePointOfTimeOverride,
UpdatePointOfTimeOverride,
DeletePointOfTimeOverride,
} from '@deliverart/sdk-js-point-of-sale'
// Get time overrides
const overrides = await client.call(
new GetPointOfTimeOverrides({
query: {
page: 1,
itemsPerPage: 20,
pointOfSale: '/api/point-of-sales/123',
},
}),
)
// Create a time override (e.g., holiday closure)
const override = await client.call(
new CreatePointOfTimeOverride({
pointOfSale: '/api/point-of-sales/123',
date: '2025-12-25',
closed: true,
reason: [
{ locale: 'en', value: 'Christmas Day' },
{ locale: 'it', value: 'Natale' },
],
}),
)
许可证
麻省理工学院
业务概览
client.call(new GetPosOperationalOverview(posId)) 返回人类工作空间
POS - 本地每日订单快照. scheduledConfirmed 使用准备时间和
包括已确认的命令; receivedTotal 使用创建时间和全部
状态 。 这些组别相互重叠,不能加以概括。 待定/被拒
订单、其余预定工作、早先未完成订单和缺少时间表
分别的字段。 小数字符串顺序值不收现金 。 使用
返回时区、周期边界和生成At来解释范围/新鲜度.
合作伙伴集成 API 令牌不能允许访问此工作空间摘要 .
操作仪表板钻倒
GetPosOperationalOrders 将选定的 POS 组读取为必需 cohort
财务报告和审定财务报表 day 查询字段。 保存概览的 POS 日历日期而不是
今天在浏览器中重新计算 。 封闭组群计划包括:,
收到、剩余和交叉日期的注意组;页面大小
范围。 答复附有打出的最低顺序身份、状态和时间戳,
将小数作为字符串保存。 保留空页 totalItems; 失败
读取时不能显示为空组。 名单是活的,不是永恒的
但不包含客户详情.
每日操作仪表板
GetPosOperationalOverview 包括今天收到的平台订单的可选添加剂计数器、成功发送到所有相关现金登记目的地的单独订单、登记正在进行中或需要注意的交货、今天完成的实际交货/收款以及逾期的准备。 在滚动的 API 部署中缺失的字段意味着没有数据, 绝不是零 .
使用 GetPosOperationalOrders 与匹配 platform_received, (中文(简体) ), register_sent, (中文(简体) ), register_pending, (中文(简体) ), register_attention, (中文(简体) ), delivered, (中文(简体) ), collected, (中文(简体) ), preparation_late, (中文(简体) ), preparation_late_not_started,或 preparation_late_in_progress 组和概览的POS日历日。 安全运行行包括伙伴/子伙伴出处和准备/完成状态。 逾期未交的组群先归还最老的准备期限. 事件日期和预定日期组别重叠,不得相提并论.