Explanation of the event
The addSessionLine event occurs whenever a new article line is added to the current session.
addSessionLine A new article is added
Request
This event occurs when article number 1 is added.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
POST https://www.example.com/webhooks/addSessionLine X-Mplus-Subscription-Id: example_subscription X-Mplus-Signature: ... Content-Type: application/json Accept: application/json { "addSessionLine": { "line": { "articleNumber": 1, "lineId": "c686f63d-46a7-498e-b421-c72e5cb7136b", "priceIncl": 2.50, "quantity": 1, "text": "Coffee" } }, "event": { "eventBlocking": true, "eventCounter": 1, "eventTimestamp": "2017-08-09T16:07:33.964+02:00" }, "sender": { "branchNumber": 1, "workplaceNumber": 1 }, "session": { "sessionId": "5eea25d4-4188-43b8-9a66-8086561d590c", "lines": [ { "lineId": "c686f63d-46a7-498e-b421-c72e5cb7136b", "articleNumber": 1, "priceIncl": 2.50, "quantity": 1, "text": "Coffee" } ] } } |
Property | Type | Explanation |
---|---|---|
addSessionLine.line.lineId | uuid | The new line’s UUID. |
addSessionLine.line.articleNumber | bigint | The new line’s MplusKASSA article number. |
addSessionLine.line.priceIncl | number | The new line’s price including VAT. |
addSessionLine.line.quantity | number | The new line’s quantity of items. |
addSessionLine.line.text | string | The new line’s textual description. |
Response
You can apply an external discount to the line that was just added or to any other line that is present in the session.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
HTTP/1.1 200 OK X-Mplus-Signature: ... Content-Type: application/json { "lineChanges": [ { "lineId": "c686f63d-46a7-498e-b421-c72e5cb7136b", "externalDiscount": { "discountId": "12551430-7ce9-11e7-bb31-be2e44b06b34", "discountDescription": "Sample Voucher", "discountPercentage": 100 } } ] } |
Property | Type | Explanation |
---|---|---|
lineChanges.lineId | uuid | The UUID of the session line that you want to change. |
lineChanges.externalDiscount.discountId | uuid | This is a UUID you generate and store to remember that you applied this discount. |
lineChanges.externalDiscount.discountPercentage | number | The discount percentage that you want to apply to the line. |
lineChanges.externalDiscount.discountDescription | text | A descriptive label for the discount. |