Skip to content

@dukkan.one/app-sdk/contract

Runtime constants generated from the platform's OpenAPI document: topics, scopes, statuses, the transition matrix and the dated API revision.

Package
@dukkan.one/app-sdk@0.3.0
API revision
2026-09-10
Import
import { … } from "@dukkan.one/app-sdk/contract"
On this page

Types

AppScope#

type AppScope = (typeof APP_SCOPES)[number]

InventoryMovementReason#

type InventoryMovementReason = (typeof INVENTORY_MOVEMENT_REASONS)[number]

OrderStatus#

type OrderStatus = (typeof ORDER_STATUSES)[number]

PaymentStatus#

type PaymentStatus = (typeof PAYMENT_STATUSES)[number]

SettableOrderStatus#

type SettableOrderStatus = (typeof SETTABLE_ORDER_STATUSES)[number]

WebhookTopic#

type WebhookTopic = (typeof WEBHOOK_TOPICS)[number]

Constants

APP_PII_SCOPES#

const APP_PII_SCOPES: readonly ["clients:read", "clients:write"]

Scopes that unlock customer contact PII; the portal lets only DPA-accepted developers request them.

APP_SCOPES#

const APP_SCOPES: readonly ["clients:read", "clients:write", "discounts:read", "fulfillments:write", "inventory:read", "inventory:write", "orders:create", "orders:read", "orders:write", "products:read", "refunds:write"]

Every scope an app can request, in the platform's canonical order.

INVENTORY_MOVEMENT_REASONS#

const INVENTORY_MOVEMENT_REASONS: readonly ["correction", "initial", "return", "damage"]

Accepted reason values of POST /inventory/movements.

ORDER_STATUS_TRANSITIONS#

const ORDER_STATUS_TRANSITIONS: { readonly placed: readonly ["approved", "processing", "shipped", "delivered", "cancelled"]; readonly approved: readonly ["processing", "shipped", "delivered", "cancelled"]; readonly processing: readonly ["shipped", "delivered", "cancelled"]; readonly shipped: readonly ["delivered", "delivered_failed"]; readonly delivered: readonly []; readonly delivered_failed: readonly ["shipped", "returned"]; readonly returned: readonly []; readonly cancelled: readonly []; readonly completed: readonly ["cancelled"]; readonly partially_refunded: readonly ["cancelled"]; readonly refunded: readonly []; }

Transitions an app may request through PATCH /orders/{id}/status, per current status.

ORDER_STATUSES#

const ORDER_STATUSES: readonly ["placed", "approved", "processing", "shipped", "delivered", "delivered_failed", "returned", "cancelled", "completed", "partially_refunded", "refunded"]

Every order status the platform reports.

PAYMENT_STATUSES#

const PAYMENT_STATUSES: readonly ["not_required", "unpaid", "pending", "authorized", "partially_paid", "paid", "partially_refunded", "refunded", "failed"]

Every payment_status value: a projection of the payments ledger, never set directly.

PLATFORM_API_VERSION#

const PLATFORM_API_VERSION: "2026-09-10"

Dated v1 revision this SDK was generated against (X-Dukkan-Api-Version).

SETTABLE_ORDER_STATUSES#

const SETTABLE_ORDER_STATUSES: readonly ["placed", "approved", "processing", "shipped", "delivered", "delivered_failed", "returned", "cancelled"]

The statuses an app may set through PATCH /orders/{id}/status.

TOPIC_PAYLOAD_SCHEMA#

const TOPIC_PAYLOAD_SCHEMA: { readonly "order.created": "OrderCreatedEventData"; readonly "order.status_changed": "OrderStatusChangedEventData"; readonly "order.paid": "OrderPaidEventData"; readonly "product.created": "ProductCreatedEventData"; readonly "product.updated": "ProductUpdatedEventData"; readonly "product.deleted": "ProductDeletedEventData"; readonly "inventory.movement_created": "InventoryMovementCreatedEventData"; readonly "fulfillment.requested": "FulfillmentRequestedEventData"; readonly "fulfillment.created": "FulfillmentCreatedEventData"; readonly "fulfillment.updated": "FulfillmentUpdatedEventData"; readonly "refund.created": "RefundCreatedEventData"; readonly "app.uninstalled": "AppUninstalledEventData"; }

Component schema name carrying each topic's data shape.

TOPIC_REQUIRED_SCOPE#

const TOPIC_REQUIRED_SCOPE: { readonly "order.created": "orders:read"; readonly "order.status_changed": "orders:read"; readonly "order.paid": "orders:read"; readonly "product.created": "products:read"; readonly "product.updated": "products:read"; readonly "product.deleted": "products:read"; readonly "inventory.movement_created": "inventory:read"; readonly "fulfillment.requested": "orders:read"; readonly "fulfillment.created": "orders:read"; readonly "fulfillment.updated": "orders:read"; readonly "refund.created": "orders:read"; readonly "app.uninstalled": null; }

Read scope an install must hold to receive a topic; null for lifecycle topics.

WEBHOOK_TOPICS#

const WEBHOOK_TOPICS: readonly ["order.created", "order.status_changed", "order.paid", "product.created", "product.updated", "product.deleted", "inventory.movement_created", "fulfillment.requested", "fulfillment.created", "fulfillment.updated", "refund.created", "app.uninstalled"]

Every topic an app can subscribe to, from x-dukkan-topic-scopes.