ordercloud-javascript-sdk
    Preparing search index...

    Class Specs

    Index
    • Returns this

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

      Specs.As().List() // lists Specs using the impersonated users' token
      
    • Create a spec Check out the docs for more info

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • spec: Spec

        Required fields: Name

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpec>>

    • Create a spec option A Spec can have multiple Options-- for example, if the spec is called 'Color', the options might be 'Blue', 'Red', and 'Green'. Check out the docs for more info

      Type Parameters

      Parameters

      • specID: string

        ID of the spec.

      • specOption: SpecOption

        Required fields: Value

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpecOption>>

    • Delete a spec Check out the docs for more info

      Parameters

      • specID: string

        ID of the spec.

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Delete a spec option Check out the docs for more info

      Parameters

      • specID: string

        ID of the spec.

      • optionID: string

        ID of the option.

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Delete a spec product assignment Check out the docs for more info

      Parameters

      • specID: string

        ID of the spec.

      • productID: string

        ID of the product.

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Retrieve a spec Check out the docs for more info

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • specID: string

        ID of the spec.

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpec>>

    • Retrieve a spec option Check out the docs for more info

      Type Parameters

      Parameters

      • specID: string

        ID of the spec.

      • optionID: string

        ID of the option.

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpecOption>>

    • List specs Check out the docs for more info

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "Name")[];
            sortBy?: ("ID" | "Name" | "!ID" | "!Name" | "ListOrder" | "!ListOrder")[];
        } = {}
        • 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.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "Name")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: ("ID" | "Name" | "!ID" | "!Name" | "ListOrder" | "!ListOrder")[]

          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).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TSpec>>>

    • List spec options Check out the docs for more info

      Type Parameters

      Parameters

      • specID: string

        ID of the spec.

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "Value")[];
            sortBy?: ("ID" | "!ID" | "ListOrder" | "!ListOrder")[];
        } = {}
        • 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.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "Value")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: ("ID" | "!ID" | "ListOrder" | "!ListOrder")[]

          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).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TSpecOption>>>

    • List spec product assignments Check out the docs for more info

      Type Parameters

      Parameters

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ProductID" | "SpecID")[];
            sortBy?: (
                | "ProductID"
                | "SpecID"
                | "!ProductID"
                | "DefaultOptionID"
                | "DefaultValue"
                | "!SpecID"
                | "!DefaultOptionID"
                | "!DefaultValue"
            )[];
        } = {}
        • 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.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ProductID" | "SpecID")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "ProductID"
              | "SpecID"
              | "!ProductID"
              | "DefaultOptionID"
              | "DefaultValue"
              | "!SpecID"
              | "!DefaultOptionID"
              | "!DefaultValue"
          )[]

          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).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TSpecProductAssignment>>>

    • Partially update a spec Check out the docs for more info

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • specID: string

        ID of the spec.

      • spec: PartialDeep<Spec>
      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpec>>

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

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • specID: string

        ID of the spec.

      • spec: Spec

        Required fields: Name

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpec>>

    • Create or update a spec option Check out the docs for more info

      Type Parameters

      Parameters

      • specID: string

        ID of the spec.

      • optionID: string

        ID of the option.

      • specOption: SpecOption

        Required fields: Value

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TSpecOption>>

    • Create or update a spec product assignment Check out the docs for more info

      Parameters

      • specProductAssignment: SpecProductAssignment

        Required fields: SpecID, ProductID

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

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

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>