Skip to content

CalculateDiscountsFees

Calculate discounts and fees for customer payments associated with terms on sale invoices

Released
Updated
URLSupports
/{cf_uri}/Sale/CustomerPayment/CalculateDiscountsFees
POST
The {guid} in the URL above is replaced with the unique ID for any given company file

Attribute Details

AttributeTypeNotes
ItemsarrayAn array of sale invoice line information to calculate fees and discount
Items.RequestID
Required
StringID to uniquely identify a request within the collection
Items.SaleobjectSales invoice transaction information
Items.Sale.UID
Required
Guid (36)Foreign Key : Unique guid identifier belonging to the invoice object.
Items.Sale.Type
Required
StringInvoice type, can consist of the following: Invoice
Items.PaymentDate
Required
DateTimeDate of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
ItemsarrayAn array of invoice line information to calculate fees and discount
Items.RequestIDStringID to uniquely identify a request within the collection
Items.SaleobjectSales invoice transaction information
Items.Sale.UIDGuid (36)Foreign Key : Unique guid identifier belonging to the invoice object.
Items.Sale.TypeStringInvoice type, can consist of the following: Invoice
Items.PaymentDateDateTimeDate of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
Items.DiscountDecimal (13.2)Discount amount applicable to the invoice.
Items.DiscountForeignDecimal (13.2)Discount amount applicable to the invoice in foreign currency.
Items.DiscountExpiryDateDateTimeDate the discount is valid until, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
Items.FinanceChargeDecimal (13.2)Finance Charge amount applicable to the invoice.
Items.FinanceChargeForeignDecimal (13.2)Finance Charge amount applicable to the invoice in foreign currency.
Items.BalanceDueDateDateTimeDate the invoice balance is due, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
Items.BalanceDueDecimal (13.2)Balance amount owing on the invoice. Please note: this invoice balance does not include either Discount or FinanceCharge amounts, to include these you'll need to calculate using the values returned.
Items.BalanceDueForeignDecimal (13.2)Balance amount owing on the invoice in foreign currency. Please note: this invoice balance does not include either DiscountForeign or FinanceChargeForeign amounts, to include these you'll need to calculate using the values returned.
Items.ForeignCurrencyobjectForeign currency information in the transaction.
Items.ForeignCurrency.UIDGuid (36)Foreign Key : Unique identifier for the currency in the form of a guid.
Items.ForeignCurrency.CodeString (3)The currency code.
Items.ForeignCurrency.NameStringThe full name of the currency.
Items.ForeignCurrency.URI
Read-only
StringUniform resource identifier associated with the currency object.
Items.CurrencyExchangeRateDecimalCurrency exchange rate in the associated currency object.

Response

Request

json
{
  "Items\" : [": [
    {
      "UID": "19bc3c39-a0c1-41c8-b406-fc433f1431c0",
      "Type": "Invoice"
    },
    {
      "PaymentDate": "2013-11-04T00:00:00",
      "Discount": 260,
      "DiscountExpiryDate": "2014-07-01T00:00:00",
      "FinanceCharge": 0,
      "BalanceDueDate": "2014-07-30T00:00:00",
      "BalanceDue": 5200
    },
    {
      "RequestID": 1
    }
  ]
}