UNPKG

@shipengine/connect-fulfillment-provider-api

Version:

OpenAPI specification and TypeScript definitions for the Connect Fulfillment Provider API

46 lines (45 loc) 2.37 kB
import { FulfillmentProviderAppMetadata } from './fulfillment-provider-app-metadata'; import { ConnectRequest, DelegateFulfillmentRequest, GetFulfillmentsRequest, CancelFulfillmentRequest, GetInventoryRequest, GetRatesRequest, GetRecentChangesRequest } from '..'; import { ConnectResponse, DelegateFulfillmentResponse, GetFulfillmentsResponse, CancelFulfillmentResponse, GetInventoryResponse, GetRatesResponse, GetRecentChangesResponse } from '..'; import { Handler } from '@shipengine/connect-runtime'; /** * Definition for an Fulfillment Provider App implementation */ export interface FulfillmentProviderAppDefinition { Metadata: FulfillmentProviderAppMetadata; /** * Create a connection to a fulfillment provider. */ connect: (request: ConnectRequest) => Promise<ConnectResponse>; /** * Delegate a fulfillment to a provider. */ delegateFulfillment: (request: DelegateFulfillmentRequest) => Promise<DelegateFulfillmentResponse>; /** * Get the current status of a single fulfillment from a provider. */ getFulfillments: (request: GetFulfillmentsRequest) => Promise<GetFulfillmentsResponse>; /** * Request that a delegated fulfillment be cancelled by the provider. */ cancelFulfillment: (request: CancelFulfillmentRequest) => Promise<CancelFulfillmentResponse>; /** * Get rates for a fulfillment preview from a provider. */ getRates: (request: GetRatesRequest) => Promise<GetRatesResponse>; /** * Get recent changes for all fulfillments since a specified time. */ getRecentChanges: (request: GetRecentChangesRequest) => Promise<GetRecentChangesResponse>; /** * Get pages results of inventory from a provider. */ getInventory: (request: GetInventoryRequest) => Promise<GetInventoryResponse>; /** * @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>; }