Library OpenApi Overview About these APIs Architecture Authentication Error Responses Locating a Server Sessions Design Guides Guides and Hints Examples Pricing for Websites Accepting Vouchers PreAuth Payment Replication Common Apis The most used APIs Create New Sale Payment Completion Multiple Locations Delivery Addresses Customers Locations Products Staff WebHooks eCommerce Apis These APIs are often used with eCommerce website integrations Get Pricing Card Inquiry Report & Analysis Grouped or analysed report data. Typically used to build reports and dashboards Today Login Access Pinboard ReportRequest Advanced Information More indepth information Caller Handling HTTP Protocol Bulk Data Downloads Document Uploading RetailConfig Under Development Details of APIs that will be available shortly. Documentation provided is for early adopters Get Receipt

Ways that Discounts can be specified

Discounts can be applied to items or the sale to reduce the amount owing. With Fieldpine, discounts should be used sparingly. They are an exception to pricing that is typically manually applied. For more automatic pricing see other options such as pricebands, pricemaps, kits/combos.

On this page, lines in examples shown in blue are optional. eg "OptionalFieldName": 5.00 For maximum reliability you should provide these values.

Customer has fixed $5 voucher from Newspaper

If the customer has a voucher for a single product, such as $5 of chocolates, then you should supply the voucher details against the item to be discounted

In this section, the chocolates have a normal ticket price of $20, so after a $5 discount the customer is paying $15. The name of the discount is "chocspecial".

Simple (Preferred)

With this model, you list the item totalprice as the final price and specify the discount name

{
  ...
  "Saleline": [
  {
    "Pid": 2301,
    "Qty": 1,
    "TotalPrice": 15.00,
    "Discount1Name": "chocspecial",
                "Discount1Amount": 5.00
  }
  ]
}

End of Sale

In this example, the discount is listed as part of the sale and not directly associated to the item

{
  "Sale":
    "Discount1": "chocspecial",
                "Discount1Amount": 5.00

    "Saleline": [
    {
      "Pid": 2301,
      "Qty": 1,
      "TotalPrice": 20.00,
    }
    ]
}

Customer has 10% off voucher from Newspaper

In this section, the chocolates have a normal ticket price of $20 and can be discounted. Postage stamps cost $5 and cannot be discounted

Percentage discounts can be tricky to calculate as sometimes due to rounding the sum of 10% on each saleline does not equal first adding the items up and then applying 10% discount. The selection of which pricing model you use depends largely on how you intend to display this information on customer receipts. See Sales - Pricing Model for more about this.

Technical Pricing (Preferred)

With technical pricing, you apply the discount to each item and supply the details

{
  ...
  "Saleline": [
  {
    "Pid": 2301,
    "Description": "Chocolates",
    "Qty": 1,
    "TotalPrice": 18.00,
    "Discount1Name": "10%",
    "Discount1Amount": 2.00,
    "Discount1Rate": 10.00
  },
  {
    "Pid": 444,
    "Description": "Postage Stamps",
    "Qty": 1,
    "TotalPrice": 5.00
  }
  ]
}

Customer Pricing

With Customer Pricing you calculate the discount but do not assign the actual amounts to each item. Fieldpine will take care of this.

Set the Disount1Name field for each item you included in the calculation

{
  "Sale":
    "Discount1Name": "10%",
    "Discount1Amount": 2.00,
    "Discount1Rate": 10.00,

    "Saleline": [
    {
      "Pid": 2301,
      "Description": "Chocolates",
      "Qty": 1,
      "TotalPrice": 20.00,
      "Discount1Name": "10%",
    },
    {
      "Pid": 444,
      "Description": "Postage Stamps",
      "Qty": 1,
      "TotalPrice": 5.00
    }
    ]
}

Discounts and the Pricing API

If you are calling the Pricing API to price the sale then you simply need to inform the pricing API that you wish to apply a discount.

A fixed amount discount by name, which is the same effect as "simple (preferred)" above

{
  "Customer": 234665,
  "Saleline": [{
    "Pid": 246,
    "Qty": 2,
    "Sequence": 1,
    "Discount1Name": "seniors"       « Apply a "Seniors" discount to this item
  }]
}

A fixed amount discount by name, which is the same effect as "end of sale" above. In this example the discount is not applied to any specific item when you call the Pricing API, the API decides which, if any, item(s) receive this discount.

Warning. This method of applying discounts does not work for all retail configurations. We are working to implement this.

{
  "Customer": 234665,
  "Discount1Name": "seniors",       « Apply a "Seniors" discount to this sale where possible
  "Saleline": [{
    "Pid": 246,
    "Qty": 2,
    "Sequence": 1,
  }]
}

A 12.75% discount applied to one line. Same as "technical pricing (preferred) above"

{
  "Customer": 234665,
  "Saleline": [{
    "Pid": 246,
    "Qty": 2,
    "Sequence": 1,
    "Discount1Name": "percent",
    "Discount1Rate": 12.75
                            }]
                            }

A 12.75% discount applied to the sale where possible. Same as "customer pricing" above

Warning. This method of applying discounts does not work for all retail configurations. We are working to implement this.

{
  "Customer": 234665,
  "Discount1Name": "percent",
  "Discount1Rate": 12.75,
  "Saleline": [{
    "Pid": 246,
    "Qty": 2,
    "Sequence": 1
  }]
}