GUIDE

Treats, discounts and tips in myDATA through the API: what to send, and the discount trap

The API has no discount field, and a discount field is accepted without being applied: the document reaches myDATA at full price. How to send a discount, a treat and a tip, and what the accountant decides.

Three things that happen on every shift, and none of them is a charged line: a treat on the house, a discount for a regular, a tip on the card. All three have a specific shape in the API, and one of them has a trap that raises no error.

The discount: there is no field, and that raises no error

The API has no discount field, neither on the line nor on the total. And a discount-shaped field you send is accepted and ignored: the call succeeds, the document takes its ΜΑΡΚ, and it reaches myDATA at full price. No error, on either side.

The discount is computed in your system and sent as a reduced value on the line:

Line fieldWhat you send
unit_priceThe menu price
net_total_price, vat_total, subtotalThe amounts after the discount

The document shows the menu price beside the line's reduced value, which is what the guest reads as a discount. A discount on the whole bill is spread across the lines, because the document's totals are the sum of its lines.

Do not send it as a deduction. The deductions field is for real deductions: a discount there is transmitted to myDATA as a deduction and prints under the deductions breakdown, so the record says something other than what happened.

The treat: a zero-value line

The treated item goes on the 11.1 receipt as a zero-value line. It is the same shape as a 100% discount on the line:

Line fieldWhat you send
unit_priceThe menu price
net_total_price, vat_total, subtotal0
vat_rateThe item's real rate, not 0
classification_category / classification_typecategory1_95 / _
  • The rate stays the real one. With vat_rate: 0 on the zero line, myDATA rejects it with error 217.
  • A receipt treated in full issues too, with every line at zero.
  • On the 8.6 order note a zero-value line cannot sit beside priced lines: myDATA rejects the note with error 222. The treated item goes on its own all-zero note, or only on the receipt.

The complete body is in the JSON examples for the treat.

Or a 6.1 self-supply

A treat can also be issued as a 6.1 self-supply document, on its own book, with category1_6 and E3_595, the payment method "on credit" and the reason in notes. The same shape is used for the staff meal.

Which of the two applies, a zero-value line or a 6.1, is the business's accountant's call, as is the VAT base of a self-supply. The API issues both. Your system does well to leave the choice to the venue's settings.

The tip: outside the totals

The tip goes in the receipt's tip_amount field. It is not a line and it does not enter the totals: a receipt with a €10.00 net value and €2.40 VAT stays at total_amount €12.40, with the tip beside it. It prints on the online receipt, the A4 and the thermal print.

How a tip is treated for tax, for the business and for the employee, is for the business's accountant to answer.

How to start

Sign up free at wrapp.ai with your VAT number and press "Try the API": you get a login email and an API key for staging.wrapp.ai, with no tax effect, and you can try a treat, a discount and a tip before the first guest sees them. The picture of the whole shift is in the guide to restaurant ordering systems and myDATA.

Frequently asked questions

How do I send a discount through the API?

As a reduced value on the line: unit_price at the menu price, and net_total_price, vat_total and subtotal at the amounts after the discount. The API has no discount field, and a discount on the whole bill is spread across the lines.

What happens if I send a discount field?

It is accepted and ignored. The call succeeds, the document takes its ΜΑΡΚ and reaches myDATA at full price, with no error at all.

Can I send the discount as a deduction?

No. The deductions field is transmitted to myDATA as a deduction and prints in the deductions breakdown, so a discount there declares something other than what happened.

How do I put a treat on the receipt?

As a zero-value line: unit_price at the menu price, zero amounts, category1_95 with _, and the real VAT rate. With vat_rate 0 myDATA rejects it with error 217. A treat can also be issued as a 6.1, and which applies is the accountant's call.

Can the treat go on the order note?

Not beside priced lines: an 8.6 with a priced line and a zero line is rejected with error 222. The treated item goes on its own all-zero note, or only on the receipt.

Where does the tip go?

In the 11.1 receipt's tip_amount. It is not a line and does not enter the totals, and it prints on every version of the receipt. Its tax treatment is for the accountant to answer.

Need help?

If you have a question about this topic or want to make sure everything is set up correctly, contact us and we will look at it together.