CalculateDiscounts

Calculate discounts for supplier payments with terms on purchase bills.

Date Released: Nov 2013 Date Updated: Jan 2021
URLSupports
/{cf_uri}/Purchase/SupplierPayment/CalculateDiscounts 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

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 based on bill payment terms.

The elements list below details information for CalculateDiscounts. 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 bill line information to calculate discounts
    • RequestID String
    • ID to uniquely identify a request within the collection
    • Purchase
    • Unique purchases transaction information
      • UIDGuid (36)
      • Foreign Key: Unique guid identifier belonging to the bill object.
      • TypeString
      • Purchase type, can consist of the following:
        Bill
    • PaymentDateDateTime
    • Date of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
 

Response

  • Items []
  • An array of bill line information to calculate discounts
    • RequestID String
    • ID to uniquely identify a request within the collection
    • Purchase
    • Unique purchases transaction information
      • UIDGuid (36)
      • Foreign Key: Unique guid identifier belonging to the bill object.
      • TypeString
      • Purchase type, can consist of the following:
        Bill
    • 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 bill.
    • DiscountForeignDecimal (13.2)
    • Discount amount in foreign currency applicable to the bill.
    • DiscountExpiryDateDateTime
    • Date the discount is valid until, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
    • BalanceDueDateDateTime
    • Date the purchase bill 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 bill.

      Please note: this bill balance does not include Discount amounts, to include these you'll need to calculate using the values returned.
    • BalanceDueForeignDecimal (13.2)
    • Balance amount owing in foreign currency on the bill.

      Please note: this bill balance does not include DiscountForeign 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,
    • "Purchase" : {
      • "UID" : "abdfba11-8988-4109-b0ac-a731588fa0c4",
      • "Type" : "Bill"
      • },
      • "PaymentDate" : "2013-11-04T00:00:00"
      • }
    • ]
  • }
  • Example json response

  • {
  • "Items" : [
    • {
    • "RequestID" : 1,
    • "Purchase" : {
      • "UID" : "abdfba11-8988-4109-b0ac-a731588fa0c4",
      • "Type" : "Bill"
      • },
      • "PaymentDate" : "2013-11-04T00:00:00",
      • "Discount" : 105,
      • "DiscountForeign" : 105,
      • "DiscountExpiryDate" : "2014-02-01T00:00:00",
      • "BalanceDueDate" : "2014-02-28T00:00:00",
      • "BalanceDue" : 1069,
      • "BalanceDueForeign" : 1069,
      • "ForeignCurrency" : {
        • "UID" : "7a273963-b895-41d8-8009-41fd092cc5b4",
        • "Code" : "HRK",
        • "Name" : "Croatian Kuna",
        • "URI" : "{cf_uri}/GeneralLedger/Currency/7a273963-b895-41d8-8009-41fd092cc5b4"
        • },
      • "CurrencyExchangeRate" : 1
      • }
    • ]
  • }