@shipengine/connect-order-source-api
Version:
This is the typescript/javascript definitions for the order source api
119 lines (118 loc) • 6.54 kB
TypeScript
import { AuthSpecification } from './metadata/auth-specification';
import { OrderSourceDefinition } from './metadata';
import Joi from 'joi';
import { AcknowledgeOrdersMethod, GetConnectionContextMethod, GetPackingSlipTemplateMethod, GetProductsMethod, NotificationStatusMethod, RegisterDeliveryOptionsMethod, RemoveDeliveryOptionsMethod, SalesOrdersExportMethod, ShipmentNotificationMethod, VerifyDeliveryOptionsMethod, CancelSalesOrderItemsMethod, AcceptSalesOrderItemsMethod, RejectSalesOrderItemsMethod, GetSourceDetailsMethod, ValidateConnectionMethod, InventoryFetchMethod, InventoryPushMethod } from './methods';
import { Handler } from '@shipengine/connect-runtime';
/** @description This represents a single integration which may contain multiple branded order sources */
export declare class OrderSourceAppMetadata {
/** @description The id for this integration */
Id: string;
/** @description The name of this integration */
Name: string;
/** @description The specification for authorizing with this order source */
AuthProcess: AuthSpecification;
/** @description A list of branded order sources associated with this integration */
OrderSources: OrderSourceDefinition[];
}
export declare const OrderSourceAppMetadataSchema: Joi.ObjectSchema<any>;
/**
* @description This defines a connect order source app
*/
export declare class OrderSourceAppDefinition {
Metadata: OrderSourceAppMetadata;
/**
* @description This method gets sales orders based on filter criteria
* @param request The criteria of which sales orders to retrieve
*/
SalesOrdersExport?: SalesOrdersExportMethod;
/**
* @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?: ShipmentNotificationMethod;
/**
* @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?: AcknowledgeOrdersMethod;
/**
* @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?: GetProductsMethod;
/**
* @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?: NotificationStatusMethod;
/**
* @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?: RegisterDeliveryOptionsMethod;
/**
* @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?: RemoveDeliveryOptionsMethod;
/**
* @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?: VerifyDeliveryOptionsMethod;
/**
* @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?: GetConnectionContextMethod;
/**
* @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?: GetSourceDetailsMethod;
/**
* @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?: GetPackingSlipTemplateMethod;
/**
* @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?: AcceptSalesOrderItemsMethod;
/**
* @description This method is called when a items are requesting to be cancelled on the order if the order source supports it.
*/
CancelSalesOrderItems?: CancelSalesOrderItemsMethod;
/**
* @description This method is called when the request to fulfill specific sales order items is being rejected
*/
RejectSalesOrderItems?: RejectSalesOrderItemsMethod;
/**
* @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?: ValidateConnectionMethod;
/**
* @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?: InventoryFetchMethod;
/**
* @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?: InventoryPushMethod;
/**
* @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?: Record<string, Handler>;
}