Transactions

Transactions_Create

Required Input

  • Transaction– Transaction information.
    • Type As Enum_Type Enum_Type – Type of transaction. Valid values are:
      • CHARGE – Charge the customer for the amount entered.
      • CREDIT – Credit the customer for the amount entered.
    • ID As Integer – Prohibited for this function.
    • Amount As Decimal – Amount to charge/credit customer.
    • Quantity As Integer – Quantity of item entered.
    • Description As String – Description of transaction. Optional. If not specified, description from customer product, product, or product type will be used, in that order.
    • ProductID As Integer – Product to apply transaction as. This could affect tax and commission. Optional if CustomerProductID or ProductTypeID is specified.
    • ProductTypeID As Integer – Product Type to apply transaction as. This could affect tax and commission. Optional if CustomerProductID or ProductID is specified.
    • CustomerID As Integer – Customer to apply transaction to. Optional if LineID (Rev.io Service ID) or CustomerProductID is specified.
    • LineID As Integer – Rev.io Service that transaction is for. Optional if CustomerProductID or LineID (Rev.io Service ID) is specified.
    • CustomerProductID As Integer – Existing customer product id to use for transaction. Optional if ProductID is specified or ProductTypeID is specified, and if LineID (Rev.io Service ID) is specified or if CustomerID is specified.
    • DateStart As Date – Start date of transaction. Optional. Used for proration if Prorate is true. Defaults to the current date.
    • DateEnd As Date – End date of transaction. Optional. Used for proration if Prorate is true. Defaults to the current date.
    • TaxIncluded As Boolean – Indicates if tax is included in amount given.
    • Prorate As Boolean – Prorate amount given based on date range specified.
    • StatementID As Integer – Prohibited for this function.
    • CreatedDate As Date – Prohibited for this function.

Output

  • Transaction – Transaction information as recorded. This will be a mirror image above as well as optional fields populated with inferred information, if applicable.

📘

Notes

Only one of CustomerProductID, ProductID, and ProductTypeID need to be specified. If more than one field is populated, then the values must match the inferred values of the others. For instance, if all fields are populated, then the ProductID specified must match the inferred product id from the CustomerProductID specified. Additionally, the ProductTypeID must match the inferred product type of the ProductID.

Only one of CustomerProductID, LineID (Rev.io Service ID) , and CustomerID need to be specified. If more than one field is populated, then the values must match the inferred values of the others. For instance, if all fields are populated, then the LineID (Rev.io Service ID) specified must match the inferred service id from the CustomerProductID specified. Additionally, the CustomerID must match the inferred customer of the LineID (Rev.io Service ID) and CustomerProductID. The final balance is NOT the amount entered in this call if any of the following conditions exist:

  1. Based on the customer product, product, or product type entered, taxes need to be applied to the amount, and the transaction is not marked as "Tax Included" or the customer marked as "Tax Exempt".
  2. The "Prorate" field is true and the date range spans more than one calendar month (e.x., December 1 to December 31 or July 10 to August 9 is one calendar month).
  3. The "Quantity" field is specified and the value is not "1".

The final balance is calculated in the following manner:

  1. Amount specified is the starting amount.
  2. If "Prorate" is true:
    1. The date range specified is used to determine the number of full or partial months the transaction has spanned. The amount is then multiplied by that number. For instance, if the date range entered is from August 1 to September 15, then the amount entered will be multipled by 1.5.
  3. If "Quantity" is specified:
    1. The amount is multipled by the quantity specified.
  4. If taxes are applicable:
    1. If Tax Included is specified and "true", and the customer is not marked as "Tax Exempt":
      1. Taxes will be calculated with an ending amount of the resulting amount from steps 1-3
    2. If Tax Included is not specified, or is specified and is "false", and the customer is not marked as "Tax Exempt":
      1. Taxes will be calculated based on the resulting amount and added to the transaction.
    3. Otherwise,
      1. No taxes will be added to the amount.

So, for example, if a transaction was being entered for $10, with the Prorate field being "True", the date range being August 1 to September 15, and the Quantity field being 1, the before-tax amount would be calculated from the following:

$10 * 1.5 months * 2 = $30.00
Tax will then be applied from the $30.00 resulting amount.

Transactions_Query

Required Input (choose at least one)

  • CustomerID As Integer – Customer ID of transaction.
  • StatementID As Integer – Statement ID of transaction.
  • LineID As Integer – Service ID of transaction.

Optional Input

  • Date – Date range to search, based on the created date of the transaction.
    • Start As Date – Start date of transactions to return.
    • End As Date – End date of transactions to return.

Output

  • Transactions – List of transactions, sorted by created date ascending.
    • Transaction – Transaction information
      • Type As Enum_Type – Type of transaction.
        • CHARGE – Transaction charged the customer for the amount given.
        • CREDIT – Transaction credited the customer for the amount given.
      • ID As Integer – The ID of the transaction. ID's for charges and credits may overlap, however ID's of the same type will not (e.x., there could be a charge with ID 1000 and a credit with ID 1000).
      • Amount As Decimal – Amount of transaction.
      • Quantity As Integer – Original quantity entered.
      • Description As String – Transaction Description.
      • ProductID As Integer – Product ID applied to transaction.
      • ProductTypeID As Integer – Product Type ID applied to transaction.
      • CustomerID As Integer – Customer transaction applies to.
      • LineID As Integer – Service transaction applies to.
      • CustomerProductID As Integer – Customer Product transaction applies to.
      • DateStart As Date – Start date of transaction.
      • DateEnd As Date – End date of transaction.
      • TaxIncluded As Boolean – If transaction was calculated as tax-inclusive or tax-exclusive.
      • Prorate As Boolean – If transaction was prorated based on the date range.
        • StatementID As Integer – Statement transaction is on.
      • CreatedDate As Date – Date transaction was created.

Transactions_Update

Required Input

  • Transaction – Transaction information.
    • Type As Enum_Type – Type of transaction. Valid values are:
      • CHARGE – A transaction that charged the customer.
      • CREDIT – A transaction that credited the customer.
    • ID As Integer – The ID of the transaction
    • Amount As Decimal – Prohibited, however if specified must match current value.
    • Quantity As Integer – Prohibited, however if specified must match current value.
    • Description As String – Description of transaction. Optional, however this is the only field that can actually be updated.
    • ProductID As Integer – Prohibited, however if specified must match current value.
    • ProductTypeID As Integer – Prohibited, however if specified must match current value.
    • CustomerID As Integer – Prohibited, however if specified must match current value.
    • LineID As Integer – Prohibited, however if specified must match current value.
    • CustomerProductID As Integer – Prohibited, however if specified must match current value.
    • DateStart As Date – Prohibited, however if specified must match current value.
    • DateEnd As Date – Prohibited, however if specified must match current value.
    • TaxIncluded As Boolean – Prohibited, however if specified must match current value.
    • Prorate As Boolean – Prohibited, however if specified must match current value.
    • StatementID As Integer – Prohibited, however if specified must match current value.
    • CreatedDate As Date – Prohibited, however if specified must match current value.

Output

  • Transaction – Transaction information as recorded. This will be a mirror image above as well as optional fields populated with inferred information, if applicable.

📘

Note

Only the Description field may be updated.