Skip to content

CalculateDiscounts

Calculate discounts for supplier payments with terms on purchase bills.

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

Attribute Details

AttributeTypeNotes
ItemsarrayAn array of bill line information to calculate discounts
Items.RequestID
Required
StringID to uniquely identify a request within the collection
Items.PurchaseobjectUnique purchases transaction information
Items.Purchase.UID
Required
Guid (36)Foreign Key : Unique guid identifier belonging to the bill object.
Items.Purchase.Type
Required
StringPurchase type, can consist of the following: Bill
Items.PaymentDate
Required
DateTimeDate of payment, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
ItemsarrayAn array of bill line information to calculate discounts
Items.RequestIDStringID to uniquely identify a request within the collection
Items.PurchaseobjectUnique purchases transaction information
Items.Purchase.UIDGuid (36)Foreign Key : Unique guid identifier belonging to the bill object.
Items.Purchase.TypeStringPurchase type, can consist of the following: Bill
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 bill.
Items.DiscountForeignDecimal (13.2)Discount amount in foreign currency applicable to the bill.
Items.DiscountExpiryDateDateTimeDate the discount is valid until, format YYYY-MM-DD HH:MM:SS { 'Date': '2013-08-11 13:33:02' }
Items.BalanceDueDateDateTimeDate the purchase bill 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 bill. Please note: this bill balance does not include Discount amounts, to include these you'll need to calculate using the values returned.
Items.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.
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": "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,
      "UID": "7a273963-b895-41d8-8009-41fd092cc5b4",
      "Code": "HRK",
      "Name": "Croatian Kuna",
      "URI": "{cf_uri}/GeneralLedger/Currency/7a273963-b895-41d8-8009-41fd092cc5b4",
      "CurrencyExchangeRate": 1
    },
    {
      "RequestID": 1
    }
  ]
}