Send Discounts

Introduction

You can send order-level discounts and, optionally, connect each discount to specific order items.

Deliverect supports an overall order discount on the total value of the order.

How discounts appear in an order

Send the discount total as a negative value.

For example, discountTotal: -100 applies a discount of 1 euro, or the equivalent unit for any currency used by the merchant, to the total order amount.

Example order payload showing discountTotal as a negative value

Discount details (optional)

You can also specify discount details as a discounts array in the order payload.

{
  "discounts": [
    {
      "type": "order_flat_off",
      "provider": "restaurant",
      "name": "FLATOFF",
      "channelDiscountCode": "",
      "referenceId": 1,
      "value": 800,
      "amount": 800
    }
  ]
}

Reference a discount on a specific item by adding the discountReferenceIds array at item level when creating the order. The value in discountReferenceIds must match the discount referenceId.


"items": [
    {
      "plu": "CHKROY",
      "name": "Chicken Royale",
      "price": 749,
      "quantity": 1,
      "remark": null,
      "subItems": [],
      "discountReferenceIds": [
        1
      ]
    }
  ]

Parameters

ParameterMeaningData Type
typeMapped channel discount type from the list of discount types in Deliverectstring
providerThe issuer of the discount, meaning the party that bears the discounted amount. See the list of provider types in Deliverect.Enum (string)
nameThe name given to the discountstring
channelDiscountCodeThe unique discount code used by the channelstring
referenceIdThe unique identifier assigned to the discount. Use this value in `discountReferenceIds` to reference the discount on individual order items.integer
valueThe flat amount or percentage covered by the discount, stored with precision 2 (e.g., $1.50 ➜ 150, 25.1% ➜ 2510)integer
amountThe actual amount discounted. For example, for 10% off a $50 bill, value is 1000 and amount is 500.integer

Troubleshooting

You included a discount, but dispatching the order returns an error

If Deliverect returns "discountTotal": "Invalid value passed.", check that you send discountTotal as a negative number, such as "discountTotal": -100,.

You have added a discount, but it is not showing in Deliverect

Check that the Send Discounts toggle is active for the Deliverect test channel to pass discounts onto the POS. You can activate this by going to the channel link settings page. Select the Show More toggle at the top right of the page if it is not visible.

Channel link settings page showing the Send Discounts toggle