Skip to main content

Query the Prepaid with Drawdown objects through Data Query

Zuora

Query the Prepaid with Drawdown objects through Data Query

You can perform queries on the Prepaid Balance, Prepaid Balance Fund, Prepaid Balance Transaction objects through Data Query. For information about the basic usage of Data Query, see Constructing SQL Queries in Data Query.

Prepaid Balance fields

The following table lists all the fields that are defined on the Prepaid Balance object. You can access the Prepaid Balance object and all its fields through Data Query.

Field Type Description
Id string The identifier.
Name string The name of the Prepaid Balance. It is a combination of Subscription Number and Prepaid UOM. For example, A-S00000037_Each
TotalFund decimal The total funded prepaid balance. 
Balance decimal The current prepaid balance.
StartDate date The start date of the Prepaid Balance.
EndDate date The end date of the Prepaid Balance.
AccountId string If it belongs to an Account, the Invoice Owner Account Id.
OrigSubscriptionId string If it belongs to a Subscription, the original Subscription Id.
UOM string The Prepaid UOM for a prepayment charge. 
CreatedById string The ID of the user who created the Prepaid Balance.
CreatedDate datetime The date when the Prepaid Balance is created.
UpdatedById string The ID of the user who updated the Prepaid Balance.
UpdatedDate datetime The date when the Prepaid Balance is updated.
Deleted boolean Indicates whether the Prepaid Balance is deleted. 
PrepaidBalanceState enum The state of the Prepaid Balance.  Values: ACTIVE or EXPIRED 
PrepaidType int The type of the Prepaid Balance.  Value: NULL.

Prepaid Balance Fund fields

The following table lists all the fields that are defined on the Prepaid Balance Fund object. You can access the Prepaid Balance Fund object and all its fields through Data Query.

Field Type Description
Id string The identifier.
AccountId string The Account Id.
PrepaidBalanceId string The Prepaid Balance Id.
FundedBalance decimal The funded balance: the total units of the fund. 
Balance decimal Remaining balance on the fund: the remaining units of the fund. 
SourceId string The source Id of the fund: the original charge ID. 
FundSourceType string(enum) The type of the Prepaid Balance Fund.  Values: CHARGE, ORDER_LINE_ITEM, CREDIT_MEMO_ITEM, or DEBIT_MEMO_ITEM
FundingPrice fixed The price amount of a fund.
Calculation: {number of Billing Periods in one Fund Validity Period} * {price in one Billing Period}
ChargeSegmentNumber Integer The number of the charge segment.
StartDate date Start date of the fund effective period.
EndDate date End date of the fund effective period.
CreatedById string The ID of the user who created the Prepaid Balance Fund.
CreatedDate datetime The date when the Prepaid Balance Fund is created.
UpdatedById string The ID of the user who updated the Prepaid Balance Fund.
UpdatedDate datetime The date when the Prepaid Balance Fund is updated.
Priority Int The priority of the Fund.  Positive values: 10(high), 50(medium),100(low)
Deleted boolean Indicates whether the Prepaid Balance Fund is deleted.

Prepaid Balance Transaction fields

The following table lists all the fields that are defined on the Prepaid Balance Transaction object. You can access the Prepaid Balance Transaction object and all its fields through Data Query.

Field Type Description
Id string The identifier.
AccountId string The Account Id.
PrepaidBalanceId string The Prepaid Balance Id.
FundId string The Fund Id.
Amount decimal The Amount of Units to be adjusted to the Prepaid Balance (could be positive or negative).
PrepaidBalanceTransactionType enum

The type of the Prepaid Balance Transaction. One of the following values: 

  • PREPAYMENT
  • DRAWDOWN
  • PREPAYMENT_ADJUSTMENT 
  • DRAWDOWN_ADJUSTMENT
  • DRAWDOWN_REVERSAL
  • PREPAYMENT_CREDIT_BACK
  • PREPAYMENT_CREDIT_BACK_REVERSAL
Balance decimal The Prepaid Balance after a transaction.
TransactionSourceType enum The type of the transaction source.  Values: CHARGE, ORDER_LINE_ITEM, or USAGE. 
SourceId string The transaction source id (original Charge Id, Guided Usage Id, Order Line Item Id).
CreatedById string The ID of the user who created the Prepaid Balance Transaction.
CreatedDate datetime The date when the Prepaid Balance Transaction is created.
UpdatedById string The ID of the user who updated the Prepaid Balance Transaction.
UpdatedDate datetime The date when the Prepaid Balance Transaction is updated.
TransactionDate date The date of the Prepaid Balance Transaction.
Deleted boolean Indicates whether the Prepaid Balance Transaction is deleted.

Validity Period Summary fields

The following table lists all the fields that are defined on the Validity Period Summary object. You can access the Validity Period Summary object and all its fields through Data Query.

Field Type Description
Id string The identifier
PrepaidBalanceId string The Prepaid Balance Id.
StartDate date The start date of the validity period.
EndDate date The end date of the validity period.
TotalBalance decimal The total balance of the validity period.
RemainingBalance decimal The remaining balance of the validity period.
SubscriptionNumber string The number of the subscription the validity period belongs to.
Uom string The UOM of the validity period.
AccountNumber string The account number of the validity period.
deleted boolean Indicates if the validity period is deleted.
CreatedById string The ID of the user who created the validity period.
CreatedDate timestamp The date when the validity period is created.
UpdatedById string The ID of the user who made the most recent update to the validity period.
UpdatedDate timestamp The last updated date of the validity period.

SQL examples for querying the Prepaid with Drawdown objects

To query the Prepaid with Drawdown objects, you can use the following SQL examples:

  • Query the Prepaid Balance object by using the OrigSubscriptionId field:
    select Id,Name,Balance,TotalFund,StartDate,EndDate,OrigSubscriptionId,UOM from prepaidbalance 
    where OrigSubscriptionId='402881847e2d707b017e2d76c48a0016'
    
  • Query the Prepaid Balance object by using the Name field:
    select Id,Name,TotalFund,Balance,UOM 
    from prepaidbalance
    where Name ='A-S00000037_Each'
    
  • Query the Prepaid Balance Fund object by using the PrepaidBalanceId field:
    select id,PrepaidBalanceId,FundedBalance,Balance,StartDate,EndDate,FundSourceType from prepaidbalancefund
    where PrepaidBalanceId='402881847e2d707b017e2d76c8ae002f' 
    
  • Query the Prepaid Balance Transaction object by using the FundId field:
    select id,PrepaidBalanceId,FundId,Amount,Balance,TransactionDate,PrepaidBalanceTransactionType 
    from PrepaidBalanceTransaction where FundId='402881847e2d707b017e2d76c8b80030'