Skip to main content

ServiceType

Enum representing the available PromoStandards service types.
type ServiceType =
  | "Inventory"
  | "Invoice"
  | "MediaContent"
  | "OrderShipmentNotification"
  | "OrderStatus"
  | "ProductData"
  | "ProductPricingAndConfiguration"
  | "PurchaseOrder";

Values

Inventory
string
Service for checking product inventory levels and availability
Invoice
string
Service for retrieving invoice information
MediaContent
string
Service for accessing product media content and images
OrderShipmentNotification
string
Service for retrieving order shipment notifications
OrderStatus
string
Service for checking order status information
ProductData
string
Service for accessing product information and details
ProductPricingAndConfiguration
string
Service for product pricing and configuration options
PurchaseOrder
string
Service for submitting purchase orders

ServiceEndpointType

Interface defining the structure of a service endpoint configuration.
type ServiceEndpointType = {
  type: ServiceType;
  version: string;
  url: string;
};

Properties

type
ServiceType
required
The PromoStandards service type. See ServiceType for valid values.
version
string
required
The version of the PromoStandards service (e.g., "1.0.0", "1.2.1"). Should follow semantic versioning.
url
string
required
The full URL endpoint for the service (e.g., "https://api.supplier.com/ProductData")

Example

const endpoint = {
  type: 'ProductData',
  version: '1.0.0',
  url: 'https://api.supplier.com/ProductData'
};

MethodType

Enum representing all available PromoStandards API method names.
type MethodType =
  | "getFilterValues"
  | "getInventoryLevels"
  | "getMediaContent"
  | "getMediaDateModified"
  | "getOrderShipmentNotification"
  | "getOrderStatusDetails"
  | "getOrderStatusTypes"
  | "getProduct"
  | "getProductDateModified"
  | "getProductSellable"
  | "getProductCloseOut"
  | "getAvailableLocations"
  | "getDecorationColors"
  | "getFobPoints"
  | "getAvailableCharges"
  | "GetConfigurationAndPricing"
  | "getSupportedOrderTypes"
  | "sendPO";

Values

getFilterValues
string
Get available filter values for inventory queries
getInventoryLevels
string
Get current inventory levels for products
getMediaContent
string
Get media content for a product
getMediaDateModified
string
Get media content modified after a specific date
getOrderShipmentNotification
string
Get shipment notification details for an order
getOrderStatusDetails
string
Get detailed status information for an order
getOrderStatusTypes
string
Get available order status types
getProduct
string
Get detailed product information
getProductDateModified
string
Get products modified after a specific date
getProductSellable
string
Get sellable product information
getProductCloseOut
string
Get close-out product information
getAvailableLocations
string
Get available decoration locations for a product
getDecorationColors
string
Get available decoration colors
getFobPoints
string
Get FOB (Freight on Board) points
getAvailableCharges
string
Get available charges for product configuration
GetConfigurationAndPricing
string
Get complete configuration and pricing information
getSupportedOrderTypes
string
Get supported order types
sendPO
string
Submit a purchase order to the supplier

ResponseFormatType

Enum representing the available response format types.
type ResponseFormatType = "xml" | "json";

Values

xml
string
Return API responses in XML format
json
string
Return API responses in JSON format (default)

Example

const client = new PromoStandards.Client({
  id: 'username',
  password: 'password',
  format: 'json' // or 'xml'
});

PromoStandardsBaseAttributes

Interface defining the base attributes for PromoStandards client configuration.
interface PromoStandardsBaseAttributes {
  id?: string;
  password?: string;
  endpoints?: ServiceEndpointType[];
  format?: ResponseFormatType;
}

Properties

id
string
Username provided by the supplier for authentication
password
string
Password provided by the supplier for authentication
endpoints
ServiceEndpointType[]
Array of service endpoint configurations. See ServiceEndpointType for details.
format
ResponseFormatType
Response format type. Can be "json" or "xml". Defaults to "json".

Example

const config = {
  id: 'supplier-username',
  password: 'supplier-password',
  endpoints: [
    {
      type: 'ProductData',
      version: '1.0.0',
      url: 'https://api.supplier.com/ProductData'
    },
    {
      type: 'Inventory',
      version: '1.2.1',
      url: 'https://api.supplier.com/Inventory'
    }
  ],
  format: 'json'
};

const client = new PromoStandards.Client(config);

Usage in TypeScript

When using the SDK in TypeScript, you can import and use these types for type safety:
import { PromoStandards } from 'promostandards-sdk-js';

// Type your endpoint configurations
const endpoints: PromoStandards.ServiceEndpointType[] = [
  {
    type: 'ProductData',
    version: '1.0.0',
    url: 'https://api.supplier.com/ProductData'
  }
];

// Type your client configuration
const config: PromoStandards.PromoStandardsBaseAttributes = {
  id: 'username',
  password: 'password',
  endpoints: endpoints,
  format: 'json'
};

// Create a typed client
const client = new PromoStandards.Client(config);

Build docs developers (and LLMs) love