ordercloud-javascript-sdk
    Preparing search index...

    Class SubscriptionItems

    Index
    • Returns this

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

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

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • subscriptionID: string

        ID of the subscription.

      • lineItem: LineItem

        Required fields: ProductID

      • 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<TLineItem>>

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

      Parameters

      • subscriptionID: string

        ID of the subscription.

      • subscriptionItemID: string

        ID of the subscription 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 subscription item Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • subscriptionID: string

        ID of the subscription.

      • subscriptionItemID: string

        ID of the subscription 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<TLineItem>>

    • List subscription items Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • subscriptionID: string

        ID of the subscription.

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

          Comma-delimited list of fields to search on.

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

          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<TLineItem>>>

    • Partially update a subscription item Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • subscriptionID: string

        ID of the subscription.

      • subscriptionItemID: string

        ID of the subscription item.

      • lineItem: PartialDeep<LineItem>
      • 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<TLineItem>>

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

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • subscriptionID: string

        ID of the subscription.

      • subscriptionItemID: string

        ID of the subscription item.

      • lineItem: LineItem

        Required fields: ProductID

      • 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<TLineItem>>