CalculateDiscountsFees

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

Date Released: Nov 2013 Date Updated: Dec 2020
URLSupports
/{cf_uri}/Sale/CustomerPayment/CalculateDiscountsFees GET |  PUT |  POST |  DELETE
The {guid} in the URL above is replaced with the unique ID for any given company file

Please note: While accessibility via the API is available to both AccountRight and new Essentials files. Not all features will be displayed in Product for new Essentials or the AccountRight Browser

Heads up! POSTing to this endpoint results not only in a 200 Status Response, but a payload JSON object as detailed below is passed back with calculated discounts and fees based on invoice payment terms.

The elements list below details information for CalculateDiscountsFees. To view the descriptions for the elements you can either hover any attribute to reveal details or click here to show all details inline.

Items shown with are required when posting or puting data
Items shown with are read-only elements

Request

  • Items []
  • An array of sale invoice line information to calculate fees and discount
    • RequestID String
    • ID to uniquely identify a request within the collection
    • Sale
    • Sales invoice transaction information
      • UIDGuid (36)
      • Foreign Key: Unique guid identifier belonging to the invoice object.
      • TypeString
      • Invoice type, can consist of the following:
        Invoice
    • PaymentDateDateTime
    • Date of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
 

Response

  • Items []
  • An array of invoice line information to calculate fees and discount
    • RequestID String
    • ID to uniquely identify a request within the collection
    • Sale
    • Sales invoice transaction information
      • UIDGuid (36)
      • Foreign Key: Unique guid identifier belonging to the invoice object.
      • TypeString
      • Invoice type, can consist of the following:
        Invoice
    • PaymentDateDateTime
    • Date of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
    • DiscountDecimal (13.2)
    • Discount amount applicable to the invoice.
    • DiscountForeignDecimal (13.2)
    • Discount amount applicable to the invoice in foreign currency.
    • DiscountExpiryDateDateTime
    • Date the discount is valid until, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
    • FinanceChargeDecimal (13.2)
    • Finance Charge amount applicable to the invoice.
    • FinanceChargeForeignDecimal (13.2)
    • Finance Charge amount applicable to the invoice in foreign currency.
    • BalanceDueDateDateTime
    • Date the invoice balance is due, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
    • 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.
    • 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.
    • ForeignCurrency
    • Foreign currency information in the transaction.
      • UIDGuid (36)
      • Foreign Key: Unique identifier for the currency in the form of a guid.
      • CodeString (3)
      • The currency code.
      • NameString
      • The full name of the currency.
      • URIString
      • Uniform resource identifier associated with the currency object.
    • CurrencyExchangeRateDecimal
    • Currency exchange rate in the associated currency object.

Example json request

  • {
  • "Items" : [
    • {
    • "RequestID" : 1,
    • "Sale" : {
      • "UID" : "19bc3c39-a0c1-41c8-b406-fc433f1431c0",
      • "Type" : "Invoice"
      • },
      • "PaymentDate" : "2013-11-04T00:00:00"
      • }
    • ]

  • }
  • Example json response

  • {
  • "Items" : [
    • {
    • "RequestID" : 1,
    • "Sale" : {
      • "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
      • }
    • ]
  • }