ordercloud-javascript-sdk
    Preparing search index...

    Class Shipments

    Index
    • Returns this

      enables impersonation by calling the subsequent method with the stored impersonation token

      Shipments.As().List() // lists Shipments using the impersonated users' token
      
    • Delete a shipment Check out the docs for more info

      Parameters

      • shipmentID: string

        ID of the shipment.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<void>

    • Delete a shipment item Check out the docs for more info

      Parameters

      • shipmentID: string

        ID of the shipment.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<void>

    • Retrieve a shipment Check out the docs for more info

      Type Parameters

      • TShipment extends Shipment<any, any, any>

      Parameters

      • shipmentID: string

        ID of the shipment.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredDeep<TShipment>>

    • Retrieve a shipment item Check out the docs for more info

      Type Parameters

      Parameters

      • shipmentID: string

        ID of the shipment.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredDeep<TShipmentItem>>

    • List shipments Check out the docs for more info

      Type Parameters

      • TShipment extends Shipment<any, any, any>

      Parameters

      • listOptions: {
            filters?: Filters;
            orderID?: string;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: (
                | "ID"
                | "BuyerID"
                | "Shipper"
                | "DateShipped"
                | "DateDelivered"
                | "TrackingNumber"
            )[];
            sortBy?: (
                | "ID"
                | "BuyerID"
                | "Shipper"
                | "DateShipped"
                | "DateDelivered"
                | "!ID"
                | "OwnerID"
                | "!OwnerID"
                | "!BuyerID"
                | "Cost"
                | "!DateShipped"
                | "!Shipper"
                | "!DateDelivered"
                | "!Cost"
            )[];
        } = {}
        • Optionalfilters?: Filters

          An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

        • OptionalorderID?: string

          ID of the order.

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: (
              | "ID"
              | "BuyerID"
              | "Shipper"
              | "DateShipped"
              | "DateDelivered"
              | "TrackingNumber"
          )[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "ID"
              | "BuyerID"
              | "Shipper"
              | "DateShipped"
              | "DateDelivered"
              | "!ID"
              | "OwnerID"
              | "!OwnerID"
              | "!BuyerID"
              | "Cost"
              | "!DateShipped"
              | "!Shipper"
              | "!DateDelivered"
              | "!Cost"
          )[]

          Comma-delimited list of fields to sort by.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<ListPage<TShipment>>>

    • List shipment items Check out the docs for more info

      Type Parameters

      Parameters

      • shipmentID: string

        ID of the shipment.

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            sortBy?: ("OrderID" | "!OrderID" | "LineItemID" | "!LineItemID")[];
        } = {}
        • Optionalfilters?: Filters

          An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • OptionalsortBy?: ("OrderID" | "!OrderID" | "LineItemID" | "!LineItemID")[]

          Comma-delimited list of fields to sort by.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<ListPage<TShipmentItem>>>

    • Create or update a shipment If an object with the same ID already exists, it will be overwritten. Check out the docs for more info

      Type Parameters

      • TShipment extends Shipment<any, any, any>

      Parameters

      • shipmentID: string

        ID of the shipment.

      • shipment: Shipment
      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredDeep<TShipment>>

    • Set a ship from address Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the shipment's FromAddressID property instead. Check out the docs for more info

      Type Parameters

      • TShipment extends Shipment<any, any, any>

      Parameters

      • shipmentID: string

        ID of the shipment.

      • address: Address

        Required fields: Street1, City, Country

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredDeep<TShipment>>

    • Set a ship to address Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the shipment's ToAddressID property instead. Check out the docs for more info

      Type Parameters

      • TShipment extends Shipment<any, any, any>

      Parameters

      • shipmentID: string

        ID of the shipment.

      • address: Address

        Required fields: Street1, City, Country

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredDeep<TShipment>>