UNPKG

@shipengine/connect-order-source-api

Version:

This is the typescript/javascript definitions for the order source api

134 lines 6.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OrderSourceAppDefinition = exports.OrderSourceAppMetadataSchema = exports.OrderSourceAppMetadata = void 0; const tslib_1 = require("tslib"); const auth_specification_1 = require("./metadata/auth-specification"); const metadata_1 = require("./metadata"); const joi_1 = tslib_1.__importDefault(require("joi")); /** @description This represents a single integration which may contain multiple branded order sources */ class OrderSourceAppMetadata { /** @description The id for this integration */ Id; /** @description The name of this integration */ Name; /** @description The specification for authorizing with this order source */ AuthProcess; /** @description A list of branded order sources associated with this integration */ OrderSources; } exports.OrderSourceAppMetadata = OrderSourceAppMetadata; exports.OrderSourceAppMetadataSchema = joi_1.default.object({ Id: joi_1.default.string().uuid().required(), Name: joi_1.default.string().required(), AuthProcess: auth_specification_1.AuthSpecificationSchema.required(), OrderSources: joi_1.default.array() .unique('Id') .message(`Found duplicate OrderSource Id's in OrderSources[]`) .required() .min(1) .message('There must be at least 1 OrderSource defined') .items(metadata_1.OrderSourceDefinitionSchema), }); /** * @description This defines a connect order source app */ class OrderSourceAppDefinition { Metadata; /** * @description This method gets sales orders based on filter criteria * @param request The criteria of which sales orders to retrieve */ SalesOrdersExport; /** * @description This method notifies a marketplace of a shipment * @param request The information necessary to update the order source that this order has been shipped. */ ShipmentNotification; /** * @description This method notifies a marketplace that an order has been imported * @param request The information necessary to acknowledge that the order has been imported */ AcknowledgeOrders; /** * @description This method gets extra data for a product that was unavailable during export * @param request The list of product ids to get data for */ GetProducts; /** * @description This method takes a list of previously pending notifications and tries to resolve their status with the third party * @param request A list of notifications that have been submitted to the third party but not confirmed as being successful or failed. */ NotificationStatus; /** * @description This method configures the order source to use an external service for in-cart rates also known as delivery options * @param request The information required to register delivery options with an order source */ RegisterDeliveryOptions; /** * @description This method removes a delivery options configuration from an order source * @param request The information required to register delivery options with an order source */ RemoveDeliveryOptions; /** * @description This method checks if delivery options are supported by the order source * @param request The information needed to verify delivery options are available within the user's order source */ VerifyDeliveryOptions; /** * @description This method is called after the oauth workflow is complete allowing you to modify teh connection_context for all other requests * @param request The request containing */ GetConnectionContext; /** * @description This method is called to get details about the order source after a store is connected or reconnected * @param request The request contains the authentication information for the store */ GetSourceDetails; /** * @description This method is called after a user connects their store, it should provide html templates to use for packing slips. * This method might return a static store wide template or call out to third party api's to get customer specific templates. * @param request The request containing information about the store making the request */ GetPackingSlipTemplate; /** * @description * This method is called when a items are required to be accepted by the order source. * Typically the action of accepting orders & order items is initiated by the user through a manual action. */ AcceptSalesOrderItems; /** * @description This method is called when a items are requesting to be cancelled on the order if the order source supports it. */ CancelSalesOrderItems; /** * @description This method is called when the request to fulfill specific sales order items is being rejected */ RejectSalesOrderItems; /** * @description This method is called to validate the connection to an order source. It should throw an appropriate error if the connection is invalid. */ ValidateConnection; /** * @beta This feature requires approval from the inventory team * before it can be consumed. * @description This is an optional method you can implement to fetch * inventory levels from an order source */ InventoryFetch; /** * @beta This feature requires approval from the inventory team * before it can be consumed. * @description This is an optional method you can implement to sync * inventory levels to an order source */ InventoryPush; /** * @description A collection of additional routes that can be used to extend the functionality of the app. * Extension methods are not automatically called by the ShipEngine platform, and require working with Auctane developers to implement. * The request and response shapes of each method will be defined by Auctane, but will not be documented as part of Connect unless * they are made public and the functionality is taken out of extensions and into a named method. */ Extensions; } exports.OrderSourceAppDefinition = OrderSourceAppDefinition; //# sourceMappingURL=ordersource-app-definition.js.map