Purchase Object

Purchases in Fusebill are the result of purchasing a priced product outside a plan. Purchases exist separate to subscriptions and are managed on their own outside the context of the customer's subscriptions.

When a product is purchased it is added to the customer's draft purchases just like how a subscription, when created, first goes into a draft status. The purchase does not charge the customer until the purchase is finalized and moved from draft. Once finalized, the purchase is moved into the customer's purchase history.

Purchase Properties

customerIdIntegerThis is the unique ID of the Customer who made the Purchase.
[Read Only]
codeStringThe product code. Fusebill enforces uniqueness for this value. [Max length: 1000 characters]
effectiveTimestampTimestampThe time the purchase occurred.
[Read Only]
taxableAmountDecimalThe amount of the purchase eligible for taxation
amountDecimalThe amount for the purchase
modifiedTimestampTimestampThe time of the most recent modification to this purchase
salesforceIdStringThe Salesforce ID of the purchase in Salesforce that this purchase maps to.
netsuiteLocationIdStringThe NetSuite location ID for this purchase.
productIdIntegerThis is the Fusebill generated unique ID of the product sold in this purchase. [Read Only]
nameStringThis is the name of the purchase. This is customer facing and appears on Invoices. [Max Length: 250 characters]
descriptionStringThis is the description of the purchase. This is customer facing and appears on Invoices.[Max Length: 250 characters]
isTrackingItemsBooleanThis field defines if the purchase uses the tracked items feature.
statusEnum: {Draft, Purchased, Reversed, Cancelled}This is the status of the purchase.
quantityDecimalThis is the quantity (number of units) sold in this purchase.
targetOrderQuantityDecimalThis is the target order quantity. If the target order quantity is not reached, the purchase cannot be finalized. Relevant only for tracked item purchases.
pricingModelTypeEnum: {Standard, Stairstep, Volume, or Tiered}Dictates how the price is calculated using the quantity.
customFieldsList of objects. See Catalog: Custom Fields for detailsThis is a list of the custom fields attached to this purchase.
discountslist of objects. See Purchase Discount Object for detailsThis is a list of discounts applied to this purchase. This includes discounts added directly as well as those applied as a result of applying a coupon to this purchase.
priceRangesList of objects. Defined below.This is a list of the prices and quantity ranges for this Purchase. This contains a range and associated price for each tier, volume, or stairstep level in the purchase price model. Standard pricing has only one quantity range.
productItemsList of objects. See Tracking: Tracked Items Object for detailsThis is a list of the Purchase Product Items (tracked items) associated to this purchase.
couponCodesList of StringsThis is a list of the coupons codes, as strings, applied to the purchase.
earningSettingsObject. Defined belowControls how this purchase earns
idIntegerThe Fusebill generated ID for this purchase. [Read Only]
uriStringThe full string path to this resource [Read Only]

Price Range Properties

minDecimalThe lower bound for this range.
maxDecimalThe upper bound for this range. Null is interpreted as infinity
amountDecimalThe price for this range

Earning Settings Object

earningIntervalEnum: {Monthly, Yearly}Indicates whether the custom earning period (if a custom earning period is being used) is measured in years or months
earningNumberOfIntervalsIntegerThe number of earningIntervals that constitute the period this purchase earns over
earningTimingIntervalEnum:{Daily, Monthly, Yearly, Interval, DoesNotEarn, EarnImmediately}Indicates how to divide the custom period if a custom period is being used, indicates the purchase does not earn, or indicates that the purchase earns immediately
earningTimingTypeEnum:{StartOfInterval, EndOfInterval, DoesNotEarn}Indicates where in the interval the earning occurs, if custom earning periods are being used