@shipengine/connect-order-source-api
Version:
This is the typescript/javascript definitions for the order source api
129 lines (128 loc) • 6.83 kB
TypeScript
import { Address } from './address';
import { ShippingPreferences } from './shipping-preferences';
import { SalesOrderItem } from './sales-order-item';
import { Buyer } from './buyer';
import { BillTo } from './bill-to';
import { Payment } from './payment';
import { Note } from './note';
import { Branding } from './branding';
import Joi from 'joi';
import { TaxIdentifier } from './tax-identifier';
/** @description The status of a sales order */
export declare enum SalesOrderStatus {
AwaitingPayment = "AwaitingPayment",
AwaitingShipment = "AwaitingShipment",
Cancelled = "Cancelled",
Completed = "Completed",
OnHold = "OnHold",
PendingFulfillment = "PendingFulfillment"
}
/** @description The status of a requested fulfillment */
export declare enum RequestedFulfillmentStatus {
AwaitingShipment = "AwaitingShipment",
Cancelled = "Cancelled",
Completed = "Completed",
OnHold = "OnHold",
PendingFulfillment = "PendingFulfillment",
PartiallyFulfilled = "PartiallyFulfilled"
}
export declare const SalesOrderStatusSchema: Joi.StringSchema;
/** @description If this order came from a marketplace other than the one this integration talks to directly,
* information about the original marketplace goes here. For instance, if an order is placed with another 3rd
* party such as Amazon or Ebay but shows up in the data from the marketplace this integration talks to
* directly, any identifiers that link the order back to those original marketplaces goes here. If the order
* is not from an upstream marketplace and originates at the marketplace you are integrating with directly,
* do not populate these fields.
*/
export declare class OriginalOrderSource {
/** @description A unique identifier for the store inside of the original marketplace. */
source_id?: string;
/** @description The ShipEngine API Code of the original marketplace. Check with the Engine team for allowed values. */
marketplace_code?: string;
/** @description The unique identifier for the order at the original marketplace. */
order_id?: string;
}
export declare const OriginalOrderSourceSchema: Joi.ObjectSchema<any>;
/** @description Additional information necessary for a requested fulfillment */
export declare class RequestedFulfillmentExtensions {
/** @description Custom field 1 */
custom_field_1?: string;
/** @description Custom field 2 */
custom_field_2?: string;
/** @description Custom field 3 */
custom_field_3?: string;
}
export declare const RequestedFulfillmentExtensionsSchema: Joi.ObjectSchema<any>;
/** @description Information about the duties for an order */
interface Duties {
/** @description Indicates whether duties were displayed to the buyer at checkout */
duties_displayed_at_checkout?: boolean;
/** @description Indicates whether the buyer paid for the duties at checkout */
delivered_duty_paid?: boolean;
/** @description The sum of duties associated with this fulfillment */
duties_total?: number;
}
export declare const DutiesSchema: Joi.ObjectSchema<any>;
/** @description The fulfillment requested by the marketplace or the buyer */
export declare class RequestedFulfillment {
/** @description Identifier for the requested fulfillment from the order source */
requested_fulfillment_id?: string;
/** @description Who the order should be shipped to */
ship_to: Address;
/** @description The items that should be shipped */
items: SalesOrderItem[];
/** @description Additional information about this fulfillment */
extensions?: RequestedFulfillmentExtensions;
/** @description Preferences about how the order is shipped */
shipping_preferences?: ShippingPreferences;
/** @description Brand information about this fulfillment */
branding?: Branding;
/** @description The requested fulfillment status*/
requested_fulfillment_status?: RequestedFulfillmentStatus;
/** @description Information related to duties for the fulfillment */
duties?: Duties;
}
export declare const RequestedFulfillmentSchema: Joi.ObjectSchema<any>;
/** @description This represents a sales order */
export declare class SalesOrder {
/** @description The unique identifier of the sales order from the order source */
order_id: string;
/** @description The customer facing identifier of the sales order */
order_number?: string;
/** @description The sales order status */
status: SalesOrderStatus;
/** @description The (ISO 8601) datetime (UTC) associated with when this sales order was paid for @example "2021-03-31T18:21:14.858Z" */
paid_date?: string;
/** @description The (ISO 8601) datetime (UTC) associated with when this order shipped @example "2021-03-31T18:21:14.858Z" */
fulfilled_date?: string;
/** @description Represents information from the source marketplace. (This is common with reselling goods) */
original_order_source?: OriginalOrderSource;
/** @description The fulfillment requested by the marketplace or the buyer */
requested_fulfillments: RequestedFulfillment[];
/** @description The buyer of this sales order */
buyer?: Buyer;
/** @description The person being billed for this sales order */
bill_to?: BillTo;
/** @description The three character ISO 4217 code of the currency used for all monetary amounts @example "USD", "EUR", "NZD" */
currency?: string;
/** @description Tax id information corresponding to tax (such as prepaid VAT) */
tax_identifier?: TaxIdentifier;
/** @description Information about the payment */
payment?: Payment;
/** @description The source that the order is shipping from */
ship_from?: Address;
/** @description A unique url associated with the order */
order_url?: string;
/** @description Notes about the order */
notes?: Note[];
/** @description Data provided by the order source that should be included in calls back to the order source. This data is only meaningful to the integration and not otherwise used by the platform. */
integration_context?: string;
/** @description The (ISO 8601) datetime (UTC) associated with when this order was created @example "2021-03-31T18:21:14.858Z" */
created_date_time?: string;
/** @description The (ISO 8601) datetime (UTC) associated with when this order was last modified @example "2021-03-31T18:21:14.858Z" */
modified_date_time?: string;
/** @description A value, specific to the order source, that indicates who is expected to fulfill the order. This value can represent whether an order will be fulfilled by seller fulfillment, merchant fulfillment or other fulfillment network. @example "SellerFulfilled" */
fulfillment_channel?: string;
}
export declare const SalesOrderSchema: Joi.ObjectSchema<any>;
export {};