# MTPCAccount

This object provides the product catalog view of an account.

## Program ID

Metratech.MTPCAccount.1

## Methods

GetDefaultPriceList | Returns the default price list associated with this account.
SetDefaultPriceList | Updates the default price list for this account.
Subscribe | Subscribes an account to a product offering.
Unsubscribe | Deactivates the subscription to the product offering for the account.
GetSubscribableProductOfferings | Returns the product offerings that this account can subscribe to. Excludes product offerings that: Contain the same priceable item templates as actively subscribed ones. Contain priceable items that require a cycle other than the account's billing cycle. Contain price lists of a currency other than the account's currency.
FindSubscribablePorductOfferingAsRowset | This method behaves the same as GetSubscribableProductOfferings, but returns a rowset and can also be filtered.
GetActiveSubscriptions | Finds all current and future active subscriptions for a particular account. (A future active subscription is one that the customer has signed up for but is not currently effective.)
GetActiveSubscriptionsAsRowset | Returns the collection of MTSubscriptions for this account's subscriptions effective currently or in the future.
GetInactiveSubscriptions | Finds all inactive subscriptions for an account.
GetInactiveSubscriptionsAsRowset | Returns a rowset of this account's subscriptions that were effective in the past.
GetSubscriptionByProductOffering | Returns the subscription object for this account given a product offering.
GetSubscriptionByPriceableItem | Returns a subscription object for this account given a priceable item type.
GetParamTablesAsRowset | Returns a rowset of all parameter tables used in all active subscriptions.
CanChangeBillingCycle | Returns true if the user is allowed to change their billing cycle. They will not be allowed if they are subscribed to any billing cycle aligned recurring charges or discounts.
GetSubscription | Gets a subscription of this account by its ID.

## Properties

AccountID | Unique identifier of the account.

# Method Detail

## GetDefaultPriceList

This method returns the default price list associated with this account.

### Visual Basic Syntax

GetDefaultPriceList() As MTPriceList

### C++ Syntax

HRESULT GetDefaultPriceList([out, retval] IMTPriceList** pVal);

## SetDefaultPriceList

This method updates the default price list for this account.

### Visual Basic Syntax

SetDefaultPriceList(Val As MTPricelist)

### C++ Syntax

HRESULT SetDefaultPriceList([in] IMTPricelist* newVal);

## Subscribe

This method subscribes an account to a product offering.

### Visual Basic Syntax

Subscribe(ProdOffID As Long, EffDate As MTPCTimeSpan) As MTSubscription

### C++ Syntax

HRESULT Subscribe([in] long ProdOffID, [in] IMTPCTimeSpan* pEffDate,[out,retval] IMTSubscription** ppSub);

## Unsubscribe

This method deactivates the subscription to a product offering for the account.

### Visual Basic Syntax

Unsubscribe(SubscrID As Long, Endate As Variant, EndType As MTPCDateType)

### C++ Syntax

HRESULT Unsubscribe([in] long aSubscrID,[in] VARIANT aEndDate,[in] MTPCDateType aEndType);

## FindSubscribablePorductOfferingAsRowset

This method behaves the same as GetSubscribableProductOfferings (returns the product offerings that this account can subscribe to), but returns a rowset and can also be filtered.

It excludes product offerings that:

- Contain the same priceable item templates as actively subscribed ones.

- Contain priceable items that require a cycle other than the account's billing cycle.

- Contain price lists of a different currency other than the account's currency.

### Visual Basic Syntax

FindSubscribableProductOfferingsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindSubscribableProductOfferingsAsRowset([in, optional] VARIANT pFilter,[out, retval] IMTRowSet** ppRowset);

## GetSubscribableProductOfferings

This method returns the product offerings that this account can subscribe to.

It excludes product offerings that:

- Contain the same priceable item templates as actively subscribed ones.

- Contain priceable items that require a cycle other than the account's billing cycle.

- Contain price lists of a different currency other than the account's currency.

### Visual Basic Syntax

GetSubscribableProductOfferings() As MTCollection

### C++ Syntax

HRESULT GetSubscribableProductOfferings([out, retval] IMTCollection** ppCol);

## GetActiveSubscriptions

This method finds all current and future active subscriptions for a particular account. (A future active subscription is one that the customer has signed up for but is not yet effective.)

### Visual Basic Syntax

GetActiveSubscriptions() As MTCollection

### C++ Syntax

HRESULT GetActiveSubscriptions([out, retval] IMTCollection** ppCol);

## GetActiveSubscriptionsAsRowset

This method returns the collection of MTSubscriptions for this account's subscriptions effective now or in the future.

### Visual Basic Syntax

GetActiveSubscriptionsAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetActiveSubscriptionsAsRowset([out, retval] IMTRowSet** ppRowset);

## GetInactiveSubscriptions

This method finds all inactive subscriptions for an account.

### Visual Basic Syntax

GetInactiveSubscriptionsAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetInactiveSubscriptionsAsRowset([out, retval] IMTRowSet** ppRowset);

## GetInactiveSubscriptionsAsRowset

This method returns a rowset of this account's subscriptions that were effective in the past.

### Visual Basic Syntax

GetInactiveSubscriptionsAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetInactiveSubscriptionsAsRowset([out, retval] IMTRowSet** ppRowset);

## GetSubscriptionByProductOffering

This method returns the subscription object for this account given a product offering.

### Visual Basic Syntax

GetSubscriptionByProductOffering(ProdOffID As Long) As MTSubscription

### C++ Syntax

HRESULT GetSubscriptionByProductOffering([in] long ProdOffID,[out, retval] IMTSubscription** ppSub);

## GetSubscriptionByPriceableItem

This method returns a subscription object for this account given a priceable item type.

### Visual Basic Syntax

GetSubscriptionByPriceableItem(PrcItemID As Long) As MTSubscription

### C++ Syntax

HRESULT GetSubscriptionByPriceableItem([in] long aPrcItemID,[out, retval] IMTSubscription** ppSub);

## GetParamTablesAsRowset

This method returns a rowset of all parameter tables used in all active subscriptions.

### Visual Basic Syntax

GetParamTablesAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetParamTablesAsRowset([out, retval] IMTRowSet** ppRowset);

## CanChangeBillingCycle

### Visual Basic Syntax

CanChangeBillingCycles() As Boolean

### C++ Syntax

HRESULT CanChangeBillingCycles([out, retval] VARIANT_BOOL * pCanChange);

## GetSubscription

This method gets a subscription of this account by its ID.

### Visual Basic Syntax

GetSubscription(sub_id As Long) As MTSubscription

### C++ Syntax

HRESULT GetSubscription([in] long sub_id,[out,retval] IMTSubscription** ppSub);

# Property Detail

## AccountID

This property specifies the unique identifier of the account.

### Visual Basic Syntax

Property AccountID As Long

### C++ Syntax

HRESULT AccountID([out, retval] long *pVal);

HRESULT AccountID([in] long newVal);